aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mm/page_isolation.c
diff options
context:
space:
mode:
authorJoonsoo Kim <[email protected]>2020-08-11 18:37:25 -0700
committerLinus Torvalds <[email protected]>2020-08-12 10:58:02 -0700
commit19fc7bed252c16ace29491e4cfa2bafb264eb505 (patch)
tree8fbfe2761e7f1b385baa10129a91a44a5540836f /mm/page_isolation.c
parentmm/migrate: clear __GFP_RECLAIM to make the migration callback consistent with regular THP allocations (diff)
downloadwireguard-linux-19fc7bed252c16ace29491e4cfa2bafb264eb505.tar.xz
wireguard-linux-19fc7bed252c16ace29491e4cfa2bafb264eb505.zip
mm/migrate: introduce a standard migration target allocation function
There are some similar functions for migration target allocation. Since there is no fundamental difference, it's better to keep just one rather than keeping all variants. This patch implements base migration target allocation function. In the following patches, variants will be converted to use this function. Changes should be mechanical, but, unfortunately, there are some differences. First, some callers' nodemask is assgined to NULL since NULL nodemask will be considered as all available nodes, that is, &node_states[N_MEMORY]. Second, for hugetlb page allocation, gfp_mask is redefined as regular hugetlb allocation gfp_mask plus __GFP_THISNODE if user provided gfp_mask has it. This is because future caller of this function requires to set this node constaint. Lastly, if provided nodeid is NUMA_NO_NODE, nodeid is set up to the node where migration source lives. It helps to remove simple wrappers for setting up the nodeid. Note that PageHighmem() call in previous function is changed to open-code "is_highmem_idx()" since it provides more readability. [[email protected]: tweak patch title, per Vlastimil] [[email protected]: fix typo in comment] Signed-off-by: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: Roman Gushchin <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to '')
-rw-r--r--mm/page_isolation.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index aec26d972b9f..f25c66ea37ac 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -309,7 +309,10 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
struct page *alloc_migrate_target(struct page *page, unsigned long private)
{
- int nid = page_to_nid(page);
+ struct migration_target_control mtc = {
+ .nid = page_to_nid(page),
+ .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
+ };
- return new_page_nodemask(page, nid, &node_states[N_MEMORY]);
+ return alloc_migration_target(page, (unsigned long)&mtc);
}
OSZAR »