diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-08-15 15:34:18 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:06 -0400 |
commit | 53863232ef961778aa414b700ed88a48e8e871e6 (patch) | |
tree | 05a74ac264a5fb4f6b8824771f5820ca5907afe5 /fs/btrfs/async-thread.c | |
parent | 4854ddd0ed0a687fc2d7c45a529c406232e31e7b (diff) |
Btrfs: Lower contention on the csum mutex
This takes the csum mutex deeper in the call chain and releases it
more often.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/async-thread.c')
-rw-r--r-- | fs/btrfs/async-thread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 958cd8b5f0d7..2ee301740195 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -48,6 +48,7 @@ struct btrfs_worker_thread { /* number of things on the pending list */ atomic_t num_pending; + unsigned long sequence; /* protects the pending list. */ @@ -242,7 +243,7 @@ static struct btrfs_worker_thread *next_worker(struct btrfs_workers *workers) worker = list_entry(next, struct btrfs_worker_thread, worker_list); atomic_inc(&worker->num_pending); worker->sequence++; - if (worker->sequence % 4 == 0) + if (worker->sequence % workers->idle_thresh == 0) list_move_tail(next, &workers->worker_list); return worker; } |