2004-04-22 15:19:27

by Jan Kara

[permalink] [raw]
Subject: [PATCH] Per-sb dquot dirty lists

Hi,

when there are lots of dirty dquots the vfs_quota_sync() is too slow
(it has O(N^2) behaviour). Attached patch implements list of dirty
dquots for each superblock and quota type. Using this lists sync is
trivially linear. Attached patch is against 2.6.5 with journalled quota
and previous patch for hash table size. Please apply.

Thanks
Honza


Attachments:
(No filename) (369.00 B)
quota-2.6.5-5-dirtylist.diff (7.72 kB)
Download all attachments

2004-04-23 18:37:34

by Stephen C. Tweedie

[permalink] [raw]
Subject: [2.4 patch] fix O(N^2) dquot sync behaviour

--- linux-2.4/fs/dquot.c.=K0000=.orig
+++ linux-2.4/fs/dquot.c
@@ -397,6 +397,10 @@ restart:
wait_on_dquot(dquot);
if (dquot_dirty(dquot))
sb->dq_op->write_dquot(dquot);
+ /* Move the inuse_list head pointer to just after the
+ * current dquot, so that we'll restart the list walk
+ * after this point on the next pass. */
+ list_move(&inuse_list, &dquot->dq_inuse);
dqput(dquot);
goto restart;
}


Attachments:
dquot-refile.patch (422.00 B)