From: Keir Fraser Subject: Re: [PATCH 3/3] x86_64: allow more vCPU-s per guest Date: Thu, 18 Jun 2009 10:36:38 +0100 Message-ID: References: <4A3A24A7020000780000679F@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4A3A24A7020000780000679F@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 18/06/2009 10:27, "Jan Beulich" wrote: >> Applied. Is the vcpu[] array re-allocation in XEN_DOMCTL_max_vcpus an >> example of over-optimistic-concurrency-control? It can't really be 100% safe >> without extra locking on all users of that array (not good), or using rcu >> (better), can it. The wmb() is a nice try. ;-) > > Agreed. Originally I intended to add at least a comment, but after realizing > that the path currently is only reached during domain creation (and I believe > there are issues elsewhere if one would really allow increasing the # of > vCPU-s in a domain on the fly), I decided to leave it as is (and the wmb() > can be considered sort of a comment to that effect). Then I think it would be better to make that domctl really singleshot (i.e., fail if d->max_vcpus is already non-zero), with a comment explaining why it is implemented this way. Buggily implementing an unused case can't be good. Can you generate a patch for this, please? Is it safe do you think to go from d->max_vcpus=0 to d->max_vcpus!=0 on a live domain? (i.e, the specific case we do use in your general observation that increasing d->max_vcpus may be dangerous)? -- Keir