summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-26 08:56:22 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-26 08:56:22 -0700
commit984e695365b2b60997a41f496854e597ecbf196f (patch)
tree7490cfc118a4de9dbc2a3f8038b86fbf86148c76 /include/linux
parent2187a5e40da5350c3c7c95ae1b5091bc4a5b68ad (diff)
[PATCH] Per-sb dquot dirty lists
From: Jan Kara <jack@ucw.cz> 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. (Jan had a test which went from 8 minutes to 0.8 seconds...)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/quota.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 7f43ae55e891..bbd9134abaf3 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -163,6 +163,7 @@ struct quota_format_type;
struct mem_dqinfo {
struct quota_format_type *dqi_format;
+ struct list_head dqi_dirty_list; /* List of dirty dquots */
unsigned long dqi_flags;
unsigned int dqi_bgrace;
unsigned int dqi_igrace;
@@ -176,13 +177,11 @@ struct super_block;
#define DQF_MASK 0xffff /* Mask for format specific flags */
#define DQF_INFO_DIRTY_B 16
-#define DQF_ANY_DQUOT_DIRTY_B 17
#define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */
-#define DQF_ANY_DQUOT_DIRTY (1 << DQF_ANY_DQUOT_DIRTY_B) /* Is any dquot dirty? */
extern void mark_info_dirty(struct super_block *sb, int type);
#define info_dirty(info) test_bit(DQF_INFO_DIRTY_B, &(info)->dqi_flags)
-#define info_any_dquot_dirty(info) test_bit(DQF_ANY_DQUOT_DIRTY_B, &(info)->dqi_flags)
+#define info_any_dquot_dirty(info) (!list_empty(&(info)->dqi_dirty_list))
#define info_any_dirty(info) (info_dirty(info) || info_any_dquot_dirty(info))
#define sb_dqopt(sb) (&(sb)->s_dquot)
@@ -213,6 +212,7 @@ struct dquot {
struct hlist_node dq_hash; /* Hash list in memory */
struct list_head dq_inuse; /* List of all quotas */
struct list_head dq_free; /* Free list element */
+ struct list_head dq_dirty; /* List of dirty dquots */
struct semaphore dq_lock; /* dquot IO lock */
atomic_t dq_count; /* Use count */
wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */