Received: from eggs.gnu.org ([2001:4830:134:3::10]:55236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLwB7-0004A4-A4 for qemu-devel@nongnu.org; Thu, 12 Feb 2015 10:59:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLwB2-0006m9-CF for qemu-devel@nongnu.org; Thu, 12 Feb 2015 10:59:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLwB2-0006m2-5G for qemu-devel@nongnu.org; Thu, 12 Feb 2015 10:59:40 -0500 Date: Thu, 12 Feb 2015 16:59:36 +0100 From: Kevin Wolf Message-ID: <20150212155936.GJ4189@noname.str.redhat.com> References: <1421197016-69426-1-git-send-email-agraf@suse.de> <20150212153810.GA4054@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20150212153810.GA4054@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH] AIO: Reduce number of threads for 32bit hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Alexander Graf , Stefan Hajnoczi , qemu-devel@nongnu.org --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 12.02.2015 um 16:38 hat Stefan Hajnoczi geschrieben: > On Wed, Jan 14, 2015 at 01:56:56AM +0100, Alexander Graf wrote: > > On hosts with limited virtual address space (32bit pointers), we can ve= ry > > easily run out of virtual memory with big thread pools. > >=20 > > Instead, we should limit ourselves to small pools to keep memory footpr= int > > low on those systems. > >=20 > > This patch fixes random VM stalls like > >=20 > > (process:25114): GLib-ERROR **: gmem.c:103: failed to allocate 104857= 6 bytes > >=20 > > on 32bit ARM systems for me. > >=20 > > Signed-off-by: Alexander Graf > > --- > > thread-pool.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > >=20 > > diff --git a/thread-pool.c b/thread-pool.c > > index e2cac8e..87a3ea9 100644 > > --- a/thread-pool.c > > +++ b/thread-pool.c > > @@ -299,7 +299,12 @@ static void thread_pool_init_one(ThreadPool *pool,= AioContext *ctx) > > qemu_mutex_init(&pool->lock); > > qemu_cond_init(&pool->worker_stopped); > > qemu_sem_init(&pool->sem, 0); > > - pool->max_threads =3D 64; > > + if (sizeof(pool) =3D=3D 4) { > > + /* 32bit systems run out of virtual memory quickly */ > > + pool->max_threads =3D 4; > > + } else { > > + pool->max_threads =3D 64; > > + } > > pool->new_thread_bh =3D aio_bh_new(ctx, spawn_thread_bh_fn, pool); > > =20 > > QLIST_INIT(&pool->head); >=20 > This patch has not been applied. >=20 > Have there been any changes in this area? I think the idea was to implement guard pages for coroutine stacks and then decrease the stack size of both coroutines and worker threads on 32 bit. Kevin --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJU3M3oAAoJEH8JsnLIjy/WeTEP/j8QzfrXQcGeMuVlrtAWyZ3a /hENdQieSGoWhma41HatjEBggQEczYUxPUQUIlGn0aGhCNhPU3orlG6/R5QbNN66 bQ3PYMoBQbePARe7kBYZrTl2zdbLUWqhogirsYi6dBzpc3ZuBdmralyZ7am30t+D htqb3s6eWoUhdAAdc+MtGIUqtkjCSuB603No09EMISoKEJhdNSNFUrBL3p5QRqLT DNi3WRd/t/bKbh/5Mlz5BrBWrzpuYuWZZCEdw+4ALSCUHQrLsPRu4vRY+Zqg5g1a dj7i3VxA6WHmc0v9Kcj1VHaTtl7d3CwnPV1rPB/LjU6aIBXsNQyQdd6BKgU8Z9KL 8hCbkWTOKs2mWmxeazOQmNOS2wLUTvlgW3sjFQetfdtkTrLMereG96QHtmr+j0Ec Q7YEe8ESze9zB/BSIv/mC4DxbT3uZdWjpQc3W5FgXmQpzwQ6bn+/ugKLlWnqx0Ne 7ANXwMJev9SoVH4rX+GYgKYdDwxekgj9Gf64ryfEd1TSBUaANFeTQqBAVLsHPe02 2RexZ15+uvaqRe3bGhHCgoQi/L0uhh1P8IRwpmJq0axYPmc0W6pvDqjTYbBaPKWB +URZT5r0bG2j5Oxh06/dWL1iwzjGoRav4J9eJadj+rcMOgp852vbFKkHyWjqB7xD 1sG5K202kU/sC8j+YcYq =83Or -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--