From: "Gregory Price (Meta)" try_release_thread_stack_to_cache() caches a freed stack only if all of its pages are on the local node, unless the local node has no memory. A CPU on a node outside N_MEMORY_COMMON gets its stacks from other nodes, as a CPU on a memoryless node does, so the locality check would keep it from ever caching a stack. Skip the check when the local node has no common memory. Signed-off-by: Gregory Price (Meta) --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index 5efceb8d58a7..28c58f2765f7 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -254,7 +254,7 @@ static bool try_release_thread_stack_to_cache(struct vm_struct *vm_area) */ scoped_guard(preempt) { nid = numa_node_id(); - if (node_state(nid, N_MEMORY)) { + if (node_state(nid, N_MEMORY_COMMON)) { for (i = 0; i < vm_area->nr_pages; i++) { struct page *page = vm_area->pages[i]; if (page_to_nid(page) != nid) -- 2.56.1