All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Xu <anthony.xu@intel.com>
Cc: Yang Zhong <yang.zhong@intel.com>,
	qemu-devel@nongnu.org, Chao P Peng <chao.p.peng@intel.com>
Subject: Re: [Qemu-devel] [PATCH v1 1/2] reduce qemu's heap Rss size from 12252kB to 2752KB
Date: Sat, 11 Mar 2017 12:02:03 -0500 (EST)	[thread overview]
Message-ID: <236110410.1797136.1489251723081.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <4712D8F4B26E034E80552F30A67BE0B1A0FC31@ORSMSX112.amr.corp.intel.com>



----- Original Message -----
> From: "Anthony Xu" <anthony.xu@intel.com>
> To: "Paolo Bonzini" <pbonzini@redhat.com>, "Yang Zhong" <yang.zhong@intel.com>, qemu-devel@nongnu.org
> Cc: "Chao P Peng" <chao.p.peng@intel.com>
> Sent: Friday, March 10, 2017 8:30:06 PM
> Subject: RE: [PATCH v1 1/2] reduce qemu's heap Rss size from 12252kB to 2752KB
> 
> > > Ideally, freeing QOM object should not require a global lock.
> > > If you see any other QOM requiring a global lock, please let us know, we
> > are willing to fix it.
> > 
> > All of them.  When unplugging a device, the device object will be freed
> > from an RCU callback.
> > 
> 
> Thanks for your reply,
> Some objects may not need lock at all to be freed,
> Some objects may just need a small lock to be freed,
> 
> Should we let RCU callbacks to decide which lock they need instead of
> enforcing the global lock in RCU thread?

Splitting the global lock and deciding which object requires which lock
is very, very hard.

The problem is that everything calling object_unref potentially needs the
global lock, and that includes the following call chain: object_unref
-> memory_region_unref -> flatview_destroy -> flatview_unref ->
address_space_update_topology -> memory_region_transaction_commit.

Paolo

> As for the device object, can we get the global lock inside the object
> free/destroy function for now?
> 
> If we can remove the global lock inside RCU thread, we can save 9MB heap
> memory, that's a lot!
> 
> Please share with us if you have other idea to do this.
> 
> Thanks
> Anthony
> 
> 
> 
> 

  reply	other threads:[~2017-03-11 17:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 15:14 [Qemu-devel] [PATCH v1 1/2] reduce qemu's heap Rss size from 12252kB to 2752KB Yang Zhong
2017-03-10  8:41 ` Paolo Bonzini
2017-03-10 16:05   ` Xu, Anthony
2017-03-10 16:07     ` Paolo Bonzini
2017-03-10 19:30       ` Xu, Anthony
2017-03-11 17:02         ` Paolo Bonzini [this message]
2017-03-10 15:14 ` [Qemu-devel] [PATCH v1 2/2] " Yang Zhong
2017-03-10  9:14   ` Paolo Bonzini
2017-03-10 17:40     ` Xu, Anthony
2017-03-11 17:04       ` Paolo Bonzini
2017-03-14  5:14         ` Xu, Anthony
2017-03-14 10:14           ` Paolo Bonzini
2017-03-14 21:23             ` Xu, Anthony
2017-03-15  8:36               ` Paolo Bonzini
2017-03-15 19:05                 ` Xu, Anthony
2017-03-15 20:21                   ` Paolo Bonzini
2017-03-16  2:47                     ` Zhong, Yang
2017-03-16 20:02                     ` Xu, Anthony
2017-03-22 11:46                       ` Paolo Bonzini
2017-03-22 18:26                         ` Xu, Anthony

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=236110410.1797136.1489251723081.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony.xu@intel.com \
    --cc=chao.p.peng@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yang.zhong@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.