[patch] Re: stalled 'sync' on ext3+quota over drbd

Jan Kara jack at ucw.cz
Mon Apr 19 13:29:19 UTC 2004


> On Tue, 2004-04-06 at 13:50, Eugene Crosser wrote:
> > More representative statistics for my "quota on ext3" trouble:
> > 
> > after moving about 10,000 files and setting quota for a million
> > groupids, and then several hours of inactivity(!) I zeroed profile
> > counters (readprofile -r), ran `time sync' and then `readprofile'.  Here
> > are the results.  Yes, that's true, it took 3 (three) hours for `sync'
> > to complete!
> Turns out there's a nasty O(N^2) behaviour in vfs_quota_sync().  That
> function walks the dquot list looking for things to sync, and it drops
> the lock when doing the actual syncing --- so each item synced causes it
> to start again at the beginning of the list.  If each item starts off
> dirty, then the list walk is N^2.
> An obvious cure is to shift the start of the list to point just after
> the item just synced.  I've done only limited testing of this patch, but
> does it help for you?
> 2.4 and 2.6 seem to share this problem.
  Yes, both 2.4 and 2.6 have this problem. I've just never seen it
reported. Your fix should work although it relies a bit on the fact that
there are no other users of inuse list which would be non-atomical...
I'll try to think of something which would not rely on this fact and is
reasonably easy to implement.

						Thanks for fix

More information about the Ext3-users mailing list