From patchwork Tue Mar 26 17:10:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13604740 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 7FDA8CD11DF for ; Tue, 26 Mar 2024 17:10:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC8586B009D; Tue, 26 Mar 2024 13:10:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6C576B009F; Tue, 26 Mar 2024 13:10:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A71906B009B; Tue, 26 Mar 2024 13:10:53 -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 794CA6B009C for ; Tue, 26 Mar 2024 13:10:53 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 22917C0D34 for ; Tue, 26 Mar 2024 17:10:53 +0000 (UTC) X-FDA: 81939829986.13.77BAEFD Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP id 837911C0009 for ; Tue, 26 Mar 2024 17:10:49 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lMDBhqTz; dmarc=none; spf=none (imf18.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=1711473051; 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=yLB9fRmL27Mn3KGQOeYYZ+UTkGS5oCjoLLO67g9U514=; b=ir5xOetX8T+nWGHgFyXOMxzcil/jWJtaFKNrzRKzu0F4Gioi6n6LzMGuV00rq5iS2sq19V /6i493jvgf9rDIsS54rndqksWoasW5bWDHEn3wNNuD0cOTGS5Rh9WMKQc4EtlS3a9kiPDn c3yucwRLdR/Y/5WaRMS3c5NacqIldpc= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lMDBhqTz; dmarc=none; spf=none (imf18.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=1711473051; a=rsa-sha256; cv=none; b=AIBlGEuVw9Gk+cqUj8K1ekZGsKAB9ineFHqYCY3kDUMQR30TvRumrmel5LGrCflyl1CVMw WH0JPdwTVg9jRKe9rDhrly++0xwFrLq9ecICsYaO7l+dQGQatx9jBbc1eS2CWViBc1Mg+l w31qRkTzz6chxpBIA1tHinAzMy5Qby0= 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=yLB9fRmL27Mn3KGQOeYYZ+UTkGS5oCjoLLO67g9U514=; b=lMDBhqTzPMCzaZQ+qhgjzoZBo6 sWsALAHSgoX/lHXVJ67148gO4EcUSrVWQQvc7IhsytcOMuYyPukR9mtnl8o0Z1bE5Nf1lEcY9mwcd sIRvf+KAR2ZQycws44gZKZPRh1u1+q3m5p3Ocl1W1QDufs88Os1d9X8/d90hs2RtRdZBkOpFeLfGj D9aIs+eRqNqS8Lr1lji4+3WJdDv706oMC+pkVtoDJ12NnCft+FobyriQ7AdZzDJ1Q+w9fHsCzo0Ag Afq9E6hgonNL40dMmnpQoUW6qCgrpKunVjQDvkZUl8jFG3ontV0X9aZsE2bPjNp/umcQxqj2MXGNh MDKWV/SQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpAK0-00000001is7-0GPj; Tue, 26 Mar 2024 17:10:48 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 04/10] mm: Make folio_test_idle and folio_test_young take a const argument Date: Tue, 26 Mar 2024 17:10:26 +0000 Message-ID: <20240326171045.410737-5-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240326171045.410737-1-willy@infradead.org> References: <20240326171045.410737-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 837911C0009 X-Stat-Signature: 3qop8ezwcruy4f33pzmg8t19suryzt6m X-HE-Tag: 1711473049-26765 X-HE-Meta: U2FsdGVkX19b/hFTTAMtU6OzbEzxA9jJchrqqGK5hJ5Hq5KwCiU7lHtGHlvbc8Hf8Bk9cGMe7gslQsfg2h8Ofh3h4PsadMRveCr6KGMbd8YbzjGIu1h2BRch/UlmqJe5fXVa4yAosV5zCtd2h1i89u/gTWBUiymn/L0ahqRFcq4ttFaxwH+OIJm/gTCbHVz13SUVnJh/IK1lR+KYtntcgbNJriPLVa76fsFhkP0SxG96uCleCt0RjgVJAwOxUol1Pf9gxvxYdl7hK3FgMcUVWMU8+zKZ0OYqU+KDodrX7iTl0BxoAxrAkIpSMKv4aVhIz13aCHXsGAeLqT9etpfToRLG1FYxYc2Oz2LeLN1J3AFpTjI8qHJCoUsYJqHgtSdOGEh9P+ir7icOy3dY6rAgpCL+vS00SP3CK6j/ETgztsZSnB43VR6HGvUEnM045jfx3+uk1+FxUySicX5tszeB8tTF29H2I8M2MaTGpN0PNd7O4im+hrvNQPRHAbeUdtYGdZrNnivy/5eTrqn/Yv2mX0qjDmycN9jUIoeSIk5mk8vWc1z4jCrKPiVYmyP807EpyNUwlqobusa5MsEAOd+Ib93VIcaBUKs6BWiRSHorITZupt/cn1iFr4U2QcRL2niEjS72W66DZt42w1IsN7fn9ZtVnZ6EH2BJuEMS8JrE4pjWhOPziIgU9961KUZBn+B5vJQbMFYN1Q3bFMj+/iBwF/zqXf9s95zAgsj3mPFZ3PqS1gFbLkrgUG0Du5165vS3X9IN6ETMCl2OcLCAX///zMDA7TD5Erk2LZEupr15zAM9vW4n5t2aSbM8P0fGD8akyxQCY346GhE7biS7qlQ3617ruOfdmbrgFnyB10RXmaPEswKTB0M1+briAPMgCQp9TiviXdBWmNf9Yrid88CEyC/9puYmE8o1CzA6NfKd7C8eT5OVs0gYNUoko1O+zqL34LsmBuln8jVoyYjmi+G 0YK04swP Vu98rjfwcL10aiM1V9gxrs2zKrCl2QxkKonnjehFzSwvJVlLRaxwDKdTCVaJBpRChRPeOdRlT15ltHB/8r+qs2nA0hdc4gMiofBvHW2eSYcVUA0UnbN/zacLq6cn5vJ/AiQH26MgEektuMjetJVnVvUhh4+cmlLNlr75asvw0irtXmXw1PIlYIoUoyPK4NfWKifQ3zQ42FFc3+yk26Jj6XfUVGo+47ak3kziW 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: If these functions are defined in page-flags.h, they already take a const argument; make it true for these alternate definitions too. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page_idle.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/page_idle.h b/include/linux/page_idle.h index d8f344840643..511e22ef459f 100644 --- a/include/linux/page_idle.h +++ b/include/linux/page_idle.h @@ -13,7 +13,7 @@ * If there is not enough space to store Idle and Young bits in page flags, use * page ext flags instead. */ -static inline bool folio_test_young(struct folio *folio) +static inline bool folio_test_young(const struct folio *folio) { struct page_ext *page_ext = page_ext_get(&folio->page); bool page_young; @@ -52,7 +52,7 @@ static inline bool folio_test_clear_young(struct folio *folio) return page_young; } -static inline bool folio_test_idle(struct folio *folio) +static inline bool folio_test_idle(const struct folio *folio) { struct page_ext *page_ext = page_ext_get(&folio->page); bool page_idle; @@ -60,7 +60,7 @@ static inline bool folio_test_idle(struct folio *folio) if (unlikely(!page_ext)) return false; - page_idle = test_bit(PAGE_EXT_IDLE, &page_ext->flags); + page_idle = test_bit(PAGE_EXT_IDLE, &page_ext->flags); page_ext_put(page_ext); return page_idle; @@ -91,7 +91,7 @@ static inline void folio_clear_idle(struct folio *folio) #else /* !CONFIG_PAGE_IDLE_FLAG */ -static inline bool folio_test_young(struct folio *folio) +static inline bool folio_test_young(const struct folio *folio) { return false; } @@ -105,7 +105,7 @@ static inline bool folio_test_clear_young(struct folio *folio) return false; } -static inline bool folio_test_idle(struct folio *folio) +static inline bool folio_test_idle(const struct folio *folio) { return false; }