From patchwork Tue Jun 6 12:18:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 103786 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3363049vqr; Tue, 6 Jun 2023 05:40:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6G9Guv0U7Mtu+OAIi6rvmoQ0WjofajWaRugPFVXJVbTiJvYs7gjE+5l7DGPY3kiow5zNVI X-Received: by 2002:a05:6808:193:b0:39a:9509:db6c with SMTP id w19-20020a056808019300b0039a9509db6cmr2133889oic.12.1686055253866; Tue, 06 Jun 2023 05:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686055253; cv=none; d=google.com; s=arc-20160816; b=n0R9COivvCJFhOmJwa2eXGVBAoSHgyTKE63sCWE3MurESBEfbnJndDCNv68HUkLuCS ZnFAsEO9wYirE5ib0YzzZedq77wuraDfec7ncD3yOjnSIyYmSuwmOSYTJTWke7UQZwUT aBOhNvfEgmCAcOo7q2FFBQZs1dsLhLr7w/sE7yOoj+tvILxyxoCz/1nT0uqdYg+joFs4 HxICvLkObWBiXQiplbYJby7XOL1VuMsh+/KokU3x8n1vrkujtyRU5R9TQZeWK7cbBhHk 3znIFKWm9xKj6UGVy06HVbEKh0S7Yvg/cAt8Pe+s5X08PAaq43mbRezQy8hh0EoiCDuL 1lJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ai02UAYU6ozdjn+Tm9J2BvLUpY1R7FLaJZpJ4UgxKjk=; b=NFnSghIGn0am8TAevD72/xTaxjI/a+SdDU/rk0XIRvA2w32FmSPoNz4GXf0MSfg3/O j9qOqW635AuNnrFPJqCpOPpfSYF0eG9dfGQeRMKz8lXsutv0jGT1saZHWhtNG/xs/iE7 rhqRUjbLDx28fMa763QT83xVlASadYjiobJLBF9XVAIiQSCA7sSur9pNbO3eNy25IQli uFIaaDCxeVDouZnISP7WvyDIK7qIJXd8d+ujEWlCs5fHTA+FkUVIgQrRGi0jrEeeGZ9E 3cRXZlA7VMC2wacn65bsJXV5yAKH4iUSTjae35Yfdu26buDeJwczy8jGkOXTknV6r7IN B9Vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 134-20020a63028c000000b0053f3d04e66bsi7294029pgc.698.2023.06.06.05.40.39; Tue, 06 Jun 2023 05:40:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236803AbjFFMSd (ORCPT + 99 others); Tue, 6 Jun 2023 08:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232229AbjFFMSa (ORCPT ); Tue, 6 Jun 2023 08:18:30 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9682FE7E for ; Tue, 6 Jun 2023 05:18:28 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Qb8Zs2B1gztQdM; Tue, 6 Jun 2023 20:16:05 +0800 (CST) Received: from huawei.com (10.175.104.170) 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.23; Tue, 6 Jun 2023 20:18:26 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm: vmscan: mark kswapd_run() and kswapd_stop() __meminit Date: Tue, 6 Jun 2023 20:18:13 +0800 Message-ID: <20230606121813.242163-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767957074030916042?= X-GMAIL-MSGID: =?utf-8?q?1767957074030916042?= Add __meminit to kswapd_run() and kswapd_stop() to ensure they're default to __init when memory hotplug is not enabled. Signed-off-by: Miaohe Lin Acked-by: Yu Zhao Acked-by: David Hildenbrand --- include/linux/swap.h | 4 ++-- mm/vmscan.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 2ddbfd85f6c7..b5f6f2916de1 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -460,8 +460,8 @@ static inline bool node_reclaim_enabled(void) void check_move_unevictable_folios(struct folio_batch *fbatch); void check_move_unevictable_pages(struct pagevec *pvec); -extern void kswapd_run(int nid); -extern void kswapd_stop(int nid); +extern void __meminit kswapd_run(int nid); +extern void __meminit kswapd_stop(int nid); #ifdef CONFIG_SWAP diff --git a/mm/vmscan.c b/mm/vmscan.c index 43dc5c90abbf..a8881571e0ed 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -7871,7 +7871,7 @@ unsigned long shrink_all_memory(unsigned long nr_to_reclaim) /* * This kswapd start function will be called by init and node-hot-add. */ -void kswapd_run(int nid) +void __meminit kswapd_run(int nid) { pg_data_t *pgdat = NODE_DATA(nid); @@ -7892,7 +7892,7 @@ void kswapd_run(int nid) * Called by memory hotplug when all memory in a node is offlined. Caller must * be holding mem_hotplug_begin/done(). */ -void kswapd_stop(int nid) +void __meminit kswapd_stop(int nid) { pg_data_t *pgdat = NODE_DATA(nid); struct task_struct *kswapd;