linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<linmiaohe@huawei.com>
Subject: [PATCH] mm: remove unneeded __meminit annotation
Date: Tue, 8 Aug 2023 09:58:31 +0800	[thread overview]
Message-ID: <20230808015831.608454-1-linmiaohe@huawei.com> (raw)

kswapd_stop() and kcompactd_stop() are only called when MEMORY_HOTREMOVE
is enabled. So wrap them under CONFIG_MEMORY_HOTREMOVE and further remove
__meminit annotation. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 include/linux/compaction.h | 2 +-
 include/linux/swap.h       | 2 +-
 mm/compaction.c            | 4 +++-
 mm/vmscan.c                | 4 +++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index e94776496049..3dbb7eea96eb 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -99,7 +99,7 @@ bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
 					int alloc_flags);
 
 extern void __meminit kcompactd_run(int nid);
-extern void __meminit kcompactd_stop(int nid);
+extern void kcompactd_stop(int nid);
 extern void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx);
 
 #else
diff --git a/include/linux/swap.h b/include/linux/swap.h
index bb5adc604144..c102587b3a86 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -437,7 +437,7 @@ static inline bool node_reclaim_enabled(void)
 void check_move_unevictable_folios(struct folio_batch *fbatch);
 
 extern void __meminit kswapd_run(int nid);
-extern void __meminit kswapd_stop(int nid);
+extern void kswapd_stop(int nid);
 
 #ifdef CONFIG_SWAP
 
diff --git a/mm/compaction.c b/mm/compaction.c
index ea61922a1619..c59244d2ed5a 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -3132,11 +3132,12 @@ void __meminit kcompactd_run(int nid)
 	}
 }
 
+#ifdef CONFIG_MEMORY_HOTREMOVE
 /*
  * Called by memory hotplug when all memory in a node is offlined. Caller must
  * be holding mem_hotplug_begin/done().
  */
-void __meminit kcompactd_stop(int nid)
+void kcompactd_stop(int nid)
 {
 	struct task_struct *kcompactd = NODE_DATA(nid)->kcompactd;
 
@@ -3145,6 +3146,7 @@ void __meminit kcompactd_stop(int nid)
 		NODE_DATA(nid)->kcompactd = NULL;
 	}
 }
+#endif
 
 /*
  * It's optimal to keep kcompactd on the same CPUs as their memory, but
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 80e9a222e522..eb4db273bf7e 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -7897,11 +7897,12 @@ void __meminit kswapd_run(int nid)
 	pgdat_kswapd_unlock(pgdat);
 }
 
+#ifdef CONFIG_MEMORY_HOTREMOVE
 /*
  * Called by memory hotplug when all memory in a node is offlined.  Caller must
  * be holding mem_hotplug_begin/done().
  */
-void __meminit kswapd_stop(int nid)
+void kswapd_stop(int nid)
 {
 	pg_data_t *pgdat = NODE_DATA(nid);
 	struct task_struct *kswapd;
@@ -7914,6 +7915,7 @@ void __meminit kswapd_stop(int nid)
 	}
 	pgdat_kswapd_unlock(pgdat);
 }
+#endif
 
 static int __init kswapd_init(void)
 {
-- 
2.33.0



             reply	other threads:[~2023-08-08  1:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  1:58 Miaohe Lin [this message]
2023-08-08  2:31 ` Matthew Wilcox
2023-08-08  3:08   ` Miaohe Lin
2023-08-08  3:16     ` Matthew Wilcox
2023-08-08  3:26       ` Matthew Wilcox
2023-08-08  6:10         ` Miaohe Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230808015831.608454-1-linmiaohe@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox