From b06ecde2997b72a41b2f2d25d55e61d30ea46bc2 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Fri, 18 Oct 2013 07:36:38 -0400 Subject: features/qemu-block: simplify coroutine model to use single synctask, ucontext The current coroutine model, mapping synctasks 1-1 with qemu internal Coroutines, has some unresolved raciness issues. This problem usually manifests as lifecycle mismatches between top-level (gluster created) synctasks and the subsequently created internal coroutines from that context. Qemu's internal queueing (and locking) can cause situations where the top-level synctask is destroyed before the internal scheduler has released references to memory, leading to use after free crashes and asserts. Simplify the coroutine model to use a single synctask as a coroutine processor and rely on the existing native ucontext coroutine implementation. The syncenv thread is donated to qemu and ensures a single top-level coroutine is processed at a time. Qemu now has complete control over coroutine scheduling. BUG: 986775 Change-Id: I38223479a608d80353128e390f243933fc946fd6 Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.org/6110 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/qemu-block/src/qemu-block.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/features/qemu-block/src/qemu-block.c') diff --git a/xlators/features/qemu-block/src/qemu-block.c b/xlators/features/qemu-block/src/qemu-block.c index 0edb7b9493d..48bbf314048 100644 --- a/xlators/features/qemu-block/src/qemu-block.c +++ b/xlators/features/qemu-block/src/qemu-block.c @@ -204,6 +204,7 @@ qb_local_init (call_frame_t *frame) qb_local = GF_CALLOC (1, sizeof (*qb_local), gf_qb_mt_qb_local_t); if (!qb_local) return -1; + INIT_LIST_HEAD(&qb_local->list); qb_local->frame = frame; frame->local = qb_local; -- cgit