Jan Beulich
2009-Aug-28 10:27 UTC
[Xen-devel] [PATCH] x86/numa: fix c/s 20120 (Fix SRAT check for discontig memory)
That change converted the (wrong) assumption of contiguous nodes'' memory to a similarly wrong one of assuming discontiguous memory (i.e. each node having separate E820 table entries). The code ought to be able to deal with both, though, and I hope this change makes it so. Signed-off-by: Jan Beulich <jbeulich@novell.com> --- 2009-08-24.orig/xen/arch/x86/srat.c 2009-08-28 00:00:00.000000000 +0200 +++ 2009-08-24/xen/arch/x86/srat.c 2009-08-28 12:12:40.000000000 +0200 @@ -249,15 +249,23 @@ static int nodes_cover_memory(void) start = e820.map[i].addr; end = e820.map[i].addr + e820.map[i].size - 1; - found = 0; - for_each_node_mask(j, nodes_parsed) { - if (start >= nodes[j].start && end <= nodes[j].end) { - found = 1; - break; - } - } + do { + found = 0; + for_each_node_mask(j, nodes_parsed) + if (start < nodes[j].end + && end > nodes[j].start) { + if (start >= nodes[j].start) { + start = nodes[j].end; + found = 1; + } + if (end <= nodes[j].end) { + end = nodes[j].start; + found = 1; + } + } + } while (found && start < end); - if (!found) { + if (start < end) { printk(KERN_ERR "SRAT: No PXM for e820 range: " "%016Lx - %016Lx\n", start, end); return 0; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Alex Williamson
2009-Aug-28 12:15 UTC
[Xen-devel] Re: [PATCH] x86/numa: fix c/s 20120 (Fix SRAT check for discontig memory)
On Fri, 2009-08-28 at 11:27 +0100, Jan Beulich wrote:> That change converted the (wrong) assumption of contiguous nodes'' > memory to a similarly wrong one of assuming discontiguous memory (i.e. > each node having separate E820 table entries). The code ought to be > able to deal with both, though, and I hope this change makes it so.Ah, of course. Thanks Jan, I''ll test it out on my end. Alex _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Alex Williamson
2009-Aug-28 14:54 UTC
[Xen-devel] Re: [PATCH] x86/numa: fix c/s 20120 (Fix SRAT check for discontig memory)
On Fri, 2009-08-28 at 11:27 +0100, Jan Beulich wrote:> That change converted the (wrong) assumption of contiguous nodes'' > memory to a similarly wrong one of assuming discontiguous memory (i.e. > each node having separate E820 table entries). The code ought to be > able to deal with both, though, and I hope this change makes it so. > > Signed-off-by: Jan Beulich <jbeulich@novell.com>Works for me. Acked-by: Alex Williamson <alex.williamson@hp.com>> --- 2009-08-24.orig/xen/arch/x86/srat.c 2009-08-28 00:00:00.000000000 +0200 > +++ 2009-08-24/xen/arch/x86/srat.c 2009-08-28 12:12:40.000000000 +0200 > @@ -249,15 +249,23 @@ static int nodes_cover_memory(void) > start = e820.map[i].addr; > end = e820.map[i].addr + e820.map[i].size - 1; > > - found = 0; > - for_each_node_mask(j, nodes_parsed) { > - if (start >= nodes[j].start && end <= nodes[j].end) { > - found = 1; > - break; > - } > - } > + do { > + found = 0; > + for_each_node_mask(j, nodes_parsed) > + if (start < nodes[j].end > + && end > nodes[j].start) { > + if (start >= nodes[j].start) { > + start = nodes[j].end; > + found = 1; > + } > + if (end <= nodes[j].end) { > + end = nodes[j].start; > + found = 1; > + } > + } > + } while (found && start < end); > > - if (!found) { > + if (start < end) { > printk(KERN_ERR "SRAT: No PXM for e820 range: " > "%016Lx - %016Lx\n", start, end); > return 0; > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Maybe Matching Threads
- [PATCH] Fix SRAT check for discontig memory
- [PATCH 4/6] xen: export NUMA topology in physinfo hcall
- [PATCH] 0/7 xen: Add basic NUMA support
- [PATCH] xen: numa-sched: leave node-affinity alone if not in "auto" mode
- [PATCH 1/6] xen: ACPI SRAT table parser and data structures