mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mm: fix GFP_THISNODE callers and clarify
GFP_THISNODE is for callers that implement their own clever fallback to remote nodes. It restricts the allocation to the specified node and does not invoke reclaim, assuming that the caller will take care of it when the fallback fails, e.g. through a subsequent allocation request without GFP_THISNODE set. However, many current GFP_THISNODE users only want the node exclusive aspect of the flag, without actually implementing their own fallback or triggering reclaim if necessary. This results in things like page migration failing prematurely even when there is easily reclaimable memory available, unless kswapd happens to be running already or a concurrent allocation attempt triggers the necessary reclaim. Convert all callsites that don't implement their own fallback strategy to __GFP_THISNODE. This restricts the allocation a single node too, but at the same time allows the allocator to enter the slowpath, wake kswapd, and invoke direct reclaim if necessary, to make the allocation happen when memory is full. Signed-off-by: Johannes Weiner <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: Jan Stancek <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
fa389e2202
commit
e97ca8e5b8
8 changed files with 19 additions and 13 deletions
11
mm/migrate.c
11
mm/migrate.c
|
|
@ -1158,7 +1158,7 @@ static struct page *new_page_node(struct page *p, unsigned long private,
|
|||
pm->node);
|
||||
else
|
||||
return alloc_pages_exact_node(pm->node,
|
||||
GFP_HIGHUSER_MOVABLE | GFP_THISNODE, 0);
|
||||
GFP_HIGHUSER_MOVABLE | __GFP_THISNODE, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1544,9 +1544,9 @@ static struct page *alloc_misplaced_dst_page(struct page *page,
|
|||
struct page *newpage;
|
||||
|
||||
newpage = alloc_pages_exact_node(nid,
|
||||
(GFP_HIGHUSER_MOVABLE | GFP_THISNODE |
|
||||
__GFP_NOMEMALLOC | __GFP_NORETRY |
|
||||
__GFP_NOWARN) &
|
||||
(GFP_HIGHUSER_MOVABLE |
|
||||
__GFP_THISNODE | __GFP_NOMEMALLOC |
|
||||
__GFP_NORETRY | __GFP_NOWARN) &
|
||||
~GFP_IOFS, 0);
|
||||
|
||||
return newpage;
|
||||
|
|
@ -1747,7 +1747,8 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
|
|||
goto out_dropref;
|
||||
|
||||
new_page = alloc_pages_node(node,
|
||||
(GFP_TRANSHUGE | GFP_THISNODE) & ~__GFP_WAIT, HPAGE_PMD_ORDER);
|
||||
(GFP_TRANSHUGE | __GFP_THISNODE) & ~__GFP_WAIT,
|
||||
HPAGE_PMD_ORDER);
|
||||
if (!new_page)
|
||||
goto out_fail;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue