Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: page_alloc: move init_on_alloc/free() into mm_init.c

Since commit f2fc4b44ec2b ("mm: move init_mem_debugging_and_hardening() to
mm/mm_init.c"), the init_on_alloc() and init_on_free() define is better to
move there too.

Link: https://lkml.kernel.org/r/20230516063821.121844-3-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
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: 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>

authored by

Kefeng Wang and committed by
Andrew Morton
5e7d5da2 072ba380

+6 -5
+6
mm/mm_init.c
··· 2543 2543 __free_pages_core(page, order); 2544 2544 } 2545 2545 2546 + DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, init_on_alloc); 2547 + EXPORT_SYMBOL(init_on_alloc); 2548 + 2549 + DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); 2550 + EXPORT_SYMBOL(init_on_free); 2551 + 2546 2552 static bool _init_on_alloc_enabled_early __read_mostly 2547 2553 = IS_ENABLED(CONFIG_INIT_ON_ALLOC_DEFAULT_ON); 2548 2554 static int __init early_init_on_alloc(char *buf)
-5
mm/page_alloc.c
··· 233 233 234 234 int percpu_pagelist_high_fraction; 235 235 gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK; 236 - DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, init_on_alloc); 237 - EXPORT_SYMBOL(init_on_alloc); 238 - 239 - DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); 240 - EXPORT_SYMBOL(init_on_free); 241 236 242 237 /* 243 238 * A cached value of the page's pageblock's migratetype, used when the page is