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

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


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: Dario Faggioli <dfaggioli@xxxxxxxx>
  • Date: Tue, 12 Apr 2022 16:14:50 +0000
  • Accept-language: en-US
  • 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=IIrKmEUjX6Eol6BqaFjqIGGwrzSg8BGGyIv99BLINxo=; b=ERYpfqlPyyzUC+yqisMjspAkvxS9y+qrQvXLpTaw5ktPv7i0WiyX75PFwyqY9NFcEvRxpzODfm4Z3AjeBTfUQyCKLyskF4L1GYJjBRa5i3HoSCREVA7KJCmie8BCF/7CdpKxMG6qxfMYH9G1J/WA4oPSpU0z7T7u11YEeUiX1Kmi6KQUYF/gQSK/2JulMAbNaymav+spiaih0PE2bOWKzwVWr3BWGfmdbNQ83M+C7x2O6kPu9W0NQ7Kgo6L2AdSqvi3ufJDWZ1RPsa8vKq/T82urkabxVvqIxVOiivlKd3jHzzxX6Or5xG5lPi/RD9I6gmkpUywpTY2R+K7LxWF3Pg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iQu62mF9/NL4F4EiB4DdO/fOvt1/qHeHmXutAqaQjQ/tOmBAdh4DgVGV1JSpE+OMItwt+I4+h6HKaZUDAsau+1ScpLgKuCPOe4YXdpZW8OA6sJ6/Qy6yIavq3M1Y7xpua62hHkbmzZwOhPGz+k4sSvlFHABN0UDHXHa7Qc+g3c2SeJIuszOuTLnrTxJVZcAoIMMDFYPVYPxGJ2YfN+3TunSBtt046W1tM66QtuGJc/VlCCHxCsn+g3ti/106Kcdp/SZxHVDpTvAMugWfhJ6xe6vfFA7S+6PZNk+iKr3NkXRoMcnD/69oiD2LNiXxVdwtQ5/GoFkmy8DXbdNsLY/C7Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "ohering@xxxxxxx" <ohering@xxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 12 Apr 2022 16:14:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYSoM0M4Zi9SzqTkOjTOtQV+PP7azl4C2AgAAVUwCABn7lAIAABpgAgAAA2wA=
  • Thread-topic: [PATCH] x86: make "dom0_nodes=" work with credit2

On Tue, 2022-04-12 at 16:11 +0000, Dario Faggioli wrote:
> On Tue, 2022-04-12 at 15:48 +0000, Dario Faggioli wrote:
> > On Fri, 2022-04-08 at 14:36 +0200, Jan Beulich wrote:
> > 
> > 
> > And while doing that, I think we should consolidate touching the
> > affinity only there, avoiding altering it twice. After all, we
> > already
> > know how it should look like, so let's go for it.
> > 
> > I'll send a patch to that effect, to show what I mean with this. 
> > 
> Here it is.
> 
And here's Jan's patch, ported on top of it.

As for the one before, let me know what you think.
---
From: Dario Faggioli <dfaggioli@xxxxxxxx>
Subject: [PATCH 2/2] (Kind of) rebase of "x86: make "dom0_nodes=" work with 
credit2"

i.e., Jan's patch, on top of the commit that unifies the affinity
handling for dom0 vCPUs.

Although not technically necessary any longer, for fixing the issue
at hand, I think it still makes sense to have it in the code.

Signed-off-by: Dario Faggioli <dfaggioli@xxxxxxxx>
---
* Changelog is so much RFC that is not even a changelog... Jan, if we go
  ahead with this approach, let me know how you prefer to handle the
  authorship, the S-o-b, etc, of this patch.

  I believe it should be From: you, with my S-o-b added after yours, but
  I'm fine being the author, if you don't want to.
---
 xen/common/sched/core.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index dc2ed890e0..e11acd7b88 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3416,6 +3416,7 @@ void wait(void)
 void __init sched_setup_dom0_vcpus(struct domain *d)
 {
     unsigned int i;
+    struct sched_unit *unit;
 
     for ( i = 1; i < d->max_vcpus; i++ )
         vcpu_create(d, i);
@@ -3423,11 +3424,20 @@ void __init sched_setup_dom0_vcpus(struct domain *d)
     /*
      * sched_vcpu_init(), called by vcpu_create(), will setup the hard and
      * soft affinity of all the vCPUs, by calling sched_set_affinity() on each
-     * one of them. We can now make sure that the domain's node affinity is
-     * also updated accordingly, and we can do that here, once and for all
-     * (which is more efficient than calling domain_update_node_affinity()
-     * on all the vCPUs).
+     * one of them. What's remaining for us to do here is:
+     * - make sure that the vCPUs are actually migrated to suitable CPUs
+     * - update the domain's node affinity (and we can do that here, once and
+     *   for all, as it's more efficient than calling 
domain_update_node_affinity()
+     *   on all the vCPUs).
      */
+    for_each_sched_unit ( d, unit )
+    {
+       spinlock_t *lock = unit_schedule_lock_irq(unit);
+        sched_unit_migrate_start(unit);
+        unit_schedule_unlock_irq(lock, unit);
+        sched_unit_migrate_finish(unit);
+    }
+
     domain_update_node_affinity(d);
 }
 #endif
-- 
2.35.1
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

Attachment: signature.asc
Description: This is a digitally signed message part


 


Rackspace

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