From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN1ee-0003Ao-2m for qemu-devel@nongnu.org; Tue, 12 Jul 2016 13:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bN1eZ-0002dI-Nv for qemu-devel@nongnu.org; Tue, 12 Jul 2016 13:39:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN1eZ-0002dD-FP for qemu-devel@nongnu.org; Tue, 12 Jul 2016 13:39:27 -0400 References: <1468340586-19304-1-git-send-email-pl@kamp.de> <1468340586-19304-7-git-send-email-pl@kamp.de> From: Eric Blake Message-ID: <57852B4C.6050104@redhat.com> Date: Tue, 12 Jul 2016 11:39:24 -0600 MIME-Version: 1.0 In-Reply-To: <1468340586-19304-7-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LTgfidDpKstgliU9C6p9J7ECxkOmOJgak" Subject: Re: [Qemu-devel] [PATCH V5 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, mreitz@redhat.com, pbonzini@redhat.com, mst@redhat.com, dgilbert@redhat.com, peter.maydell@linaro.org, rth@twiddle.net, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LTgfidDpKstgliU9C6p9J7ECxkOmOJgak From: Eric Blake To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, mst@redhat.com, dgilbert@redhat.com, peter.maydell@linaro.org, rth@twiddle.net, armbru@redhat.com Message-ID: <57852B4C.6050104@redhat.com> Subject: Re: [PATCH V5 6/6] coroutine: reduce stack size to 64kB References: <1468340586-19304-1-git-send-email-pl@kamp.de> <1468340586-19304-7-git-send-email-pl@kamp.de> In-Reply-To: <1468340586-19304-7-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/12/2016 10:23 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 s= tack > 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. >=20 > Signed-off-by: Peter Lieven > --- > include/qemu/coroutine_int.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake >=20 > 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" > =20 > -#define COROUTINE_STACK_SIZE (1 << 20) > +#define COROUTINE_STACK_SIZE (1 << 16) > =20 > typedef enum { > COROUTINE_YIELD =3D 1, >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --LTgfidDpKstgliU9C6p9J7ECxkOmOJgak Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXhStMAAoJEKeha0olJ0NqrgAIAIfvdGBfCbMxt7YmlTws/WSM jwkL5NsyCno6rdRAwFHLzPgmX3wn3JoIUX/EnmLGcTftb5Wh9Du8rhsHWrR3rTao /D659ztQL625u6oaozR7pJtD82V0EVMoupqcl/vVbM91DFhVpwzxvVQD5vH3VhbM rkW1Ib892E7v0daEMDb+7ip8iB9jh3AM2T2E8k/tPXDJviQnijzD0/No03e/JxPg qgyHyYUdQ8s+JM0iBDXcj6znE+cm+hMMxuniUjuZEfVHjTHGCV+M4KUxZCmS5V+m 9ADWoyiba2mnvgKz7mPhIcu8DVxCYrtDmKZ88C+uRq+a6eC5t8MXyjJ1d2/ZwPo= =3zya -----END PGP SIGNATURE----- --LTgfidDpKstgliU9C6p9J7ECxkOmOJgak--