Skip to content

Commit 833dfc0

Browse files
MiaoheLinakpm00
authored andcommitted
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>
1 parent e4d8675 commit 833dfc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/linux/compaction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ extern void compaction_defer_reset(struct zone *zone, int order,
9898
bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
9999
int alloc_flags);
100100

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);
103103
extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx);
104104

105105
#else

mm/compaction.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,7 +3050,7 @@ static int kcompactd(void *p)
30503050
* This kcompactd start function will be called by init and node-hot-add.
30513051
* On node-hot-add, kcompactd will moved to proper cpus if cpus are hot-added.
30523052
*/
3053-
void kcompactd_run(int nid)
3053+
void __meminit kcompactd_run(int nid)
30543054
{
30553055
pg_data_t *pgdat = NODE_DATA(nid);
30563056

@@ -3068,7 +3068,7 @@ void kcompactd_run(int nid)
30683068
* Called by memory hotplug when all memory in a node is offlined. Caller must
30693069
* be holding mem_hotplug_begin/done().
30703070
*/
3071-
void kcompactd_stop(int nid)
3071+
void __meminit kcompactd_stop(int nid)
30723072
{
30733073
struct task_struct *kcompactd = NODE_DATA(nid)->kcompactd;
30743074

0 commit comments

Comments
 (0)