From patchwork Fri Apr 29 19:23:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 12832636 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 B00ABC433EF for ; Fri, 29 Apr 2022 19:23:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4B706B0075; Fri, 29 Apr 2022 15:23:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DC4CF6B0072; Fri, 29 Apr 2022 15:23:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C00686B007D; Fri, 29 Apr 2022 15:23:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 9B37A6B0071 for ; Fri, 29 Apr 2022 15:23:40 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 73BC06052E for ; Fri, 29 Apr 2022 19:23:40 +0000 (UTC) X-FDA: 79410891000.14.7FB60AD Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id E804E80070 for ; Fri, 29 Apr 2022 19:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=n9NMj4BZarLYBsrQRxi23hUYBJtKn1+fa2ahXmhQQvA=; b=dwApAtRsaQK3p7LY9gBcX9/Nny whCN7UTqjixLMEXKxY25V2nEwuh9fq3rdOAW6xFZDA8SsEcrqsEVWzEHddfdQSA0kerTuE0yHDc9b r7CijD9RH+cDdMwaPU/Yo3IYiJrHOXFt2P1fzdWp36iMqEhmqyeeRkzBCxrmGMIuugtcjHpAE8jhS hP1FeUW8citp9ZnYPxK7iKDLvDGMqo+hwO+zWX9Pybpm2WseDAs8R+eXrbg+KxEHk05FMJx1UVmZ2 B92REqcrJk2s/WMnJ3OnvibZZ2GN/O/9yKZtqQF8yR6UhNSLi24ZFkUSUBauFA1P5tucsHKV1xD2A Ylb/Swmw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkWDK-00CjPe-BL; Fri, 29 Apr 2022 19:23:38 +0000 From: "Matthew Wilcox (Oracle)" To: akpm@linuxfoundation.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 15/21] mm/swap: Add folio_throttle_swaprate Date: Fri, 29 Apr 2022 20:23:23 +0100 Message-Id: <20220429192329.3034378-16-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220429192329.3034378-1-willy@infradead.org> References: <20220429192329.3034378-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: E804E80070 X-Stat-Signature: woffcbtij89py8qrk4pn7dw7enhdbtwx Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=dwApAtRs; dmarc=none; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1651260210-566562 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: The only use of the page argument to cgroup_throttle_swaprate() is to get the node ID, and this will be the same for all pages in the folio, so just pass in the first page of the folio. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/swap.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/swap.h b/include/linux/swap.h index f87bb495e482..96f7129f6ee2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -736,6 +736,10 @@ static inline void cgroup_throttle_swaprate(struct page *page, gfp_t gfp_mask) { } #endif +static inline void folio_throttle_swaprate(struct folio *folio, gfp_t gfp) +{ + cgroup_throttle_swaprate(&folio->page, gfp); +} #ifdef CONFIG_MEMCG_SWAP void mem_cgroup_swapout(struct folio *folio, swp_entry_t entry);