From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ5kr-000303-Vb for qemu-devel@nongnu.org; Fri, 01 Jul 2016 17:13:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJ5ko-0007GN-Nr for qemu-devel@nongnu.org; Fri, 01 Jul 2016 17:13:41 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:35138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ5ko-0007GJ-JG for qemu-devel@nongnu.org; Fri, 01 Jul 2016 17:13:38 -0400 Received: by mail-qt0-x242.google.com with SMTP id i30so7801766qtd.2 for ; Fri, 01 Jul 2016 14:13:38 -0700 (PDT) Sender: Richard Henderson References: <1467272240-32123-1-git-send-email-pl@kamp.de> <1467272240-32123-7-git-send-email-pl@kamp.de> From: Richard Henderson Message-ID: Date: Fri, 1 Jul 2016 14:13:35 -0700 MIME-Version: 1.0 In-Reply-To: <1467272240-32123-7-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/6] coroutine: reduce stack size to 64kB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, mst@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, pbonzini@redhat.com On 06/30/2016 12:37 AM, Peter Lieven wrote: > 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. > > Signed-off-by: Peter Lieven > --- > 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 eac323a..f84d777 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, > Ought we check that this is not smaller than sysconf(_SC_THREAD_STACK_MIN) which (for glibc at least), is 192k for ia64, 128k for aarch64, mips and tile (though why it is quite so high in those later cases I don't know). r~