From patchwork Tue Aug 8 01:58:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13345576 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A60FC00528 for ; Tue, 8 Aug 2023 01:59:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7629B6B0071; Mon, 7 Aug 2023 21:59:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 711D46B0074; Mon, 7 Aug 2023 21:59:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 601628D0001; Mon, 7 Aug 2023 21:59:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4D3D66B0071 for ; Mon, 7 Aug 2023 21:59:02 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 22ACEB1791 for ; Tue, 8 Aug 2023 01:59:02 +0000 (UTC) X-FDA: 81099279324.16.1516276 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf06.hostedemail.com (Postfix) with ESMTP id 2E55D180005 for ; Tue, 8 Aug 2023 01:58:58 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691459940; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=6F5iShHhm/WcxccnSNN20xkK8gSs/ZWkkDjkWNmXZ9w=; b=zhAUuCgZysUolZI3lAGS95wNvB13dO+ivnmBFYG1hvnWfEIfdh6tPhxsvsVBNYGgL6Xd1c o3RzcZ6XI+PoRm9bnXaATQorzSt5GacF0W44zpuZSIJU63q3osO1VZFLZdg9bkRi90NKPd NQF55e8QL5213WwFTKjD8NOBZPMdynw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691459940; a=rsa-sha256; cv=none; b=iU0ptGukDFHrTdcRcLJXhkKs3CjungpoEspgszwQXC/qYaou/HD1nvW+rV2R8FRscdlMZR smPkxtEufbV5CF48wNJ0OD7JjE42xT3FwS8ByaAA+JiokmsLzTGkuGnuk+em8cSzykVsSi PLafwJIWb+u0zCCjYyqW89mP332WmRQ= Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RKbtJ6BypzrRh6; Tue, 8 Aug 2023 09:57:44 +0800 (CST) Received: from huawei.com (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 09:58:54 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm: remove unneeded __meminit annotation Date: Tue, 8 Aug 2023 09:58:31 +0800 Message-ID: <20230808015831.608454-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2E55D180005 X-Stat-Signature: gsjezd76m3p7tkrtdpc6oqz8qjmoojp8 X-HE-Tag: 1691459938-510876 X-HE-Meta: U2FsdGVkX19z9h00Ef8F9R5jl3qCjVoqWa5xx+K5Xa5pp6o3VmLzeZs+NMoFnG/GUMlg/3CrbAuRq2a4MJYnq9UVhZoOLkGflElmBJfKqIuDADqxkkc9Lu4HFn9mH+0STE7e9rwcoQWh4R1sLPQ7WQlWAIbtLhuZY/cy79Q5YGR7KlsvXS6JTYDgf3n2W+P3/fc/185+237hD0vuyoqE9cEMU/GAHGkKthR+XvLwww5SjAC2tssFg8585hk5TmGy1LkfGz+UxEFb6WT4kUOnmMh8rCetdE0UIHiliosc76YLrRNYUdNZKLh1j4v7lXLt8H0PiTiKlQgbE6kUqkTnYX2v0h0Er36ncKu9t6s+wl3NvJodalqSnju/oF5/Pl//WUUTmZ89xhnXjZu8cfH2oV3L/pRqON98qyNNkuKCxZbtImYjL2iMcTg8ysikv22Z5Fvi1SdS5UOfmCoCTa9WUX0LkV9hfTtDNGCp7C9UZoq7UYyp3qeh6mA2qB4zCmLs+10Na4ImcopF5VO3npxUQI052dPvWIOQEEbjronziCCU5N7XI7q1pHdqx+vtuXH3Xe1Z2uuOJNWgp8h3Rig/LBDaFAmRzS+n6PcFUascbj4F2A1eOjVsi8R0bJH1ZDgSr6uUVrs5NAgEiZ+Sn4WAcSL2tBCQwAljXweK9EktTw1o9nlvbAP2gbGkiIie1o08ENpA/VDYlvOpaeZN4NJcdDBmClfvVVea/A2rzmbVboK9KagAWMGrFZTegXgNA9AJ1ZkOtvQUIay0QrtjUBcrq9pZg41Lb6jSFGEblb6AN/Ph8Z9W0eYwDcpRDQD5IMA6uAvL0RuuhUpnDRWbIy1g8L06/iqYB0Ajcp4IbCHGSv/aghOvFpcxz/QwmtIqQUNnJvj2m0NIRjNQ/fPFL1arLxXhQR/GBIkfkF4sIC8rnrpEX/5mLBFQfLtbq3PZ1r9Os9nC3EEqpfTHUbBOz63 dyXPLZfR piJwb/58RZfGQKnP1aPyCIoE59v6mrvFfnrLRsAcYiq4cWufmH2FqeosM3UKR8TP92RTSqwrgdntnNiqNtUoax6th+VBZx2bmdzeLpp4IbboF3pnOK0Ge9Y+zFrUxqUN9XtN+aYyulrFYcHeCbqUMbNDRLlbCvcsuN25r0r5+O/6BpYuKPsTOb2zLSHeAsRCVsIaP X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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) {