From 8dfdecf220d1c9365e1f8d6af9ead5e48c61e2eb Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Fri, 15 Sep 2017 06:59:01 -0700 Subject: Replace namespace/io-stats/io-threads with 3.6-fb versions This rolls up multiple patches related to namespace identificaton and throttling/QoS. This primarily includes the following, all by Michael Goulet . io-threads: Add weighted round robin queueing by namespace https://phabricator.facebook.com/D5615269 io-threads: Add per-namespaces queue sizes to IO_THREADS_QUEUE_SIZE_KEY https://phabricator.facebook.com/D5683162 io-threads: Implement better slot allocation algorithm https://phabricator.facebook.com/D5683186 io-threads: Only enable weighted queueing on bricks https://phabricator.facebook.com/D5700062 io-threads: Update queue sizes on drain https://phabricator.facebook.com/D5704832 Fix parsing (-1) as default NS weight https://phabricator.facebook.com/D5723383 Parts of the following patches have also been applied to satisfy dependencies. io-throttling: Calculate moving averages and throttle offending hosts https://phabricator.fb.com/D2516161 Shreyas Siravara Hook up ODS logging for FUSE clients. https://phabricator.facebook.com/D3963376 Kevin Vigor Add the flag --skip-nfsd-start to skip the NFS daemon stating, even if it is enabled https://phabricator.facebook.com/D4575368 Alex Lorca There are also some "standard" changes: dealing with code that moved, reindenting to comply with Gluster coding standards, gf_uuid_xxx, etc. This patch *does* revert some changes which have occurred upstream since 3.6; these will be re-applied as apppropriate on top of this new base. Change-Id: I69024115da7a60811e5b86beae781d602bdb558d Signed-off-by: Jeff Darcy --- libglusterfs/src/stack.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libglusterfs/src/stack.h') diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index 9e5355a6044..094dc62312c 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -77,6 +77,8 @@ struct _call_frame_t { const char *wind_to; const char *unwind_from; const char *unwind_to; + + gf_fop_pri_t pri; }; struct _ns_info { @@ -122,6 +124,16 @@ struct _call_stack_t { ns_info_t ns_info; }; +#define frame_set_throttling(frm, should_throttle) \ + do { \ + if (frm) { \ + if (should_throttle) { \ + frm->pri = IOT_PRI_LEAST; \ + } else { \ + frm->pri = IOT_PRI_UNSPEC; \ + } \ + } \ + } while (0) #define frame_set_uid_gid(frm, u, g) \ do { \ @@ -259,6 +271,7 @@ STACK_RESET (call_stack_t *stack) _new->wind_from = __FUNCTION__; \ _new->wind_to = #fn; \ _new->unwind_to = #rfn; \ + _new->pri = frame->pri; \ \ LOCK_INIT (&_new->lock); \ LOCK(&frame->root->stack_lock); \ @@ -321,6 +334,8 @@ STACK_RESET (call_stack_t *stack) _new->wind_from = __FUNCTION__; \ _new->wind_to = #fn; \ _new->unwind_to = #rfn; \ + _new->pri = frame->pri; \ + \ LOCK_INIT (&_new->lock); \ LOCK(&frame->root->stack_lock); \ { \ -- cgit