From 98bd9830da7071eed71c95611da7ef8a5f1cf71e Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Mon, 4 May 2015 16:43:02 +0530 Subject: dht/rebalance: Throttle rebalance Throttle value will be "normal" by default. For throttling down, a thread will be put in to sleep. And for throttling up, gf_defrag_process_dir will wake up the sleeping threads. Change-Id: I74d530e3effd6e60e6eec81ccc8ff65789fa9c13 Signed-off-by: Susant Palai Reviewed-on: http://review.gluster.org/10526 Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- xlators/cluster/dht/src/dht-common.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/cluster/dht/src/dht-common.h') diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index baf244d0564..3e2d5d725e9 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -346,6 +346,13 @@ struct gf_defrag_info_ { int32_t abort; int32_t wakeup_crawler; + /*Throttle params*/ + /*stands for reconfigured thread count*/ + int32_t recon_thread_count; + /*stands for current running thread count*/ + int32_t current_thread_count; + pthread_cond_t df_wakeup_thread; + /* Hard link handle requirement */ synclock_t link_lock; }; @@ -421,6 +428,7 @@ struct dht_conf { /* Support size-weighted rebalancing (heterogeneous bricks). */ gf_boolean_t do_weighting; gf_boolean_t randomize_by_gfid; + char *dthrottle; dht_methods_t *methods; -- cgit