Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpusets: update mems allowed in page allocator

If all allowable memory is unreclaimable, it is possible to loop forever
in the page allocator for ~__GFP_NORETRY allocations.

During this time, it is also possible for a task's cpuset to expand its
set of allowable nodes so that it now includes free memory. The cached
copy of this set, current->mems_allowed, is stale, however, since there
has not been a subsequent call to cpuset_update_task_memory_state().

The cached copy of the set of allowable nodes is now updated in the page
allocator's slow path so the additional memory is available to
get_page_from_freelist().

[akpm@linux-foundation.org: add comment]
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Paul Menage <menage@google.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Rientjes and committed by
Linus Torvalds
e33c3b5e f0f7e0dc

+4
+4
mm/page_alloc.c
··· 1561 1561 1562 1562 /* We now go into synchronous reclaim */ 1563 1563 cpuset_memory_pressure_bump(); 1564 + /* 1565 + * The task's cpuset might have expanded its set of allowable nodes 1566 + */ 1567 + cpuset_update_task_memory_state(); 1564 1568 p->flags |= PF_MEMALLOC; 1565 1569 reclaim_state.reclaimed_slab = 0; 1566 1570 p->reclaim_state = &reclaim_state;