mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
4854ddd0ed
commit
53863232ef
4 changed files with 22 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue