From: Christoph Lameter Switch the memory policy of the kevent threads to MPOL_DEFAULT while leaving the kzalloc of the workqueue structure on interleave. This means that all code executed in the context of the kevent thread is allocating node local. Signed-off-by: Christoph Lameter Cc: Christoph Lameter Cc: Alok Kataria Cc: Andi Kleen Cc: Cc: Signed-off-by: Andrew Morton --- kernel/workqueue.c | 7 +++++++ 1 file changed, 7 insertions(+) diff -puN kernel/workqueue.c~mm-kevent-threads-use-mpol_default kernel/workqueue.c --- a/kernel/workqueue.c~mm-kevent-threads-use-mpol_default +++ a/kernel/workqueue.c @@ -28,6 +28,7 @@ #include #include #include +#include /* * The per-CPU workqueue (if single thread, we always use the first @@ -245,6 +246,12 @@ static int worker_thread(void *__cwq) sigprocmask(SIG_BLOCK, &blocked, NULL); flush_signals(current); + /* + * We inherited MPOL_INTERLEAVE from the booting kernel. + * Set MPOL_DEFAULT to insure node local allocations. + */ + numa_default_policy(); + /* SIG_IGN makes children autoreap: see do_notify_parent(). */ sa.sa.sa_handler = SIG_IGN; sa.sa.sa_flags = 0; _