[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_tri
From: |
Zhong Yang |
Subject: |
Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim() |
Date: |
Tue, 21 Nov 2017 11:20:41 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Nov 20, 2017 at 02:03:44PM +0000, Stefan Hajnoczi wrote:
> On Mon, Nov 20, 2017 at 04:41:41PM +0800, Zhong Yang wrote:
> > On Fri, Nov 17, 2017 at 01:54:09PM +0000, Stefan Hajnoczi wrote:
> > > On Fri, Nov 17, 2017 at 02:23:34PM +0800, Yang Zhong wrote:
> > > > @@ -272,6 +273,9 @@ static void *call_rcu_thread(void *opaque)
> > > > node->func(node);
> > > > }
> > > > qemu_mutex_unlock_iothread();
> > > > +#ifdef CONFIG_LINUX
> > > > + malloc_trim(0);
> > > > +#endif
> > >
> > > It is important that the rcu thread isn't overzealous in minimizing heap
> > > size if that means ordinary malloc(3) calls will experience latency
> > > spikes. Please leave a few MB free so that malloc(3) doesn't take the
> > > slow path.
> > >
> > Hello Stefan,
> >
> > From the Qemu bootup procedure, the qemu malloc chunk memory from OS, not
> > from glibc free list which is freed before by Qemu. Maybe there are some
> > issues in glibc memory mechanism. I will continue to fine this parameter
> > to get better balance, Many thanks!
>
> I was suggesting malloc_trim(4 * 1024 * 1024) or similar instead of
> malloc_trim(0).
>
Hello Stefan,
Thanks for your suggestion!
I tried your suggested changes, malloc_trim(4 * 1024 * 1024), the heap size
with
this change almost same with malloc_trim(0), thanks!
Regards,
Yang
> Stefan
Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim(), Fam Zheng, 2017/11/20