summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-03-04 17:13:31 -0500
committerChris Mason <chris.mason@fusionio.com>2013-03-07 07:52:40 -0500
commitde3cb945db4d8eb3b046dc7a5ea89a893372750c (patch)
treed3f479c1431a2607d7154d7a1e10878533d38008 /fs/btrfs/delayed-inode.h
parent3a01aa7a25274308fe813a6237f678aed901cea3 (diff)
downloadlinux-de3cb945db4d8eb3b046dc7a5ea89a893372750c.tar.gz
linux-de3cb945db4d8eb3b046dc7a5ea89a893372750c.tar.bz2
linux-de3cb945db4d8eb3b046dc7a5ea89a893372750c.zip
Btrfs: improve the delayed inode throttling
The delayed inode code batches up changes to the btree in hopes of doing them in bulk. As the changes build up, processes kick off worker threads and wait for them to make progress. The current code kicks off an async work queue item for each delayed node, which creates a lot of churn. It also uses a fixed 1 HZ waiting period for the throttle, which allows us to build a lot of pending work and can slow down the commit. This changes us to watch a sequence counter as it is bumped during the operations. We kick off fewer work items and have each work item do more work. Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.h')
-rw-r--r--fs/btrfs/delayed-inode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
index 78b6ad0fc669..1d5c5f7abe3e 100644
--- a/fs/btrfs/delayed-inode.h
+++ b/fs/btrfs/delayed-inode.h
@@ -43,6 +43,7 @@ struct btrfs_delayed_root {
*/
struct list_head prepare_list;
atomic_t items; /* for delayed items */
+ atomic_t items_seq; /* for delayed items */
int nodes; /* for delayed nodes */
wait_queue_head_t wait;
};
@@ -86,6 +87,7 @@ static inline void btrfs_init_delayed_root(
struct btrfs_delayed_root *delayed_root)
{
atomic_set(&delayed_root->items, 0);
+ atomic_set(&delayed_root->items_seq, 0);
delayed_root->nodes = 0;
spin_lock_init(&delayed_root->lock);
init_waitqueue_head(&delayed_root->wait);