All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@kernel.org>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: ChenFan <chen.fan.fnst@cn.fujitsu.com>,
	Gleb Natapov <gleb@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: About releasing vcpu when closing vcpu fd
Date: Thu, 29 May 2014 11:12:04 +0300	[thread overview]
Message-ID: <20140529081203.GA32254@minantech.com> (raw)
In-Reply-To: <5386C838.3070102@cn.fujitsu.com>

On Thu, May 29, 2014 at 01:40:08PM +0800, Gu Zheng wrote:
> >> There was a patch(from Chen Fan, last august) about releasing vcpu when
> >> closing vcpu fd <http://www.spinics.net/lists/kvm/msg95701.html>, but
> >> your comment said "Attempt where made to make it possible to destroy 
> >> individual vcpus separately from destroying VM before, but they were
> >> unsuccessful thus far."
> >> So what is the pain here? If we want to achieve the goal, what should we do?
> >> Looking forward to your further comments.:)
> >>
> > CPU array is accessed locklessly in a lot of places, so it will have to be RCUified.
> > There was attempt to do so 2 year or so ago, but it didn't go anyware. Adding locks is
> > to big a price to pay for ability to free a little bit of memory by destroying vcpu. 
> 
> Yes, it's a pain here. But if we want to implement "vcpu hot-remove", this must be
> fixed sooner or later.
Why?  "vcpu hot-remove" already works (or at least worked in the past
for some value of "work").  No need to destroy vcpu completely, just
park it and tell a guest not to use it via ACPI hot unplug event.

> And any guys working on kvm "vcpu hot-remove" now?
> 
> > An
> > alternative may be to make sure that stopped vcpu takes as little memory as possible.
> 
> Yeah. But if we add a new vcpu with the old id that we stopped before, it will fail.
> 
No need to create vcpu again, just unpark it and notify a guest via ACPI hot plug event that
vcpu can be used now.

--
			Gleb.

  reply	other threads:[~2014-05-29  8:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <537AEC13.1000804@cn.fujitsu.com>
     [not found] ` <20140523094345.GC5306@minantech.com>
2014-05-29  5:40   ` About releasing vcpu when closing vcpu fd Gu Zheng
2014-05-29  8:12     ` Gleb Natapov [this message]
2014-06-06 13:02       ` Anshul Makkar
2014-06-06 13:36         ` Gleb Natapov
2014-06-06 13:41           ` Anshul Makkar
2014-06-30 14:41             ` Anshul Makkar
2014-07-01  2:07               ` Gu Zheng
2014-07-11  9:59                 ` Anshul Makkar
2014-07-02  9:43               ` Igor Mammedov
2014-07-04  8:30                 ` Anshul Makkar

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=20140529081203.GA32254@minantech.com \
    --to=gleb@kernel.org \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=gleb@redhat.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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.