From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [Patch] remove unneeded test for cpu in cpupool Date: Wed, 16 Mar 2011 11:14:27 +0000 Message-ID: References: <4D8092BB.4030006@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4D8092BB.4030006@ts.fujitsu.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: Juergen Gross Cc: "Przywara, Andre" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 16/03/2011 10:36, "Juergen Gross" wrote: > On 03/16/11 11:13, Keir Fraser wrote: >> On 16/03/2011 06:34, "Juergen Gross" wrote: >> >>> Hi, >>> >>> attached patch removes an unneeded check in vcpu_migrate(). >>> >>> Andre, could you please give it a try on your 48 core machine with >>> >>> xl cpupool-numa-split >>> >>> I'd like to make sure the check is really not needed. On my machines it >>> worked >>> okay, but your machine seems to trigger races more easily. >> >> Could you BUG_ON failing this test when we exit the retry loop? It seems a >> suitable loop post-condition. > > Not easily. The cpu_valid mask of a cpupool might change between the call of > pick_cpu and the test. In the normal case this is okay, as removing a cpu > from a cpupool (which is the critical case) will call cpu_disable_scheduler() > after removing the cpu from the mask, which will migrate the vcpu away. > > Using a saved copy of cpu_valid for the test isn't working either, if a cpu > is added to and removed from the cpupool in a very short time. I would have > to use a generation count for the cpu_valid mask and do the check only if > the count didn't change. I think this is little bit of overkill here, but if > you'd prefer it, I can do a patch. Ah no, if it's more subtle than it appears, and it's not a straighjtforward post-condition, then I wouldn't bother. -- Keir > > Juergen