From: "Jan Beulich" Subject: Re: [PATCH] credit: generalize __vcpu_has_soft_affinity() Date: Wed, 04 Mar 2015 12:53:25 +0000 Message-ID: <54F70E55020000780006635F@mail.emea.novell.com> References: <54F6DB6602000078000660F3@mail.emea.novell.com> <1425470906.2614.41.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YT8nr-0007YA-V4 for xen-devel@lists.xenproject.org; Wed, 04 Mar 2015 12:53:32 +0000 In-Reply-To: <1425470906.2614.41.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 04.03.15 at 13:08, wrote: > On Wed, 2015-03-04 at 09:16 +0000, Jan Beulich wrote: >> --- a/xen/common/sched_credit.c >> +++ b/xen/common/sched_credit.c >> @@ -292,11 +292,9 @@ __runq_remove(struct csched_vcpu *svc) >> static inline int __vcpu_has_soft_affinity(const struct vcpu *vc, >> const cpumask_t *mask) >> { >> - if ( cpumask_full(vc->cpu_soft_affinity) >> - || !cpumask_intersects(vc->cpu_soft_affinity, mask) ) >> - return 0; >> - >> - return 1; >> + return !cpumask_subset(&cpu_online_map, vc->cpu_soft_affinity) && >> > This can use VCPU2ONLINE(vc). Or do you think the impact of one more if > (the ?: in cpupool_online_cpumask) would be too much? No, I think that would be fine. I simply wasn't aware of the construct. v2 soon to come. Jan