All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"dulloor@gmail.com" <dulloor@gmail.com>
Subject: Re: [PATCH] numa: select nodes by cpu affinity
Date: Wed, 04 Aug 2010 18:01:56 +0200	[thread overview]
Message-ID: <4C598EF4.50001@redhat.com> (raw)
In-Reply-To: <C87F39EC.1CBB2%keir.fraser@eu.citrix.com>

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

On 08/04/2010 04:38 PM, Keir Fraser wrote:
> Changeset 21913 in http://xenbits.xen.org/staging/xen-unstable.hg
> 
>  -- Keir
> 
> On 04/08/2010 13:38, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:
> 
>> Good idea. I will take this and rework it a bit and check it in.
>>
>>  Thanks,
>>  Keir
>>
>> On 04/08/2010 13:04, "Andrew Jones" <drjones@redhat.com> wrote:
>

I also considered managing the nodemask as new domain state, as you do,
as it may come in useful elsewhere, but my principle of least patch
instincts kept me from doing it...

I'm not sure about keeping track of the last_alloc_node and then always
avoiding it (at least when there's more than 1 node) by checking it
last. I liked the way it worked before, favoring the node of the
currently running processor, but I don't have any perf numbers to know
what would be better.

I've attached a patch with a couple minor tweaks. It removes the
unnecessary node clearing from an empty initialized nodemask, and also
moves a couple of domain_update_node_affinity() calls outside
for_each_vcpu loops.

Andrew

[-- Attachment #2: nodemask-tweak.diff --]
[-- Type: text/plain, Size: 1496 bytes --]

diff --git a/xen/common/domain.c b/xen/common/domain.c
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -358,12 +358,8 @@
         cpus_or(cpumask, cpumask, v->cpu_affinity);
 
     for_each_online_node ( node )
-    {
         if ( cpus_intersects(node_to_cpumask(node), cpumask) )
             node_set(node, nodemask);
-        else
-            node_clear(node, nodemask);
-    }
 
     d->node_affinity = nodemask;
     spin_unlock(&d->node_affinity_lock);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -270,13 +270,13 @@
         SCHED_OP(VCPU2OP(v), destroy_vcpu, v);
 
         cpus_setall(v->cpu_affinity);
-        domain_update_node_affinity(d);
         v->processor = new_p;
         v->sched_priv = vcpu_priv[v->vcpu_id];
         evtchn_move_pirqs(v);
 
         new_p = cycle_cpu(new_p, c->cpu_valid);
     }
+    domain_update_node_affinity(d);
 
     d->cpupool = c;
     SCHED_OP(DOM2OP(d), free_domdata, d->sched_priv);
@@ -478,7 +478,6 @@
                 printk("Breaking vcpu affinity for domain %d vcpu %d\n",
                         v->domain->domain_id, v->vcpu_id);
                 cpus_setall(v->cpu_affinity);
-                domain_update_node_affinity(d);
             }
 
             if ( v->processor == cpu )
@@ -501,6 +500,7 @@
             if ( v->processor == cpu )
                 ret = -EAGAIN;
         }
+        domain_update_node_affinity(d);
     }
     return ret;
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2010-08-04 16:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 12:04 [PATCH] numa: select nodes by cpu affinity Andrew Jones
2010-08-04 12:38 ` Keir Fraser
2010-08-04 14:38   ` Keir Fraser
2010-08-04 16:01     ` Andrew Jones [this message]
2010-08-04 16:15       ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C598EF4.50001@redhat.com \
    --to=drjones@redhat.com \
    --cc=dulloor@gmail.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.