From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLvqO-0002Cz-CZ for qemu-devel@nongnu.org; Thu, 12 Feb 2015 10:38:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLvqJ-0004jQ-8I for qemu-devel@nongnu.org; Thu, 12 Feb 2015 10:38:20 -0500 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:49335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLvqJ-0004ix-0m for qemu-devel@nongnu.org; Thu, 12 Feb 2015 10:38:15 -0500 Received: by mail-we0-f169.google.com with SMTP id k48so10913722wev.0 for ; Thu, 12 Feb 2015 07:38:14 -0800 (PST) Date: Thu, 12 Feb 2015 15:38:10 +0000 From: Stefan Hajnoczi Message-ID: <20150212153810.GA4054@stefanha-thinkpad.redhat.com> References: <1421197016-69426-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <1421197016-69426-1-git-send-email-agraf@suse.de> 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: Alexander Graf Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 14, 2015 at 01:56:56AM +0100, Alexander Graf wrote: > On hosts with limited virtual address space (32bit pointers), we can very > easily run out of virtual memory with big thread pools. >=20 > Instead, we should limit ourselves to small pools to keep memory footprint > low on those systems. >=20 > This patch fixes random VM stalls like >=20 > (process:25114): GLib-ERROR **: gmem.c:103: failed to allocate 1048576 = 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, A= ioContext *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); This patch has not been applied. Have there been any changes in this area? Stefan --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU3MjiAAoJEJykq7OBq3PIT4wH/ipRpy3UJhThB7zWf1JdPrqn dbdU/ILnzo63j23OK08q4CAQWACMH7C8i178wdQeX25oeNRq5qBPLIJ05zgm36Ap uI7LGuzKgzDA/GXR66Re1lc/EXcN66w8cPTshSYCUvB3uRmxQwdcI2jdvQpBgxfM xEhJQHJRJP7lB/nNIDbofhxvuTUp/crdQtpTZru37/YMHlOWyWLj60v+JYJhLZrH DKV5XS+vZ3iUXxjl7tbYHg75ElVlTfmpnB6jasQRK2ShRQ0HynvJrzfA/txfAaIE HDWHKFTnuRv3Mwp4qCLtO5Q3Eojq4F5+UEaB9D7BiJmtlFL11/lNSfWMBDqeKng= =kdzx -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--