From: "Jan Beulich" Subject: Re: [PATCH v2] credit: generalize __vcpu_has_soft_affinity() Date: Fri, 06 Mar 2015 13:32:23 +0000 Message-ID: <54F9BA7702000078000670C1@mail.emea.novell.com> References: <54F9672B0200007800066D4A@mail.emea.novell.com> <54F9792A.7030605@eu.citrix.com> <54F98C920200007800066EC5@mail.emea.novell.com> <54F99035.8000804@eu.citrix.com> <54F9A13C0200007800066FD4@mail.emea.novell.com> <54F996DE.6010203@eu.citrix.com> <1425648197.12503.68.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YTsMb-0001NX-Gq for xen-devel@lists.xenproject.org; Fri, 06 Mar 2015 13:32:25 +0000 In-Reply-To: <1425648197.12503.68.camel@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: "xen-devel@lists.xenproject.org" , George Dunlap List-Id: xen-devel@lists.xenproject.org >>> On 06.03.15 at 14:23, wrote: > Which means that, yes, this part of the condition must loose the '!', or > have the arguments of the call to cpumask_subset() switched. I > personally prefer the former: > > return !cpumask_subset(cpupool_online_cpumask(vc->domain->cpupool), > vc->cpu_soft_affinity) && > cpumask_subset(vc->cpu_soft_affinity, vc->cpu_hard_affinity) && > cpumask_intersects(vc->cpu_soft_affinity, mask); The form without ! and with operands swapped isn't correct afaict, since subset(x,y) is not the same as !subset(y,x). In particular when the two are identical, they are also subsets of one another. Which is precisely a case you don't want the "soft" scheduling cycle to be gone through. Jan