mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
mm: page_alloc: move set_zone_contiguous() into mm_init.c
set_zone_contiguous() is only used in mm init/hotplug, and clear_zone_contiguous() only used in hotplug, move them from page_alloc.c to the more appropriate file. Link: https://lkml.kernel.org/r/20230516063821.121844-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: David Hildenbrand <david@redhat.com> Cc: "Huang, Ying" <ying.huang@intel.com> Cc: Iurii Zaikin <yzaikin@google.com> Cc: Kees Cook <keescook@chromium.org> Cc: Len Brown <len.brown@intel.com> Cc: Luis Chamberlain <mcgrof@kernel.org> Cc: Mike Rapoport (IBM) <rppt@kernel.org> Cc: Oscar Salvador <osalvador@suse.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: Rafael J. Wysocki <rafael@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
5e7d5da2f4
commit
904d58578f
@@ -1532,33 +1532,6 @@ struct page *__pageblock_pfn_to_page(unsigned long start_pfn,
|
||||
return start_page;
|
||||
}
|
||||
|
||||
void set_zone_contiguous(struct zone *zone)
|
||||
{
|
||||
unsigned long block_start_pfn = zone->zone_start_pfn;
|
||||
unsigned long block_end_pfn;
|
||||
|
||||
block_end_pfn = pageblock_end_pfn(block_start_pfn);
|
||||
for (; block_start_pfn < zone_end_pfn(zone);
|
||||
block_start_pfn = block_end_pfn,
|
||||
block_end_pfn += pageblock_nr_pages) {
|
||||
|
||||
block_end_pfn = min(block_end_pfn, zone_end_pfn(zone));
|
||||
|
||||
if (!__pageblock_pfn_to_page(block_start_pfn,
|
||||
block_end_pfn, zone))
|
||||
return;
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
/* We confirm that there is no hole */
|
||||
zone->contiguous = true;
|
||||
}
|
||||
|
||||
void clear_zone_contiguous(struct zone *zone)
|
||||
{
|
||||
zone->contiguous = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* The order of subdivision here is critical for the IO subsystem.
|
||||
* Please do not alter this order without good reasons and regression
|
||||
|
Reference in New Issue
Block a user