* [PATCH] btrfs/async-thread: introduce macro BTRFS_WORKERS_IDLE_THRESH to replace the magic number 32 used for btrfs_workers->idle_thresh
@ 2012-03-19 6:35 Wang Sheng-Hui
0 siblings, 0 replies; only message in thread
From: Wang Sheng-Hui @ 2012-03-19 6:35 UTC (permalink / raw)
To: Chris Mason, linux-btrfs, linux-kernel
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
fs/btrfs/async-thread.c | 2 +-
fs/btrfs/async-thread.h | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 5a7d756..2491096 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -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;
diff --git a/fs/btrfs/async-thread.h b/fs/btrfs/async-thread.h
index f34cc31..9b9522e 100644
--- a/fs/btrfs/async-thread.h
+++ b/fs/btrfs/async-thread.h
@@ -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 */
--
1.7.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-19 6:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 6:35 [PATCH] btrfs/async-thread: introduce macro BTRFS_WORKERS_IDLE_THRESH to replace the magic number 32 used for btrfs_workers->idle_thresh Wang Sheng-Hui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).