From mboxrd@z Thu Jan 1 00:00:00 1970 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 43DF5C433F5 for ; Thu, 19 May 2022 01:54:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C36396B0072; Wed, 18 May 2022 21:54:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE5986B0073; Wed, 18 May 2022 21:54:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A85866B0074; Wed, 18 May 2022 21:54:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 992DD6B0072 for ; Wed, 18 May 2022 21:54:15 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1C9A832BBF for ; Thu, 19 May 2022 01:54:15 +0000 (UTC) X-FDA: 79480822470.07.081B358 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf15.hostedemail.com (Postfix) with ESMTP id C239DA000C for ; Thu, 19 May 2022 01:53:57 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L3XtT0Y9JzgYJJ; Thu, 19 May 2022 09:52:49 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) 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.2375.24; Thu, 19 May 2022 09:54:11 +0800 Subject: Re: [PATCH 08/15] mm/swap: make page_swapcount and __lru_add_drain_all To: Oscar Salvador , Andrew Morton CC: , , , , , , , , , , References: <20220509131416.17553-1-linmiaohe@huawei.com> <20220509131416.17553-9-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: <0724d13d-685d-d975-65b7-5248013469e8@huawei.com> Date: Thu, 19 May 2022 09:54:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] 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-Stat-Signature: bnr1ztxuy1aqhxesmwb1w79d71uxi861 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C239DA000C Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-HE-Tag: 1652925237-716003 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: On 2022/5/18 17:46, Oscar Salvador wrote: > On Mon, May 09, 2022 at 09:14:09PM +0800, Miaohe Lin wrote: >> Make page_swapcount and __lru_add_drain_all static. They are only used >> within the file now. >> >> Signed-off-by: Miaohe Lin > > I think the commit message is missing the "static" word. Yes, you're right. The commit message should be "mm/swap: make page_swapcount and __lru_add_drain_all static". :) Hi Andrew, Could you please help tweak the commit message? Or I will send a new version soon if requested. Thanks a lot! > > Reviewed-by: Oscar Salvador Many thanks for your review and comment! > >> --- >> include/linux/swap.h | 7 ------- >> mm/swap.c | 2 +- >> mm/swapfile.c | 2 +- >> 3 files changed, 2 insertions(+), 9 deletions(-) >> >> diff --git a/include/linux/swap.h b/include/linux/swap.h >> index 999c7d79c2d5..8772132d21dc 100644 >> --- a/include/linux/swap.h >> +++ b/include/linux/swap.h >> @@ -490,7 +490,6 @@ int swap_type_of(dev_t device, sector_t offset); >> int find_first_swap(dev_t *device); >> extern unsigned int count_swap_pages(int, int); >> extern sector_t swapdev_block(int, pgoff_t); >> -extern int page_swapcount(struct page *); >> extern int __swap_count(swp_entry_t entry); >> extern int __swp_swapcount(swp_entry_t entry); >> extern int swp_swapcount(swp_entry_t entry); >> @@ -562,12 +561,6 @@ static inline void put_swap_page(struct page *page, swp_entry_t swp) >> { >> } >> >> - >> -static inline int page_swapcount(struct page *page) >> -{ >> - return 0; >> -} >> - >> static inline int __swap_count(swp_entry_t entry) >> { >> return 0; >> diff --git a/mm/swap.c b/mm/swap.c >> index 7e320ec08c6a..6d2c37f781f8 100644 >> --- a/mm/swap.c >> +++ b/mm/swap.c >> @@ -748,7 +748,7 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) >> * Calling this function with cpu hotplug locks held can actually lead >> * to obscure indirect dependencies via WQ context. >> */ >> -inline void __lru_add_drain_all(bool force_all_cpus) >> +static inline void __lru_add_drain_all(bool force_all_cpus) >> { >> /* >> * lru_drain_gen - Global pages generation number >> diff --git a/mm/swapfile.c b/mm/swapfile.c >> index 7b4c99ca2aea..133e03fea104 100644 >> --- a/mm/swapfile.c >> +++ b/mm/swapfile.c >> @@ -1430,7 +1430,7 @@ void swapcache_free_entries(swp_entry_t *entries, int n) >> * This does not give an exact answer when swap count is continued, >> * but does include the high COUNT_CONTINUED flag to allow for that. >> */ >> -int page_swapcount(struct page *page) >> +static int page_swapcount(struct page *page) >> { >> int count = 0; >> struct swap_info_struct *p; >> -- >> 2.23.0 >> >> >