[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V9 7/7] coroutine: reduce stack size to 60kB
From: |
Peter Lieven |
Subject: |
[Qemu-devel] [PATCH V9 7/7] coroutine: reduce stack size to 60kB |
Date: |
Tue, 27 Sep 2016 11:58:46 +0200 |
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
60kB 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. The 60kB + guard page will result in an allocation of
64kB per coroutine on systems where a page is 4kB.
Signed-off-by: Peter Lieven <address@hidden>
---
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..be14260 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 61440
typedef enum {
COROUTINE_YIELD = 1,
--
1.9.1
- [Qemu-devel] [PATCH V9 0/7] coroutine: mmap stack memory and stack size, Peter Lieven, 2016/09/27
- [Qemu-devel] [PATCH V9 3/7] coroutine: add a macro for the coroutine stack size, Peter Lieven, 2016/09/27
- [Qemu-devel] [PATCH V9 1/7] oslib-posix: add helpers for stack alloc and free, Peter Lieven, 2016/09/27
- [Qemu-devel] [PATCH V9 6/7] oslib-posix: add a configure switch to debug stack usage, Peter Lieven, 2016/09/27
- [Qemu-devel] [PATCH V9 5/7] coroutine-sigaltstack: use helper for allocating stack memory, Peter Lieven, 2016/09/27
- [Qemu-devel] [PATCH V9 7/7] coroutine: reduce stack size to 60kB,
Peter Lieven <=
- [Qemu-devel] [PATCH V9 2/7] coroutine-sigaltstack: rename coroutine struct appropriately, Peter Lieven, 2016/09/27
- [Qemu-devel] [PATCH V9 4/7] coroutine-ucontext: use helper for allocating stack memory, Peter Lieven, 2016/09/27