btrfs/async-thread: introduce macro BTRFS_WORKERS_IDLE_THRESH to replace the magic number 32 used for btrfs_workers->idle_thresh
PATCH 1/1 btrfs/async-thread: introduce macro BTRFS_WORKERS_IDLE_THRESH to replace the magic number 32 used for btrfs_workers->idle_thresh
Signed-off-by Wang Sheng-Hui <[email protected]>
--- fs/btrfs/async-thread.c | 2 +- fs/btrfs/async-thread.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-)
fs/btrfs/async-thread.c +1 -1
@@ -445,7 +445,7 @@ void btrfs_init_workers(struct btrfs_workers *workers, char *name, int max,spin_lock_init (&workers->lock);spin_lock_init (&workers->order_lock); workers->max_workers = max; - workers->idle_thresh =32 ; + workers->idle_thresh =BTRFS_WORKERS_IDLE_THRESH ; workers->name = name; workers->ordered =0 ; workers->atomic_start_pending =0 ;
fs/btrfs/async-thread.h +7 -1
@@ -60,6 +60,9 @@ struct btrfs_work {struct list_head order_list; }; +/* default value for btrfs_workers->idle_thresh */ +#define BTRFS_WORKERS_IDLE_THRESH 32 +struct btrfs_workers {/* current number of running workers */ int num_workers;
@@ -69,7 +72,10 @@ struct btrfs_workers {/* max number of workers allowed. changed by btrfs_start_workers */ int max_workers; -/* once a worker has this many requests or fewer, it is idle */ +/* +* once a worker has this many requests or fewer, it is idle. +* default to BTRFS_WORKERS_IDLE_THRESH, which 32 is used currently. +*/ int idle_thresh;/* force completions in the order they were queued */
Signature · 1 line
1.7.1