Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Zhong Yang
On Mon, Nov 20, 2017 at 02:14:50PM +, Daniel P. Berrange wrote: > On Mon, Nov 20, 2017 at 04:54:42PM +0800, Zhong Yang wrote: > > On Fri, Nov 17, 2017 at 02:06:20PM +, Daniel P. Berrange wrote: > > > On Fri, Nov 17, 2017 at 01:54:09PM +, Stefan Hajnoczi wrote: > > > > On Fri, Nov 17, 20

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Zhong Yang
On Mon, Nov 20, 2017 at 02:03:44PM +, 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 +, Stefan Hajnoczi wrote: > > > On Fri, Nov 17, 2017 at 02:23:34PM +0800, Yang Zhong wrote: > > > > @@ -272,6 +273,9 @@ static vo

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Zhong Yang
On Mon, Nov 20, 2017 at 10:28:28PM +0800, Fam Zheng wrote: > On Fri, 11/17 14:23, Yang Zhong wrote: > > diff --git a/util/rcu.c b/util/rcu.c > > index ca5a63e..8d491a6 100644 > > --- a/util/rcu.c > > +++ b/util/rcu.c > > @@ -26,6 +26,7 @@ > > * IBM's contributions to this file may be relicensed u

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Fam Zheng
On Fri, 11/17 14:23, Yang Zhong wrote: > diff --git a/util/rcu.c b/util/rcu.c > index ca5a63e..8d491a6 100644 > --- a/util/rcu.c > +++ b/util/rcu.c > @@ -26,6 +26,7 @@ > * IBM's contributions to this file may be relicensed under LGPLv2 or later. > */ > > +#include BTW, if you respin, the "q

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Daniel P. Berrange
On Mon, Nov 20, 2017 at 04:54:42PM +0800, Zhong Yang wrote: > On Fri, Nov 17, 2017 at 02:06:20PM +, Daniel P. Berrange wrote: > > On Fri, Nov 17, 2017 at 01:54:09PM +, Stefan Hajnoczi wrote: > > > On Fri, Nov 17, 2017 at 02:23:34PM +0800, Yang Zhong wrote: > > > > diff --git a/util/rcu.c b/

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Stefan Hajnoczi
On Mon, Nov 20, 2017 at 04:41:41PM +0800, Zhong Yang wrote: > On Fri, Nov 17, 2017 at 01:54:09PM +, 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); >

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Zhong Yang
On Fri, Nov 17, 2017 at 02:06:20PM +, Daniel P. Berrange wrote: > On Fri, Nov 17, 2017 at 01:54:09PM +, Stefan Hajnoczi wrote: > > On Fri, Nov 17, 2017 at 02:23:34PM +0800, Yang Zhong wrote: > > > diff --git a/util/rcu.c b/util/rcu.c > > > index ca5a63e..8d491a6 100644 > > > --- a/util/rcu.

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-20 Thread Zhong Yang
On Fri, Nov 17, 2017 at 01:54:09PM +, Stefan Hajnoczi wrote: > On Fri, Nov 17, 2017 at 02:23:34PM +0800, Yang Zhong wrote: > > diff --git a/util/rcu.c b/util/rcu.c > > index ca5a63e..8d491a6 100644 > > --- a/util/rcu.c > > +++ b/util/rcu.c > > @@ -26,6 +26,7 @@ > > * IBM's contributions to th

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-17 Thread Daniel P. Berrange
On Fri, Nov 17, 2017 at 01:54:09PM +, Stefan Hajnoczi wrote: > On Fri, Nov 17, 2017 at 02:23:34PM +0800, Yang Zhong wrote: > > diff --git a/util/rcu.c b/util/rcu.c > > index ca5a63e..8d491a6 100644 > > --- a/util/rcu.c > > +++ b/util/rcu.c > > @@ -26,6 +26,7 @@ > > * IBM's contributions to th

Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-17 Thread Stefan Hajnoczi
On Fri, Nov 17, 2017 at 02:23:34PM +0800, Yang Zhong wrote: > diff --git a/util/rcu.c b/util/rcu.c > index ca5a63e..8d491a6 100644 > --- a/util/rcu.c > +++ b/util/rcu.c > @@ -26,6 +26,7 @@ > * IBM's contributions to this file may be relicensed under LGPLv2 or later. > */ > > +#include This

[Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()

2017-11-16 Thread Yang Zhong
Since there are some issues in memory alloc/free machenism in glibc for little chunk memory, if Qemu frequently alloc/free little chunk memory, the glibc doesn't alloc little chunk memory from free list of glibc and still allocate from OS, which make the heap size bigger and bigger. This patch int