From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gu Zheng Subject: Re: About releasing vcpu when closing vcpu fd Date: Thu, 29 May 2014 13:40:08 +0800 Message-ID: <5386C838.3070102@cn.fujitsu.com> References: <537AEC13.1000804@cn.fujitsu.com> <20140523094345.GC5306@minantech.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: ChenFan , Gleb Natapov , Paolo Bonzini , To: Gleb Natapov Return-path: Received: from cn.fujitsu.com ([59.151.112.132]:18672 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756571AbaE2Fus (ORCPT ); Thu, 29 May 2014 01:50:48 -0400 In-Reply-To: <20140523094345.GC5306@minantech.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi Gleb, On 05/23/2014 05:43 PM, Gleb Natapov wrote: > CCing Paolo. > > On Tue, May 20, 2014 at 01:45:55PM +0800, Gu Zheng wrote: >> Hi Gleb, >> Excuse me for offline noisy. > You will get much quicker response if you'll post to the list :) Got it.:) > >> 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. 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. Best regards, Gu > > -- > Gleb. >