summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-07-02 12:22:49 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-07-09 23:54:23 -0700
commit7f9108fc0a5c9543e18ad52759a3ebdf91900a33 (patch)
tree15ef41e0e1bc8cf691bbc1a6f88aa0c621875192 /libglusterfs/src
parent3d21219cdd53a5b6ef62501b042626133b34e0c1 (diff)
quota/marker: use smaller stacksize in synctask for marker updation
Default stacksize that synctask uses is 2M. For marker we set it to 16k Also move market xlator close to io-threads to have smaller stack Change-Id: I8730132a6365cc9e242a3564a1e615d94ef2c651 BUG: 1207735 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/11499 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/syncop.c29
-rw-r--r--libglusterfs/src/syncop.h10
2 files changed, 29 insertions, 10 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index f56a21d11b9..9b0d7aa745a 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -437,8 +437,8 @@ synctask_setid (struct synctask *task, uid_t uid, gid_t gid)
struct synctask *
-synctask_create (struct syncenv *env, synctask_fn_t fn, synctask_cbk_t cbk,
- call_frame_t *frame, void *opaque)
+synctask_create (struct syncenv *env, size_t stacksize, synctask_fn_t fn,
+ synctask_cbk_t cbk, call_frame_t *frame, void *opaque)
{
struct synctask *newtask = NULL;
xlator_t *this = THIS;
@@ -493,13 +493,21 @@ synctask_create (struct syncenv *env, synctask_fn_t fn, synctask_cbk_t cbk,
goto err;
}
- newtask->stack = GF_CALLOC (1, env->stacksize, gf_common_mt_syncstack);
+ if (stacksize <= 0) {
+ newtask->stack = GF_CALLOC (1, env->stacksize,
+ gf_common_mt_syncstack);
+ newtask->ctx.uc_stack.ss_size = env->stacksize;
+ } else {
+ newtask->stack = GF_CALLOC (1, stacksize,
+ gf_common_mt_syncstack);
+ newtask->ctx.uc_stack.ss_size = stacksize;
+ }
+
if (!newtask->stack) {
goto err;
}
newtask->ctx.uc_stack.ss_sp = newtask->stack;
- newtask->ctx.uc_stack.ss_size = env->stacksize;
makecontext (&newtask->ctx, (void (*)(void)) synctask_wrap, 2, newtask);
@@ -554,13 +562,13 @@ synctask_join (struct synctask *task)
int
-synctask_new (struct syncenv *env, synctask_fn_t fn, synctask_cbk_t cbk,
- call_frame_t *frame, void *opaque)
+synctask_new1 (struct syncenv *env, size_t stacksize, synctask_fn_t fn,
+ synctask_cbk_t cbk, call_frame_t *frame, void *opaque)
{
struct synctask *newtask = NULL;
int ret = 0;
- newtask = synctask_create (env, fn, cbk, frame, opaque);
+ newtask = synctask_create (env, stacksize, fn, cbk, frame, opaque);
if (!newtask)
return -1;
@@ -571,6 +579,13 @@ synctask_new (struct syncenv *env, synctask_fn_t fn, synctask_cbk_t cbk,
}
+int
+synctask_new (struct syncenv *env, synctask_fn_t fn, synctask_cbk_t cbk,
+ call_frame_t *frame, void *opaque)
+{
+ return synctask_new1 (env, 0, fn, cbk, frame, opaque);
+}
+
struct synctask *
syncenv_task (struct syncproc *proc)
{
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 7779fada109..2cdedc0fc11 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -259,9 +259,13 @@ struct syncenv * syncenv_new (size_t stacksize, int procmin, int procmax);
void syncenv_destroy (struct syncenv *);
void syncenv_scale (struct syncenv *env);
-int synctask_new (struct syncenv *, synctask_fn_t, synctask_cbk_t, call_frame_t* frame, void *);
-struct synctask *synctask_create (struct syncenv *, synctask_fn_t,
- synctask_cbk_t, call_frame_t *, void *);
+int synctask_new1 (struct syncenv *, size_t stacksize, synctask_fn_t,
+ synctask_cbk_t, call_frame_t *frame, void *);
+int synctask_new (struct syncenv *, synctask_fn_t, synctask_cbk_t,
+ call_frame_t *frame, void *);
+struct synctask *synctask_create (struct syncenv *, size_t stacksize,
+ synctask_fn_t, synctask_cbk_t, call_frame_t *,
+ void *);
int synctask_join (struct synctask *task);
void synctask_wake (struct synctask *task);
void synctask_yield (struct synctask *task);