From patchwork Thu Jan 12 08:30:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13097563 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 5B2A6C54EBD for ; Thu, 12 Jan 2023 08:17:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47C9B8E0003; Thu, 12 Jan 2023 03:17:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EDAF900004; Thu, 12 Jan 2023 03:17:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FC938E0007; Thu, 12 Jan 2023 03:17:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A404D900003 for ; Thu, 12 Jan 2023 03:17:41 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7420D12052A for ; Thu, 12 Jan 2023 08:17:41 +0000 (UTC) X-FDA: 80345443122.09.5413180 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf09.hostedemail.com (Postfix) with ESMTP id F136C140010 for ; Thu, 12 Jan 2023 08:17:38 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673511459; a=rsa-sha256; cv=none; b=Y6tSYeLIhXXGLu9LIcyym2DPpk501Fod4cRqX5fP6b22PEJzG6bo/nu7uN9KBQuuhaboJt eTB8cSSNVJ5iyr+VkpDVJz0beBWGXzGyEEka/AmiBiPY99x/q3lX5W1fDjkYYiiOm1ss+r Zl/LM03hlS1qOGg6P569q0jA/3kQlvc= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673511459; 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:in-reply-to:references:references; bh=+z4eofE9nff3vyL8ObJyK/MRgR2W0Z1B4DVPxEokq1E=; b=SRtmiTTYrUGV41nA99A3qiruBaWD87rGP7NbVH2nL+sSM9qleCcRrimeMAnEpu6AH0ZvAv RjleEz5OfuXe8Kril4p72mr8k+TACEkgHSfoFEF0MBhVl+AZy3wZgzLHsP17RXyjmvT+Iy xH79e3ezBuJqvK0bVSI+XAiqxgn845g= 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 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-Rspam-User: X-Rspamd-Queue-Id: F136C140010 X-Rspamd-Server: rspam01 X-Stat-Signature: pioc81brk8f7i9n5x4h1jxf7ouej3nqa X-HE-Tag: 1673511458-860593 X-HE-Meta: U2FsdGVkX19omFgOBbHwoKfI4NZ9Rsysx1Xmp16oJ/HMhMCe/1qlDIWtGA03FqD4dTfYDPIqhzpssl/AnvsbH5nb2NI1CVh+IsHZVivqtFbQozWSES6kp5fNzvSbfU7Ar4YsWk96F3S53FE2o6pY7VPkr79v4v6XssEh6D/R1IA3W3t/rSAbURRgGniN6wuOJC9DgfBFUpbsjeqmhJulwXka7IkIwStrT5y8zGX4mA6X5yhuq9jjlcc+DzDvbtjLiZapZQge/w7Z3pW5er/WuS6INROqJD3rmQ4T+c5NPBDoia54LanXQZK6LmcgD9+VbmevBQ21j7cqgVnamCRPoMNk3bK6oJvHJVnrQULLZ/ORn1b6TgINeD5o1oScCIer8eXhTn/R/SCRYpg9ISeZi095hj3ptPA1LXEJ2DKbhMYj/A0r1odRHFwt/dHMjyVan2Gl5h4Lqbafjlv1K90osRsGLPxBc1rd8sT5QlfvZiSX1Hfy7GiZ1bOKQWRQa+VHgnhO8xUdjMa2sV4vjHI5ApPjlyt5naWhFLnr+jSBgoKbXCw091CD+kF3ttLkdatzIezfe+zrl7N452iYL0HXMbpdtDf5lIXaJ12lBg61QopxkphucSZ7tQu8Z93u7hGc/ESvAqKvj/wG58bJ6IOchD1DipDfAb3BbfcpVRR0TnBvjR8K/aSri1tfAFXQSu+CulQFWe2oTKc1lRwMEzYtoYVGj2nIQw+gpqYpdlaoHgdjLV2K45mzMCndW3u7FVNGsfUam/zg3P4jgfgLijobI38Vjqc7ZBJQSYsuHeM+0lGs4rasM2VSfarLxLyclTnIk7FVwl+bX2Fu1Cw7qDvmzF4tVZWQnYLqOIXMWoVcC44fdjN+0xPC1nNq39z8fy3705XsyrQXzvWydJIunumeL36miVJ0q2wA 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: 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;