From: Wang Sheng-Hui <shhuiw@gmail.com>
To: Chris Mason <chris.mason@oracle.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] btrfs/async-thread: introduce macro BTRFS_WORKERS_IDLE_THRESH to replace the magic number 32 used for btrfs_workers->idle_thresh
Date: Mon, 19 Mar 2012 14:35:33 +0800 [thread overview]
Message-ID: <4F66D3B5.60008@gmail.com> (raw)
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
reply other threads:[~2012-03-19 6:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F66D3B5.60008@gmail.com \
--to=shhuiw@gmail.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.