qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Zhong Yang <yang.zhong@intel.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	weidong.huang@huawei.com, zhang.zhanghailiang@huawei.com,
	liujunjie23@huawei.com, wangxinxin.wang@huawei.com,
	stone.xulei@huawei.com, qemu-devel@nongnu.org,
	anthony.xu@intel.com, arei.gonglei@huawei.com,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim()
Date: Mon, 20 Nov 2017 14:03:44 +0000	[thread overview]
Message-ID: <20171120140344.GE4516@stefanha-x1.localdomain> (raw)
In-Reply-To: <20171120084141.GA6622@yangzhon-Virtual>

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

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).

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2017-11-20 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17  6:23 [Qemu-devel] [PATCH] rcu: reduce half heap memory size by malloc_trim() Yang Zhong
2017-11-17 13:54 ` Stefan Hajnoczi
2017-11-17 14:06   ` Daniel P. Berrange
2017-11-20  8:54     ` Zhong Yang
2017-11-20 14:14       ` Daniel P. Berrange
2017-11-21  5:46         ` Zhong Yang
2017-11-20  8:41   ` Zhong Yang
2017-11-20 14:03     ` Stefan Hajnoczi [this message]
2017-11-21  3:20       ` Zhong Yang
2017-11-20 14:28 ` Fam Zheng
2017-11-21  3:12   ` Zhong Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171120140344.GE4516@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=anthony.xu@intel.com \
    --cc=arei.gonglei@huawei.com \
    --cc=liujunjie23@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=stone.xulei@huawei.com \
    --cc=wangxinxin.wang@huawei.com \
    --cc=weidong.huang@huawei.com \
    --cc=yang.zhong@intel.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).