[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC] evtchn: add early-out to evtchn_move_pirqs()
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Fri, 8 Apr 2022 10:41:14 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=3Qk8r6tMph7YlJ0wonA36vDVHlkC5Llyql8w+K4+Rr0=; b=e5zQE273TN6SdqznA5jlG2Gbn3Uclk6HJKU3HQb+AJ/R6Aw5ktBUO+gUT8n6EUiySL4tKmo1GkaK5skuQjqpnSoRL/TSi+q83tGwrXIyPgvAGx8KGsoxEUMBK662/h09Pi4jmhpEVkH+sFjTZ8E4C+Wdg/x4auE/47BSHIQvNNP1KLQ5FBElCXVFgkbtqdgf48SNofls1sDM5xk1B0sIikNVoQhsiEVXBddSOUsKoOx4X4FxigyzWBbG50K/i08/624UKGGhf20vX2xfBR/J8Rxm9jsiBye/aZHqo8DZdSC7lqHKpy9LWscIirNUwC8FI482tM7/0/U+U9de4bU3UA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jQsg5J+2W/m2Is+Yhn0xeU6RzHXUinEDVGaLp1UKOkOi4OQiPBIUuPHqD0rhKf/uGzr33zj8lufaH4n9K5rrct4QGHtK7hHrCWCfsS1DE19qbWPwscg4l7QFk0FYgBW5EvxqhIrCtX3gWF7/4OySChOHwHSNNVbJ3acr6v7SIqwE3Ev6h2TjcqdgZ4L/KP5eXCwFr7eTjYyu52RtcreVO1GHnzTiEHabkyFHANu+z+Xr9jKeisBiixuxG3Bp8YUGEcWmT+VlpEz1P5j2DI9UDJTL6mjRepX1X23pd1pYwXsMP+27BBxYlSpcYrWkOSok6tir00XT+YDeWJZAQRQ7+A==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>
- Delivery-date: Fri, 08 Apr 2022 10:42:28 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYSxiRdnHI8V+CTUSAwReJymUaGqzl1CMA
- Thread-topic: [PATCH RFC] evtchn: add early-out to evtchn_move_pirqs()
> On 8 Apr 2022, at 08:16, Jan Beulich <jbeulich@xxxxxxxx> 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.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
I’ve tested this patch on a Juno board, starting Dom0, creating/destroying few
guests,
doing some networking from guests of different cpu pool and everything worked.
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>
> --- 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.
> + */
> + if ( !v->pirq_evtchn_head )
> + return;
> +
> spin_lock(&d->event_lock);
> for ( port = v->pirq_evtchn_head; port; port = chn->u.pirq.next_port )
> {
>
>
|