Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10704155rwl; Thu, 12 Jan 2023 01:11:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvCKl6/WezARf66npK2qS39dNVS1d4cNPkP3fPoLiCsVRsAZU4GCrqMrm4deOhAJH4ZcNq/ X-Received: by 2002:a17:907:8b09:b0:7c1:6e82:35fc with SMTP id sz9-20020a1709078b0900b007c16e8235fcmr85286684ejc.40.1673514697520; Thu, 12 Jan 2023 01:11:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673514697; cv=none; d=google.com; s=arc-20160816; b=Xse7atq94l6FHJa8rsj1w7uxZplxMBNTShFJ1CM7G4bQquvsx54bROfVfAluOO/2S2 4CufUQTmW6JJfKDkbVv+pCWWmj/KdzrnHbuvtbb6jexX2+HcJCDQ5B6wEVBMG70wYdb1 R4Y3flbha7uz2XuNjAR0UO2aBPcR0/qXhUFOLD/m4hsd92f9Yc+UldubuVwpydSloGgR xJqJ6gt4ZnTxbvpEi7jBOA1LqfjNzYD294/4F9dXyFkF4mQEG81ln2Ja4oeX/WFEDAV0 ashciP936QDwMmbThsSD6iyHFZTTf2ozqFLpg/tlqLGtASqhulXdwaKLSpelHyDzk/h4 ofOQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+z4eofE9nff3vyL8ObJyK/MRgR2W0Z1B4DVPxEokq1E=; b=gY5GTVNZ5usYEXMKl/4HXbEQQoXZqBST+SperRqvZ8S6hUbnd41KhArKILPuuoJZQ3 nS9DZ0GUmgwzogtrl5wNG5Of4IgnrdeOGlt9I5yQDY4jTZx+rqIYvBuy/salgIf3LTyg 9twPnPaEUmvb/bDSof1QsUz51wnu2UorpcDCl2rMMReBljCvdVMGI4ZAmOk43SpeYtTc 89+GaWyl8vCyahEgHh1l3FV1DQ+4qqJyEtCa1j6ZPszdSiEhLqQLHyJqFZpeMN7T4cdn 22jMAVR6Ds9vW1twV9N5gRyIxmWd6FkvvYhRQ0yNGBfasWW2kqLqClXHxL+I7Uu38ba1 igqQ== 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 du1-20020a17090772c100b007c0a8ff3384si17052376ejc.763.2023.01.12.01.11.25; Thu, 12 Jan 2023 01:11:37 -0800 (PST) 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 S239844AbjALITA (ORCPT + 50 others); Thu, 12 Jan 2023 03:19:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239622AbjALIRx (ORCPT ); Thu, 12 Jan 2023 03:17:53 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FBE23724A for ; Thu, 12 Jan 2023 00:17:37 -0800 (PST) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Nsy6k50gwz16MZK; Thu, 12 Jan 2023 16:15:58 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 12 Jan 2023 16:17:34 +0800 From: Kefeng Wang To: , , CC: , Kefeng Wang Subject: [PATCH -next 7/7] mm: swap: remove unneeded cgroup_throttle_swaprate() Date: Thu, 12 Jan 2023 16:30:06 +0800 Message-ID: <20230112083006.163393-8-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230112083006.163393-1-wangkefeng.wang@huawei.com> References: <20230112083006.163393-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) 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 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 All the callers of cgroup_throttle_swaprate() are converted to folio_throttle_swaprate(), so make __cgroup_throttle_swaprate() to take a folio, and drop unused cgroup_throttle_swaprate(). Signed-off-by: Kefeng Wang --- include/linux/swap.h | 12 ++++-------- mm/swapfile.c | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 209a425739a9..2674408e6d63 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -641,22 +641,18 @@ extern atomic_t zswap_stored_pages; #endif #if defined(CONFIG_SWAP) && defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) -extern void __cgroup_throttle_swaprate(struct page *page, gfp_t gfp_mask); -static inline void cgroup_throttle_swaprate(struct page *page, gfp_t gfp_mask) +extern void __cgroup_throttle_swaprate(struct folio *folio, gfp_t gfp_mask); +static inline void folio_throttle_swaprate(struct folio *folio, gfp_t gfp_mask) { if (mem_cgroup_disabled()) return; - __cgroup_throttle_swaprate(page, gfp_mask); + __cgroup_throttle_swaprate(folio, gfp_mask); } #else -static inline void cgroup_throttle_swaprate(struct page *page, gfp_t gfp_mask) +static inline void folio_throttle_swaprate(struct folio *folio, gfp_t gfp_mask) { } #endif -static inline void folio_throttle_swaprate(struct folio *folio, gfp_t gfp) -{ - cgroup_throttle_swaprate(&folio->page, gfp); -} #if defined(CONFIG_MEMCG) && defined(CONFIG_SWAP) void mem_cgroup_swapout(struct folio *folio, swp_entry_t entry); diff --git a/mm/swapfile.c b/mm/swapfile.c index a5729273480e..3abf514c3f28 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -3636,10 +3636,10 @@ static void free_swap_count_continuations(struct swap_info_struct *si) } #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) -void __cgroup_throttle_swaprate(struct page *page, gfp_t gfp_mask) +void __cgroup_throttle_swaprate(struct folio *folio, gfp_t gfp_mask) { struct swap_info_struct *si, *next; - int nid = page_to_nid(page); + int nid = folio_nid(folio); if (!(gfp_mask & __GFP_IO)) return; -- 2.35.3