[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] AIO: Reduce number of threads for 32bit hosts
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH] AIO: Reduce number of threads for 32bit hosts |
Date: |
Thu, 12 Feb 2015 16:59:36 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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 very
> > easily run out of virtual memory with big thread pools.
> >
> > Instead, we should limit ourselves to small pools to keep memory footprint
> > low on those systems.
> >
> > This patch fixes random VM stalls like
> >
> > (process:25114): GLib-ERROR **: gmem.c:103: failed to allocate 1048576
> > bytes
> >
> > on 32bit ARM systems for me.
> >
> > Signed-off-by: Alexander Graf <address@hidden>
> > ---
> > thread-pool.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > 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 = 64;
> > + if (sizeof(pool) == 4) {
> > + /* 32bit systems run out of virtual memory quickly */
> > + pool->max_threads = 4;
> > + } else {
> > + pool->max_threads = 64;
> > + }
> > pool->new_thread_bh = aio_bh_new(ctx, spawn_thread_bh_fn, pool);
> >
> > QLIST_INIT(&pool->head);
>
> This patch has not been applied.
>
> 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
pgpixk1pLe3_Y.pgp
Description: PGP signature