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.
Showing the changes to kernel/workqueue.c (1 of 1 file). Show all
Unified · Split
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/notifier.h> |
| 29 | 29 | #include <linux/kthread.h> |
| 30 | 30 | #include <linux/hardirq.h> |
| 31 | +#include <linux/mempolicy.h> | |
| 31 | 32 | |
| 32 | 33 | /* |
| 33 | 34 | * The per-CPU workqueue (if single thread, we always use the first |
| @@ -245,6 +246,12 @@ static int worker_thread(void *__cwq) · 211 unmodified lines | ||
| 245 | 246 | sigprocmask(SIG_BLOCK, &blocked, NULL); |
| 246 | 247 | flush_signals(current); |
| 247 | 248 | |
| 249 | + /* | |
| 250 | + * We inherited MPOL_INTERLEAVE from the booting kernel. | |
| 251 | + * Set MPOL_DEFAULT to insure node local allocations. | |
| 252 | + */ | |
| 253 | + numa_default_policy(); | |
| 254 | + | |
| 248 | 255 | /* SIG_IGN makes children autoreap: see do_notify_parent(). */ |
| 249 | 256 | sa.sa.sa_handler = SIG_IGN; |
| 250 | 257 | sa.sa.sa_flags = 0; |