Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1145132iob; Wed, 18 May 2022 23:40:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvY+b82xLlnGGSoYzk0j6AsTNXJWYd7Z6HczRd8TkQZ8xgRL/GhZnoUmoD1MobRJN6D1Zm X-Received: by 2002:a05:6402:3509:b0:427:e7db:1513 with SMTP id b9-20020a056402350900b00427e7db1513mr3645865edd.407.1652942401863; Wed, 18 May 2022 23:40:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652942401; cv=none; d=google.com; s=arc-20160816; b=EHnYTxBozx1Xb6lEkENLYQkWmjT8JQnASpVztHDDKmqDqe90F1v3AdL6vRHEjECunJ G8+77pduhosksKTevHYRYsncM9tfY+rVBgew38Gl0rFWF4tzoGBvnvJ20fyXbXWHo989 KqYlH4mDwOzNKelqynlnDQyFPZg2LOFNHTRWVPBsWfEMzzVGTP0dx2Q55nrEZX9k0+oy EpA74KtLB10SKMFQbPZssq1SMnmOiQvQU3hUy1pxFidYXf68GUjsR4O/TDPRznd5OXHU nZYP3HNJI+/HgMcKH7Mq6ntvJnpuOJepdwRcQAzBFu7qwis0tZOOSCnqyvQvbeC04NIi gOIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=XDd8lGlq4c1jRsg3MWGwSNKp1vOSRbfBCLL9uTFRklY=; b=VuUaPApgQIcC83xo6DImXvbFpFB9PLM04Il8nnnCgVURdieCrMHBRWb8mFegsmxJT9 SSQP3IjUZESbN3HXNqn9Y50/7N3Xp6BLjgMBjUOH/BasbW7CIfTreCC7lp0vGdG7hjH2 9ogKs6HXfUSUJ3/hSvK/9aB3B/jogU7IS5gxDwpyPnwYVkUUOSRiyblnMK5pF6bvgKnH YeEh4x+71vzJjfAEgoUKtJT4RAWYW7sKoX62FpYtWg4BZXhboBNFRQqzDCjaF91X1tBI nk7aYxTALRZ4OV2KMBPf9caqU9ZpklvMeXVKz+Egm1eRwhjF8ZhikLTvpTRL51x/gn0H jkgQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a170906720900b006e80297a928si4913838ejk.469.2022.05.18.23.39.35; Wed, 18 May 2022 23:40:01 -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 S232507AbiESByQ (ORCPT + 99 others); Wed, 18 May 2022 21:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231152AbiESByO (ORCPT ); Wed, 18 May 2022 21:54:14 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D1F7C1ED7 for ; Wed, 18 May 2022 18:54:13 -0700 (PDT) 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-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 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 >> >> >