Skip to content

Commit 7a3324e

Browse files
x-y-zakpm00
authored andcommitted
mm/page_isolation: remove migratetype from undo_isolate_page_range()
Since migratetype is no longer overwritten during pageblock isolation, undoing pageblock isolation no longer needs which migratetype to restore. Link: https://lkml.kernel.org/r/20250617021115.2331563-6-ziy@nvidia.com Signed-off-by: Zi Yan <ziy@nvidia.com> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Vlastimil Babka <vbabka@suse.cz> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Brendan Jackman <jackmanb@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kirill A. Shuemov <kirill.shutemov@linux.intel.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Michal Hocko <mhocko@suse.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Richard Chang <richardycc@google.com> Cc: Suren Baghdasaryan <surenb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent b1df9c5 commit 7a3324e

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

include/linux/page-isolation.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ bool pageblock_unisolate_and_move_free_pages(struct zone *zone, struct page *pag
5151
int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
5252
int migratetype, int flags);
5353

54-
void undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
55-
int migratetype);
54+
void undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn);
5655

5756
int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
5857
int isol_flags);

mm/memory_hotplug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages,
12221222
build_all_zonelists(NULL);
12231223

12241224
/* Basic onlining is complete, allow allocation of onlined pages. */
1225-
undo_isolate_page_range(pfn, pfn + nr_pages, MIGRATE_MOVABLE);
1225+
undo_isolate_page_range(pfn, pfn + nr_pages);
12261226

12271227
/*
12281228
* Freshly onlined pages aren't shuffled (e.g., all pages are placed to
@@ -2086,7 +2086,7 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
20862086

20872087
failed_removal_isolated:
20882088
/* pushback to free area */
2089-
undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
2089+
undo_isolate_page_range(start_pfn, end_pfn);
20902090
memory_notify(MEM_CANCEL_OFFLINE, &mem_arg);
20912091
if (node_arg.nid != NUMA_NO_NODE)
20922092
node_notify(NODE_CANCEL_REMOVING_LAST_MEMORY, &node_arg);

mm/page_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6984,7 +6984,7 @@ int alloc_contig_range_noprof(unsigned long start, unsigned long end,
69846984
start, end, outer_start, outer_end);
69856985
}
69866986
done:
6987-
undo_isolate_page_range(start, end, migratetype);
6987+
undo_isolate_page_range(start, end);
69886988
return ret;
69896989
}
69906990
EXPORT_SYMBOL(alloc_contig_range_noprof);

mm/page_isolation.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
515515
page = __first_valid_page(pfn, pageblock_nr_pages);
516516
if (page && set_migratetype_isolate(page, migratetype, flags,
517517
start_pfn, end_pfn)) {
518-
undo_isolate_page_range(isolate_start, pfn, migratetype);
518+
undo_isolate_page_range(isolate_start, pfn);
519519
unset_migratetype_isolate(
520520
pfn_to_page(isolate_end - pageblock_nr_pages));
521521
return -EBUSY;
@@ -528,13 +528,10 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
528528
* undo_isolate_page_range - undo effects of start_isolate_page_range()
529529
* @start_pfn: The first PFN of the isolated range
530530
* @end_pfn: The last PFN of the isolated range
531-
* @migratetype: New migrate type to set on the range
532531
*
533-
* This finds every MIGRATE_ISOLATE page block in the given range
534-
* and switches it to @migratetype.
532+
* This finds and unsets every MIGRATE_ISOLATE page block in the given range
535533
*/
536-
void undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
537-
int migratetype)
534+
void undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn)
538535
{
539536
unsigned long pfn;
540537
struct page *page;

0 commit comments

Comments
 (0)