From: Andre Przywara <andre.przywara@amd.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] numa: fix problems with memory-less nodes
Date: Tue, 12 Jan 2010 17:30:09 +0100 [thread overview]
Message-ID: <4B4CA391.2040005@amd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]
Hi,
If we decided to not report memory-less nodes in physinfo we should also
skip them in the node_to_{cpu,memory,dma32_mem} Python lists. Currently
Xen will not start guests on machines with memory-less nodes which are
not the last ones. On an 8-node machine with empty nodes 4 and 5 "xm
info" was reporting wrongly, also the node assignment algorithm crashed
with a division by zero error.
The attached patch fixes this by skipping empty nodes in the enumeration
of resources.
Regards,
Andre.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
--
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: physinfo_empty_numa_nodes.patch --]
[-- Type: text/x-patch, Size: 1134 bytes --]
diff -r 0e3910f1de64 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Tue Jan 12 07:17:40 2010 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue Jan 12 17:28:55 2010 +0100
@@ -1129,20 +1129,23 @@
Py_DECREF(pyint);
node_exists = 1;
}
- PyList_Append(node_to_cpu_obj, cpus);
+ if (node_exists)
+ PyList_Append(node_to_cpu_obj, cpus);
Py_DECREF(cpus);
/* Memory. */
xc_availheap(self->xc_handle, 0, 0, i, &free_heap);
node_exists = node_exists || (free_heap != 0);
pyint = PyInt_FromLong(free_heap / 1024);
- PyList_Append(node_to_memory_obj, pyint);
+ if (node_exists)
+ PyList_Append(node_to_memory_obj, pyint);
Py_DECREF(pyint);
/* DMA memory. */
xc_availheap(self->xc_handle, 0, 32, i, &free_heap);
pyint = PyInt_FromLong(free_heap / 1024);
- PyList_Append(node_to_dma32_mem_obj, pyint);
+ if (node_exists)
+ PyList_Append(node_to_dma32_mem_obj, pyint);
Py_DECREF(pyint);
if ( node_exists )
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2010-01-12 16:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 16:30 Andre Przywara [this message]
2010-01-13 8:26 ` [PATCH] numa: fix problems with memory-less nodes Keir Fraser
2010-01-13 9:42 ` Andre Przywara
2010-01-13 9:55 ` Keir Fraser
2010-01-13 10:02 ` 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=4B4CA391.2040005@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.