[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] xen/sched: fix locking in restore_vcpu_affinity()


  • To: Juergen Gross <JGross@xxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Tue, 23 Jul 2019 12:08:21 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oxlv3Czbf0Ig3VGYHImN8O7N2zYxFkxSFbuEwKjg8jM=; b=HoPu5CtFD+VKnrUifjovzNOe0fyDQbmdy9alIwzq0WAkvn8jB/PNqEygoxqrwfTUVvRpd/742bY1netlfs1XULkDyadB+iCyQUbHvBjKv+dtSHSam6NvhH7glh6OtIQWXr4l3KRNJ6/U0PXwr28KeIe8Wjyhv4tpQxSW0226lgJAaL8WIDVHQiP6OfhqrTqpgnsej03BO71dURINgP9NzXoGlTDYrq9DAdNFvPD/ZZ8PxZTECD7aMusu3C56zc503LzgxZVbgHGhFJBVh+tN4L7cfJjXscM/oMQU1NAiLsL2kI2ZsVbRBk1dJoT7U2xCPsUoG9ZIhWWY4spt4cLRsQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WeNwKPwLte5eAKy2J/t65BkGJ12i73w8iqVpAJVkS8ejr71nX0sSKgUlWerY9+HX9ieuDVm+1Lm0IIPL55ZEuBJJSxSzeGT3161/c66/8fDk5R03Nd36JAEZANQTZqfxQI214v5PcuRwk6TA0VIMpqqgVE+1KBoCwV42mCFUL6pG5Ol6tjGKFZBnQOh33haE6Hn51oSi7iyv+74T58ZYXVKekOyrMrpgQtgBGSmtb1wLG/zd1qa1uUavwiGB1ji5UAiX0vRPV61qd95PQoELdsFChDWZm82rO9n04r4OdGsh5GZ5FAi4PgRpek7vrheX/lVFuSq2LZqyLEhBqPmNPw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>
  • Delivery-date: Tue, 23 Jul 2019 12:11:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVQTgHI8aGEPkD5UStXgNaqUm5nqbYHCyA
  • Thread-topic: [Xen-devel] [PATCH 1/2] xen/sched: fix locking in restore_vcpu_affinity()

On 23.07.2019 11:20, Juergen Gross wrote:
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -708,6 +708,8 @@ void restore_vcpu_affinity(struct domain *d)
>            * set v->processor of each of their vCPUs to something that will
>            * make sense for the scheduler of the cpupool in which they are in.
>            */
> +        lock = vcpu_schedule_lock_irq(v);
> +
>           cpumask_and(cpumask_scratch_cpu(cpu), v->cpu_hard_affinity,
>                       cpupool_domain_cpumask(d));
>           if ( cpumask_empty(cpumask_scratch_cpu(cpu)) )
> @@ -731,6 +733,9 @@ void restore_vcpu_affinity(struct domain *d)
>   
>           v->processor = cpumask_any(cpumask_scratch_cpu(cpu));
>   
> +        spin_unlock_irq(lock);
> +
> +     /* v->processor might have changed, so reacquire the lock. */

Whoever commits this (perhaps me, later today) will want to replace
the hard tab here.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.