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

Re: [PATCH RFC] evtchn: add early-out to evtchn_move_pirqs()


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 11 Apr 2022 08:13:13 +0200
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ETHHPGadrGIBjS/7HRxDm2c4pKN8l04pwuOifkVBBuA=; b=VD/UJfPNvnNsxUJ1RVB3oD3b44zwxokFIB7oImqcbcezpW2alajduNSnW+9riKjDnu3AyTEBJI8EieGx2vc+SVg7yiyaL68URrqdPk2pISREWh05TmBANNfBnkQJ+qOu26uSkIyrQbOW9Z2Xca8vGtP709UBIDlC86W3azoLkKcdPdsb+bcv36TVNvn7Hf5nq7KYfq3um+BgFZaexciqRY4EDf/72ieyAHY5PuRCmYOe89/NkMx792O6eN1yputbkt83+37+DJjuRXGLT0uZCeuu9plZPceWlfQkL2YQsqyitoiBgjSTr1NAfKCX4MdKRtH+S80VaxhY7JEm/1Bg+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=drb5rZRqDxx3iWkHbAuRRZS+Xh2k7kc/PPNHFAGEEG594+pFsv86tixRhMYW/4PhMY/HTxIpkG5xBoQ7UJd8GUi4OM+mFuEVeCsf27IS0j9g6UtNxc/CisftuXu9Ndi4gaj5X0bXZeMe5iB9vEZAe7ACc+TrCyeuQVw/2cRLvY71PrpWN5A1fUmEcMTqm/PFGtNWluQHaRWxjis+bu4N1VMOj8GiabqorEiP6hi4QhZOu4zqKYlL8+5ofJ2+zfRKP6MSjJIuzl1Ew18hp3uF9fKnboUt11yDP6831VEaET2fGD2zWMeqlDyUdvtmj6eovD/N1iIFQbOrje/zotMhvA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 11 Apr 2022 06:13:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.04.2022 19:17, Julien Grall wrote:
> On 08/04/2022 13:25, Jan Beulich wrote:
>> On 08.04.2022 13:02, Julien Grall wrote:
>>> On 08/04/2022 08:16, Jan Beulich wrote:
>>>> See the code comment. The higher the rate of vCPU-s migrating across
>>>> pCPU-s, the less useful this attempted optimization actually is. With
>>>> credit2 the migration rate looks to be unduly high even on mostly idle
>>>> systems, and hence on large systems lock contention here isn't very
>>>> difficult to observe.
>>>
>>> "high" and "large" is quite vague. Do you have more details on where you
>>> observed this issue and the improvement after this patch?
>>
>> I have no data beyond the observation on the failed 4.12 osstest flights,
>> where I mentioned I would make such a patch and send out as RFC.
> 
> Ok. I think a pointer to the failed 4.12 osstest would be good here.

Done, albeit personally I don't think that's overly helpful.

>>>> --- a/xen/common/event_channel.c
>>>> +++ b/xen/common/event_channel.c
>>>> @@ -1559,6 +1559,16 @@ void evtchn_move_pirqs(struct vcpu *v)
>>>>        unsigned int port;
>>>>        struct evtchn *chn;
>>>>    
>>>> +    /*
>>>> +     * The work done below is an attempt to keep pIRQ-s on the pCPU-s 
>>>> that the
>>>> +     * vCPU-s they're to be delivered to run on. In order to limit lock
>>>> +     * contention, check for an empty list prior to acquiring the lock. 
>>>> In the
>>>> +     * worst case a pIRQ just bound to this vCPU will be delivered 
>>>> elsewhere
>>>> +     * until the vCPU is migrated (again) to another pCPU.
>>>> +     */
>>>
>>> AFAIU, the downside is another pCPU (and therefore vCPU) will get
>>> disturbed by the interrupt.
>>
>> But only rarely, i.e. in case a race would actually have occurred.
> 
> Maybe I am too paranoid here. The other side of race is controlled by a 
> domain. So wouldn't it be possible to increase how often the race is hit?

Yes, of course - just to harm itself. The important points are
- that correctness will be maintained, and
- that this is relevant for pass-through guests only (which are
  already not supposed to be entirely untrusted).

Jan




 


Rackspace

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