Skip to content

Commit

Permalink
mm/page_alloc: put __free_pages_core() in __meminit section
Browse files Browse the repository at this point in the history
__free_pages_core() is only used in bootmem init and hot-add memory init
path.  Let's put it in __meminit section.

Link: https://lkml.kernel.org/r/20240706061615.30322-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Wei Yang authored and Andrew Morton committed Jul 12, 2024
1 parent 26c7d84 commit f6953e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,8 @@ int restore_online_page_callback(online_page_callback_t callback)
}
EXPORT_SYMBOL_GPL(restore_online_page_callback);

void generic_online_page(struct page *page, unsigned int order)
/* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */
void __ref generic_online_page(struct page *page, unsigned int order)
{
__free_pages_core(page, order, MEMINIT_HOTPLUG);
}
Expand Down
2 changes: 1 addition & 1 deletion mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ static void __free_pages_ok(struct page *page, unsigned int order,
__count_vm_events(PGFREE, 1 << order);
}

void __free_pages_core(struct page *page, unsigned int order,
void __meminit __free_pages_core(struct page *page, unsigned int order,
enum meminit_context context)
{
unsigned int nr_pages = 1 << order;
Expand Down

0 comments on commit f6953e2

Please sign in to comment.