Messages in this thread | | | Date | Wed, 2 Mar 2011 06:30:59 -0800 (PST) | From | David Rientjes <> | Subject | Re: [PATCH x86/mm UPDATED] x86-64, NUMA: Fix distance table handling |
| |
On Wed, 2 Mar 2011, Tejun Heo wrote:
> From d968be2ff381c667bfd09795f82248558902a1ae Mon Sep 17 00:00:00 2001 > From: Tejun Heo <tj@kernel.org> > Date: Wed, 2 Mar 2011 11:22:14 +0100 > > NUMA distance table handling has the following problems. > > * numa_reset_distance() uses numa_distance * sizeof(numa_distance[0]) > as the table size when it should be using the square of > numa_distance. > > * The same size miscalculation when allocation space for phys_dist in > numa_emulation(). > > * In numa_emulation(), phys_dist must be reserved; otherwise, the new > emulated distance table may overlap it. > > Fix them and, while at it, take numa_distance_cnt resetting in > numa_reset_distance() out of the if block to simplify the code a bit. > > David Rientjes reported incorrect handling of distance table during > emulation and Yinghai identified the above problems and wrote the > original patch to fix the problems. This patch is based on Yinghai's > patch. > > -v2: Ingo was unhappy with 80-column limit induced linebreaks. Let > lines run over 80-column. > > Reported-by: David Rientjes <rientjes@google.com> > Patch-originally-from: Yinghai Lu <yinghai@kernel.org> > Signed-off-by: Tejun Heo <tj@kernel.org> > Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: David Rientjes <rientjes@google.com>
There's also this in numa_emulation() that isn't a safe assumption:
/* make sure all emulated nodes are mapped to a physical node */ for (i = 0; i < ARRAY_SIZE(emu_nid_to_phys); i++) if (emu_nid_to_phys[i] == NUMA_NO_NODE) emu_nid_to_phys[i] = 0;
Node id 0 is not always online depending on how you setup your SRAT. I'm not sure why emu_nid_to_phys[] would ever map a fake node id that doesn't exist to a physical node id rather than NUMA_NO_NODE, so I think it can just be removed. Otherwise, it should be mapped to a physical node id that is known to be online.
| |