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

[XEN PATCH v2] 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: Thu, 1 Oct 2026 01:57:47 +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=d7CkcP5eIBFh2knIHSHjiBm2u5CmRivfb9hR1HKwcB4=; b=XzUKvIYZE5YR6YrD7mMGt7HClmc+HSZR5O3Y4Wg79VSWZe+47LEFH4OmpHTF5td2LhjTXzCJXS8cCqlGlF97t+zgfnq6MiSSVg6Phfvmosxb1DE4QZSDRENIPxRmWRf9SHrD+ibGI7k1O2qyUrXwvUUMaPxjpphEedSqWtY5zG/JX+OcWIGNTjfQqebvQZlyehwBGuc0boTsRKBcsY+B9shQqWlGTE6m3HENjRJ91uAQ9t7OjYifiegqjK7ikyjWVFF/FB4A2W7zWOrl5jkvEbaIPgYAaIjo8lDejvXm8viP7kZbCeXPpxmWNKG/PO+JI8BZ9S0WWLlgTqbuT2lFUg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DwmUECqyCEKMvs/agH1sAwi3097y8uMkrYlnrxIVUziCLasy6aHLBJh2b7VBmibXh7LpbXjVNBQYlc2aPlWXtWUQW7LSUP6EtY1SlfIvcHkr1H4Jey28h23paFw/c/F4ei5QRXgtK15tGay/UQdSqCMj/jxpu/YRKFxk1jClwuquDoyK78eJ/Y0Nj6H1youl7B7XVWMhGqGxbjAv7OuHkC1pWZ5f4jW01kakFpB91qHY089Qs+XzPw5kCz8DJcVpgvP03lbxxWfOe63otN/yfiKyCvhBGwTIuROwqGN617jVSOXVnh1QIyMo3jq+VXP+8Bvl+PfiNoeIX0JaxZph/w==
  • 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: Wed, 30 Sep 2026 17:58:18 +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>
Reviewed-by: George Dunlap <gwd@xxxxxxxxxxxxxx>
---
v2:
* Add corresponding comment for this fix.
* Add Reviewed-by tag from George.
---
 xen/common/sched/credit2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 4949606881..c32e753bb4 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3514,9 +3514,11 @@ runq_candidate(struct csched2_runqueue_data *rqd,
 
         /*
          * If this is on a different processor, don't pull it unless
-         * its credit is at least CSCHED2_MIGRATE_RESIST higher.
+         * its credit is at least CSCHED2_MIGRATE_RESIST higher, or the
+         * processor was tickled for it.
          */
         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




 


Rackspace

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