summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-01 14:00:06 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-02 19:19:22 +0530
commitae53812b2ccfd7842fa6430081465ed90f18814b (patch)
treeb51fc1ac004643958646cc7c980aee3189ec3282 /xlators/performance/io-threads/src/io-threads.h
parentb64fa35870b54b8d9e62afd71c92e35b1f7a4cfd (diff)
io-threads: Allow scaling to be switched off
The default is also to provide no scaling. For both, ordered and unordered request pools, when scaling is off, we maintain atleast the minimum number of threads specified in the volfile. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.h')
-rw-r--r--xlators/performance/io-threads/src/io-threads.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h
index 412b3cc7638..a613884da45 100644
--- a/xlators/performance/io-threads/src/io-threads.h
+++ b/xlators/performance/io-threads/src/io-threads.h
@@ -60,6 +60,11 @@ struct iot_request {
#define IOT_MIN_THREADS 32
#define IOT_MAX_THREADS 512
+#define IOT_SCALING_OFF 1
+#define IOT_SCALING_ON 2
+#define iot_ordered_scaling_on(conf) ((conf)->o_scaling == IOT_SCALING_ON)
+#define iot_unordered_scaling_on(conf) ((conf)->u_scaling == IOT_SCALING_ON)
+
struct iot_worker {
struct list_head rqlist; /* List of requests assigned to me. */
struct iot_conf *conf;
@@ -98,7 +103,12 @@ struct iot_conf {
int o_idle_time; /* in Secs. The idle time after which an
ordered thread exits.
*/
-
+ int o_scaling; /* Set to IOT_SCALING_OFF if user does not want
+ thread scaling on ordered threads.
+ If scaling is off, io-threads maintains
+ at least min_o_threads number of threads
+ and never lets any thread exit.
+ */
struct iot_worker **oworkers; /* Ordered thread pool. */
@@ -114,6 +124,13 @@ struct iot_conf {
request for this amount of secs, it should
try to die.
*/
+ int u_scaling; /* Set to IOT_SCALING_OFF if user does not want
+ thread scaling on unordered threads.
+ If scaling is off, io-threads maintains
+ at least min_u_threads number of threads
+ and never lets any thread exit.
+ */
+
};
typedef struct iot_conf iot_conf_t;