From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgyQC-0003Y2-BJ for qemu-devel@nongnu.org; Mon, 05 Sep 2016 14:15:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgyQA-0001DO-GC for qemu-devel@nongnu.org; Mon, 05 Sep 2016 14:15:03 -0400 From: Kevin Wolf Date: Mon, 5 Sep 2016 20:13:54 +0200 Message-Id: <1473099234-10882-43-git-send-email-kwolf@redhat.com> In-Reply-To: <1473099234-10882-1-git-send-email-kwolf@redhat.com> References: <1473099234-10882-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 42/42] coroutine: reduce stack size to 64kB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Peter Lieven evaluation with the recently introduced maximum stack usage monitoring revealed that the actual used stack size was never above 4kB so allocating 1MB stack for each coroutine is a lot of wasted memory. So reduce the stack size to 64kB which should still give enough head room. The guard page added in qemu_alloc_stack will catch a potential stack overflow introduced by this commit. Signed-off-by: Peter Lieven Reviewed-by: Eric Blake Acked-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- include/qemu/coroutine_int.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/coroutine_int.h b/include/qemu/coroutine_int.h index 14d4f1d..fd71172 100644 --- a/include/qemu/coroutine_int.h +++ b/include/qemu/coroutine_int.h @@ -28,7 +28,7 @@ #include "qemu/queue.h" #include "qemu/coroutine.h" -#define COROUTINE_STACK_SIZE (1 << 20) +#define COROUTINE_STACK_SIZE (1 << 16) typedef enum { COROUTINE_YIELD = 1, -- 1.8.3.1