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

mm: compaction: mark kcompactd_run() and kcompactd_stop() __meminit

Add __meminit to kcompactd_run() and kcompactd_stop() to ensure they're
default to __init when memory hotplug is not enabled.

Link: https://lkml.kernel.org/r/20230610034615.997813-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Miaohe Lin and committed by
Andrew Morton
833dfc00 e4d86756

+4 -4
+2 -2
include/linux/compaction.h
··· 98 98 bool compaction_zonelist_suitable(struct alloc_context *ac, int order, 99 99 int alloc_flags); 100 100 101 - extern void kcompactd_run(int nid); 102 - extern void kcompactd_stop(int nid); 101 + extern void __meminit kcompactd_run(int nid); 102 + extern void __meminit kcompactd_stop(int nid); 103 103 extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx); 104 104 105 105 #else
+2 -2
mm/compaction.c
··· 3050 3050 * This kcompactd start function will be called by init and node-hot-add. 3051 3051 * On node-hot-add, kcompactd will moved to proper cpus if cpus are hot-added. 3052 3052 */ 3053 - void kcompactd_run(int nid) 3053 + void __meminit kcompactd_run(int nid) 3054 3054 { 3055 3055 pg_data_t *pgdat = NODE_DATA(nid); 3056 3056 ··· 3068 3068 * Called by memory hotplug when all memory in a node is offlined. Caller must 3069 3069 * be holding mem_hotplug_begin/done(). 3070 3070 */ 3071 - void kcompactd_stop(int nid) 3071 + void __meminit kcompactd_stop(int nid) 3072 3072 { 3073 3073 struct task_struct *kcompactd = NODE_DATA(nid)->kcompactd; 3074 3074