[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN PATCH] xen/credit2: let the tickled pCPU pick up the unit it was tickled for
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>
- Date: Tue, 29 Sep 2026 22:05:42 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9bHk3rsSw1G5BQtibXtqslx1MAkGdUpX2+7hfOQ9N9A=; b=xciWMTucWbT1eiDYjWxOAJnsZTOTCRrJvvpJIQT4YzrnKaxVnygFaU46whrL7F3XAt3VXe3fkUAYBg36zZE6IbPpv9Pms1HgXE7ZyMIRMbKZtAMlWuohjCS45bcJA1Nk+Byqkj1k4MO/fbdupvZJsLAXrR3Bli4/z+WnO8HCEm3R1CESqeZ7Ck/av4mXoSMgfM0HJ28m5mckFislzqkq0udK8vk+3vBbFD34IPYHlwiI4ycfxtVG1R2UjMuGerZYFzAakGZhQeSDNv5qjWcRDoVr3KXJ52MKkMN/gThcphJavKHcn9+/Yq/4B0MMzXSc5/YStoJD/w5u1QGJiN9iYA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=INI78uN6nOswo4GbUjzTcMjNXjmvhesrELA8Apdg5eUQH07GnduLou/Ceua1xLIB3d36Jr7QO5vjkytFHW9yvlmMVtAU8tzW4n/TqCUKefGgJD9gtZwpy8Xta8n5qWDew8hvkRfTIFNdFpwhNQnZCibf+3cVNaEMvfzhzrlwRrK536o8Hss+gKiBbdjYP06QBuu2GHG8XrqYkKLEyMNMzA7yAh6wxOs++V9aZJArxhjfz9R3M1qV7Pbl2DxLPfGAfwQcrLa/1xDJ/jZBQ/5QkydDHj2s5NcuGNeaSmeSUUd1SLK0qYcjlUAJbVViYkw7+LyKOJjgVoSpM3PlL/2veg==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Cc: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <gwd@xxxxxxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>
- Delivery-date: Tue, 29 Sep 2026 14:07:15 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
runq_tickle() picks an idle pCPU without taking CSCHED2_MIGRATE_RESIST
into account, but runq_candidate() on that pCPU still applies it. With
the unit's credit within CSCHED2_MIGRATE_RESIST of CSCHED2_CREDIT_MIN,
the tickled pCPU declines the unit because it is not its master, while
the master has already skipped it as deferred to the tickled pCPU. Both
go idle and the unit stays runnable on the runqueue with nobody to run
it.
Seen as a permanent PVH dom0 stall under nested virtualization, where
dom0 overruns its slice far enough to be clamped at CSCHED2_CREDIT_MIN.
Don't resist migration to the pCPU that was tickled for the unit.
Fixes: 069cf39fb171 ("xen: credit2: make tickling more deterministic")
Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>
---
xen/common/sched/credit2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 4949606881..3791a8d4cd 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3517,6 +3517,7 @@ runq_candidate(struct csched2_runqueue_data *rqd,
* its credit is at least CSCHED2_MIGRATE_RESIST higher.
*/
if ( sched_unit_master(svc->unit) != cpu
+ && svc->tickled_cpu != cpu
&& snext->credit + CSCHED2_MIGRATE_RESIST > svc->credit )
{
SCHED_STAT_CRANK(migrate_resisted);
--
2.53.0
|