All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@amd.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [Patch] tools: improve NUMA guest placement when ballooning
Date: Thu, 10 Dec 2009 15:07:55 +0100	[thread overview]
Message-ID: <4B2100BB.70807@amd.com> (raw)

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

Hi,

the "guest to a single NUMA node" constrain algorithm does not work well 
when we do ballooning. Ballooning and NUMA don't play together anyway, 
as Dom0 and thus ballooning is not NUMA aware, I am working on this but 
it will not be ready for the Xen 4.0 release window.
The usual ballooning situation will result in an empty candidate list, 
as no node has enough free memory to host the guest. In this case the 
code will simply pick the first node: again and again, because all nodes 
without enough memory will be ultimately penalized with the same maxint 
value (regardless of the actual load).
The attached patch will change this to use a relative penalty in case of 
not-enough memory, so that low-load low-memory nodes will be used at one 
point. A half loaded node has shown to be a good value, as an unbalanced 
system is much worse than non-local memory access for guests.
Regardless of that you should restrict the Dom0 on a NUMA system to a 
reasonable memory size, so that ballooning is not necessary most of the 
time. In this case the guest's memory will be NUMA local.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>

Regards,
Andre.

-- 
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448 3567 12
----to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd; Thomas M. McCoy; Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

[-- Attachment #2: improve_NUMA_balloon.patch --]
[-- Type: text/x-patch, Size: 962 bytes --]

diff -r 8f304c003af4 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Wed Dec 09 10:59:31 2009 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Dec 10 15:04:41 2009 +0100
@@ -2639,10 +2639,9 @@
                                     nodeload[i] += 1
                                     break
                 for i in range(0, nr_nodes):
-                    if len(info['node_to_cpu'][i]) > 0 and i in node_list:
-                        nodeload[i] = int(nodeload[i] * 16 / len(info['node_to_cpu'][i]))
-                    else:
-                        nodeload[i] = sys.maxint
+                    nodeload[i] = int(nodeload[i] * 16 / len(info['node_to_cpu'][i]))
+                    if len(info['node_to_cpu'][i]) == 0 or i not in node_list:
+                        nodelist[i] += 8
                 return map(lambda x: x[0], sorted(enumerate(nodeload), key=lambda x:x[1]))
 
             info = xc.physinfo()

[-- 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:[~2009-12-10 14:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4B2100BB.70807@amd.com \
    --to=andre.przywara@amd.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.