From patchwork Wed Apr 24 19:19:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13642426 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 83A86C4345F for ; Wed, 24 Apr 2024 19:19:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD6786B02D9; Wed, 24 Apr 2024 15:19:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D84CE6B02DA; Wed, 24 Apr 2024 15:19:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4D608D0028; Wed, 24 Apr 2024 15:19:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A51D36B02D9 for ; Wed, 24 Apr 2024 15:19:21 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3A0E514029E for ; Wed, 24 Apr 2024 19:19:21 +0000 (UTC) X-FDA: 82045388922.26.4754149 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 842EE140002 for ; Wed, 24 Apr 2024 19:19:18 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=k18wrnpx; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713986359; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6JotmCFxZvqDAIu3rW0ykimEt5xPYO9EEuXw9rm221w=; b=SNfl2MfV98Fj8owtSawpJgHpQDTY30WzMAUnx3BSQ3A9a5d+uL/+BVsqvrJLpupBVyAmde aWQfJrQjt+LKNQNbO1AoBRspibeN/K+TWnBKB6teXuNdHNNYl1gJq94xvOU4bZoXjrzIFA jsn9kEUKLKOyU+EZA/vOdBe86WjzZOw= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=k18wrnpx; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713986359; a=rsa-sha256; cv=none; b=qaB0GU4ksYwPms/Lp80oQ3/Dx6U3L5KCxAjGkCYPbiZQsizIk7nkiaPv38DdIu5BwXy4W7 a1rddaU7Cdy4iuQdr7P8k9t7kFSNMsNyZwD8qx5tLX7Xn2I3j2K640uKamKThhLPil69OH 2FlhopAlYtNQ/BhmlUP2WI0oiKljcBA= 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=6JotmCFxZvqDAIu3rW0ykimEt5xPYO9EEuXw9rm221w=; b=k18wrnpxCsmY2RbKNZwvjjmgp9 csVyeodjHLocJc49SsJI+2Nc6Qz+3muYTa5OP1sfSm8pcnfPbk1WllrqynKWf8IF2o4+HQ4ItLPp6 +sM/liW3ClWeYq87Two+c0iodY2A9Om+ZxmOyqXoPj6kJdjc6MSyw6P8lPqAt0kQ5gjtvB4dv8Evv 3j5f1i3z0fdVtTJkb3wpYT5Lax6lykMHMZJqdDJjt04xQ7Ib4bdK2wwXwW1GNqP/0hkOA3lNEHsCe eMYVMxCdlTrHWyeOV4eIgFmCjNW6PvfTEVeSBkpDEVajLTmlfYmB6kIWpAjevhXaIcKXJ5bRhAzET MlHLseIw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzi9E-00000001W3t-0zUQ; Wed, 24 Apr 2024 19:19:16 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 4/7] mm: Remove page_ref_sub_return() Date: Wed, 24 Apr 2024 20:19:09 +0100 Message-ID: <20240424191914.361554-5-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424191914.361554-1-willy@infradead.org> References: <20240424191914.361554-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 842EE140002 X-Stat-Signature: u31b4frndo41hx75u789knui777q453h X-HE-Tag: 1713986358-381183 X-HE-Meta: U2FsdGVkX1/P4F3WLhIiPXFv7MlKyyBP1Al1PT5MSG1T2zjK7K59mplW0OcHgwYaI6lbuIsxfOXhJyUbYjM/5qNCTktVx3JMoP/+dqE2NnpUCBv/yauXkIkuuftxg7kRpG71jJVqDjPIfydm9PtJjuOZlUz0BDV3sFGBSqf8pgQSZxm+w3FbTgHAseETa4GeUU/kvCEpmRMdtUqggLfKiKgaJDT5mQrhqC5J28lcZzLTHWk2HZGPRttJsn/W8QEVXU7g08GQB7AXH3h4gI3ZrOg+7cvwi4HSyOAgCW4jJzxEy1SInwOCCEiZHB1qYygu/dPhjqygq/zTMvbAHVYB86Z8SWYtAOAYFWRdk9SqGb30a8UbVIvV1zQU62ECL1eFvwo7s3+zUCrdK9IjvzpBKVaRmLTEZdGc0xvILjY4RQ79lgzWCrjxlUXFA3a7uEUwZ9o9XwiFVqeVCDR54jQJUO/nAEXtDbxWq2UpH8dDXW5pyb2BYqRZPbO/TIzAt6r+l6lJ5VDczHA7qD+0Vq9KXOOt4R4aiLPaCuOU9d/FIhGHmkoH76GWc/+vcoK/EzDezdvVbTye5LjQTqdvuCm935rbQSs3ZHCadWFZx4k8NGzbb4Ag+mYj+f62ltl/qnekV7VuqS2ypjSo0HAMBYJHi2wYVEf0uHiyJ41Il3Ono4rE66KMrXVvnVLxMCrRssGnwxNj6w7QhRAdll0qgYS83PqSRbmKBA6Xmh3Vkv7tTE0ofW9w+1iQdNacL/M7VciCAuBsrqHWtd+AuSPa96OFDbLtoIVuc/IuE875WLFqdGuR0FT0DlyryAglOxLm0Na6h1dYLx6M3KJtx9CLv9r7Y4cMQ4MbbtZzXnBPUtBlBrpSW6C0+vTrPE5pYYu0uVt+oeemSM7/IkqUeyrDEywksKvrQ2jqARJM 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: List-Subscribe: List-Unsubscribe: With all callers converted to folios, we can act directly on folio->_refcount. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page_ref.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h index d7c2d33baa7f..1acf5bac7f50 100644 --- a/include/linux/page_ref.h +++ b/include/linux/page_ref.h @@ -139,20 +139,15 @@ static inline void folio_ref_sub(struct folio *folio, int nr) page_ref_sub(&folio->page, nr); } -static inline int page_ref_sub_return(struct page *page, int nr) +static inline int folio_ref_sub_return(struct folio *folio, int nr) { - int ret = atomic_sub_return(nr, &page->_refcount); + int ret = atomic_sub_return(nr, &folio->_refcount); if (page_ref_tracepoint_active(page_ref_mod_and_return)) - __page_ref_mod_and_return(page, -nr, ret); + __page_ref_mod_and_return(&folio->page, -nr, ret); return ret; } -static inline int folio_ref_sub_return(struct folio *folio, int nr) -{ - return page_ref_sub_return(&folio->page, nr); -} - static inline void page_ref_inc(struct page *page) { atomic_inc(&page->_refcount);