[PATCH] ppc64: Fix bounds checking in new numa code

Michael Ellerman michael at ellerman.id.au
Wed Mar 23 22:19:48 EST 2005


Hi Mike,

I've noticed what I think is an incorrect bounds check in your
new numa code. Correct me if I'm wrong.

Come to think of it, why do we even need this? The start_paddr/end_paddr
was just computed from the memory regions we're now looking at, so I
don't see how this can ever be false. Is there something you're trying
to cater for?

cheers

Index: 2.6.12-rc1-mem-limit/arch/ppc64/mm/numa.c
===================================================================
--- 2.6.12-rc1-mem-limit.orig/arch/ppc64/mm/numa.c
+++ 2.6.12-rc1-mem-limit/arch/ppc64/mm/numa.c
@@ -614,8 +614,8 @@ new_range:
 			if (numa_domain != nid)
 				continue;
 
-			if (mem_start < end_paddr &&
-			    (mem_start+mem_size) > start_paddr) {
+			if (mem_start >= start_paddr &&
+			   (mem_start + mem_size) <= end_paddr) {
 				/* should be no overlaps ! */
 				dbg("free_bootmem %lx %lx\n", mem_start, mem_size);
 				free_bootmem_node(NODE_DATA(nid), mem_start,




More information about the Linuxppc64-dev mailing list