lkml.org 
[lkml]   [2011]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2011-03-02 15:33    [W:0.283 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site