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

Re: [Xen-devel] [PATCH v2 2/2] xen: merge temporary vcpu pinning scenarios


  • To: Juergen Gross <JGross@xxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Wed, 24 Jul 2019 10:07:40 +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=71zGrWYcTUQ6svJkRRvp5X6Prp58NS0KUhhyzar1144=; b=oSWB8onuF+Ic1dxAMsjfaGutAP1VadgyVCXCYSD54rtcZXicOxAEQjzSiNbZzbmfl5DREUUkasTRvC8nq/eZsq/RDVwjR63lbT+uMqSIu9Rp+Tbuskapki57IYRafEPMr0PjFha9D0QLAkalbSFduDIBSvq2fLgU8yMvspjAN311dyF7eObnL1ecmhcxZmq8zpgagv98t3nEvo7iS9djLiQWlVNG5x+nw5o0Z1/jo2UG7qVgAtU3bsWiGw81a/DU5wVphYWu28LhO/kdwjUdmVEOdulnnVG0npM8i5IlAjSVV1l2kvSnc3weuCUp+tJO5rZ0a4R3oJYVtSnH2VADvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a0wo7E2EWqUzzFLPf+1cYZcG1iDmdTh2QTwnsagOFw6NUQuBIGJ9hzSpbkW0J8J2CNv72UAN+6GCR5x+MltVp23FcZDeR4OSYKv1q0cyDdl4pYhuRukc57sW3mQ8K1kvD6EkYrQIe5ibpCM8pYGaS+UMwdhlv6YwH+/sB2Rh4fdMDFvVxfS8UFb/1xH1IBzqdR2QMpu5JmivY4LewthYS30+iKh/xYZeMHJGpbKakG4abNJOC3fpsG6NPatpjuuSTfvpbOTDpFU+BvIO6yVcMaGbuUoD3rhx3SC6IOCfgqwickb0qFLt54tIm+8COQKGHlny/IOMOgZJpCLBDsEplg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Tim Deegan <tim@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Jul 2019 10:12:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVQYQU1WujqebfXkKqWlkiYmjVv6bZjDEA
  • Thread-topic: [PATCH v2 2/2] xen: merge temporary vcpu pinning scenarios

On 23.07.2019 20:25, Juergen Gross wrote:
> Today there are two scenarios which are pinning vcpus temporarily to
> a single physical cpu:
> 
> - wait_event() handling
> - vcpu_pin_override() handling
> 
> Each of those cases are handled independently today using their own
> temporary cpumask to save the old affinity settings.
> 
> The two cases can be combined as the first case will only pin a vcpu to
> the physical cpu it is already running on, while vcpu_pin_override() is
> allowed to fail.
> 
> So merge the two temporary pinning scenarios by only using one cpumask
> and a per-vcpu bitmask for specifying which of the scenarios is
> currently active (they are allowed to nest).

Hmm, "nest" to me means LIFO-like behavior, but the logic is more relaxed
afaict.

> @@ -1267,7 +1284,8 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
> arg)
>          if ( copy_from_guest(&sched_pin_override, arg, 1) )
>              break;
>   
> -        ret = vcpu_pin_override(current, sched_pin_override.pcpu);
> +        cpu = sched_pin_override.pcpu < 0 ? NR_CPUS : 
> sched_pin_override.pcpu;

I don't think you mean the caller to achieve the same effect by both
passing in a negative value or NR_CPUS - it should remain to be just
negative values which clear the override.

Everything else looks fine to me, thanks.

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®.