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

[PATCH] x86: make "dom0_nodes=" work with credit2


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 7 Apr 2022 15:27: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=BQOVcAGYC8ddiE2/MCQ8tM4DG8UY9B3n/ZS2T6mggZk=; b=WGgZwX9y05PnDclLpQ7T9/dJP5/OWOPtHGIeEuj4Q8CQGZJJUZ+NEVOZUn1zl2xu7S15GtZnWyeFbpvgtTHEjfldRQ2U6pslWdqqBNFQoorGBMN1BLEPJFOvX+HZ4mIPs1V2WAqmv87Sdl6dfiC0DcUMJz1VvKMNMBF8WwFSoB02kc/Uu8S6BPn5obGZjgGQG1Z/9qAf9QFSZn9o7fZ84C7BMp0M0HAk3vh2q1U/Jiil1Nh2vEAVwJGXwyQdGCHHQrEFAMyVVQ3JR0CIFCDuQY3CSqdbGhAw1jTRTItPVZEFgPpxPc1LvFJy4l9P2PPjcQDCJyXPFMb3yH9yOTCzeA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MVkMqapOCKKFj63UAk8SxUcqXarXyPm3/0vgizDxwoufv9Hp1bvRDPk94WadBLiBuVcIJZdsxwM7Ua67kuhdQdvMUiW4ESIQ6iN4AtegLqE/mx73tomjCpuVUfxF+U0lIBK4M1HqttUBnGqvzSz5EF5ODbgTrD+c25gsdC4DegoJ+TtlTX/tUUetXOArE8LP1v9P1jjgErnTFvbqlhQHACLenxHuqEsX7tP2E+BNsyjteRiEYOSa64/YeU50HYGffJEY4v+bUKqKcM9f59ttSj/Y9oZOLxe5GA1CDLvK2TeQfLq2988bDgH3WhKEQv5x5T2lnnltWTrE1D54+B+DUA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Olaf Hering <ohering@xxxxxxx>
  • Delivery-date: Thu, 07 Apr 2022 13:27:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Apart from setting the affinities, vCPU-s / units also need to be
migrated off of CPUs which aren't part of the affinity. Otherwise, for a
reason I haven't been able to determine, credit2 won't actually schedule
them, resulting in the Dom0 boot process to hang (either right away or
when bringing up "secondary" vCPU-s).

Fixes: dafd936ddd ("Make credit2 the default scheduler")
Reported-by: Olaf Hering <ohering@xxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
The Fixes: tag isn't very precise - it's rather the commit exposing the
issue by default. I haven't been able to identify the actual commit
which did introduce the problem; it may well be that it has always been
there since the introduction of credit2.

Credit2 moving the vCPU-s off of their initially assigned ones right
away of course renders sched_select_initial_cpu()'s use of cpu_cycle()
pretty useless. But I guess that's still useful for other schedulers.
I wonder though whether sched_init_vcpu() shouldn't use the CPU map
calculated by sched_select_initial_cpu() for its call to
sched_set_affinity() in the non-pinned case, rather than setting "all".
(I guess doing so might mask the issue at hand, but I think the change
here would still be applicable at least from an abstract pov.)

--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3403,9 +3403,15 @@ void __init sched_setup_dom0_vcpus(struc
     {
         for_each_sched_unit ( d, unit )
         {
+            spinlock_t *lock = unit_schedule_lock_irq(unit);
+
             if ( !opt_dom0_vcpus_pin && !dom0_affinity_relaxed )
                 sched_set_affinity(unit, &dom0_cpus, NULL);
             sched_set_affinity(unit, NULL, &dom0_cpus);
+
+            sched_unit_migrate_start(unit);
+            unit_schedule_unlock_irq(lock, unit);
+            sched_unit_migrate_finish(unit);
         }
     }
 




 


Rackspace

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