summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.h
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2016-07-22 13:11:15 -0400
committerJeff Darcy <jdarcy@redhat.com>2016-07-28 11:52:06 -0700
commit1faf452818fe51fae1f07d17afab910a5e0da0cd (patch)
tree4731e6094e8a31625481567527986248e588b4d9 /xlators/performance/io-threads/src/io-threads.h
parent25d1bdc094a8408afc074817ec6d63c812c571f9 (diff)
io-threads: distribute work fairly among clients
This is the full "queue of queues" approach where each client gets its own queue (per priority) and we round-robin among them. Change-Id: I73955d1b9bb93f2ff781b48dfe2509009c519ec6 BUG: 1360402 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/14904 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.h')
-rw-r--r--xlators/performance/io-threads/src/io-threads.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h
index 6d9ea255909..7c4ce7849b4 100644
--- a/xlators/performance/io-threads/src/io-threads.h
+++ b/xlators/performance/io-threads/src/io-threads.h
@@ -48,6 +48,11 @@ typedef enum {
IOT_PRI_MAX,
} iot_pri_t;
+typedef struct {
+ struct list_head clients;
+ struct list_head reqs;
+} iot_client_ctx_t;
+
struct iot_conf {
pthread_mutex_t mutex;
pthread_cond_t cond;
@@ -58,7 +63,14 @@ struct iot_conf {
int32_t idle_time; /* in seconds */
- struct list_head reqs[IOT_PRI_MAX];
+ struct list_head clients[IOT_PRI_MAX];
+ /*
+ * It turns out that there are several ways a frame can get to us
+ * without having an associated client (server_first_lookup was the
+ * first one I hit). Instead of trying to update all such callers,
+ * we use this to queue them.
+ */
+ iot_client_ctx_t no_client[IOT_PRI_MAX];
int32_t ac_iot_limit[IOT_PRI_MAX];
int32_t ac_iot_count[IOT_PRI_MAX];
@@ -68,7 +80,7 @@ struct iot_conf {
gf_boolean_t least_priority; /*Enable/Disable least-priority */
xlator_t *this;
- size_t stack_size;
+ size_t stack_size;
};
typedef struct iot_conf iot_conf_t;