From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anshul Makkar Subject: Re: About releasing vcpu when closing vcpu fd Date: Fri, 6 Jun 2014 15:02:59 +0200 Message-ID: References: <537AEC13.1000804@cn.fujitsu.com> <20140523094345.GC5306@minantech.com> <5386C838.3070102@cn.fujitsu.com> <20140529081203.GA32254@minantech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Gu Zheng , ChenFan , Gleb Natapov , Paolo Bonzini , kvm , Igor Mammedov To: Gleb Natapov Return-path: Received: from mail-qa0-f41.google.com ([209.85.216.41]:34817 "EHLO mail-qa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbaFFNDU (ORCPT ); Fri, 6 Jun 2014 09:03:20 -0400 Received: by mail-qa0-f41.google.com with SMTP id dc16so3745909qab.0 for ; Fri, 06 Jun 2014 06:03:20 -0700 (PDT) In-Reply-To: <20140529081203.GA32254@minantech.com> Sender: kvm-owner@vger.kernel.org List-ID: IIRC, Igor was of the opinion that patch for vcpu deletion will be incomplete till its handled properly in kvm i.e vcpus are destroyed completely. http://comments.gmane.org/gmane.comp.emulators.kvm.devel/114347 . So can the above proposal where just vcpus can be disabled and reused in qemu is an acceptable solution ? Thanks Anshul Makkar On Thu, May 29, 2014 at 10:12 AM, Gleb Natapov wrote: > 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 , 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. > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html