From patchwork Wed Apr 2 21:06:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036489 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 57207C3601E for ; Wed, 2 Apr 2025 21:06:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C6A72280009; Wed, 2 Apr 2025 17:06:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C1AA5280003; Wed, 2 Apr 2025 17:06:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A6AA5280009; Wed, 2 Apr 2025 17:06:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8B717280003 for ; Wed, 2 Apr 2025 17:06:25 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E85221206BD for ; Wed, 2 Apr 2025 21:06:26 +0000 (UTC) X-FDA: 83290337172.23.18BB64C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 5C53640007 for ; Wed, 2 Apr 2025 21:06:25 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lcElZ+Id; dmarc=none; spf=none (imf04.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=1743627985; a=rsa-sha256; cv=none; b=EcDCEvq6hsSom+5B48vKi1q5SImXOMBCVSFVxSLvg+dCq2HuSC7nzSAgCNjNiBn/WU7rau UXBVsHMFKMIoEtJ3CuD8L90wZzcMxbxYisRYy25heTd2suYfJCRjeUKQzVEXQa05Loect+ 8HPkAFuL75yWARxlbfeFjADjxRW0UtQ= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lcElZ+Id; dmarc=none; spf=none (imf04.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=1743627985; 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=ry/obuxLxTCzbCNXr6YZ9DzG0ANUHcRWWnA+CyLV1DU=; b=J76rC6MMSgWLVJnDKzDec3ex5+oLyK6wuid0+hAIWhg0N6bWxG/sqnc6rum3MGMW2ONL7D CID6yiJU6Rg9sd2mrGVAwtHnRVrMH8Snx7c5ucNuv0AaJxt9Mdi+JLbnd2lxs6R36KZHh+ p8w+LZdw966JFbArpYlXTgZlk7XK1mk= 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=ry/obuxLxTCzbCNXr6YZ9DzG0ANUHcRWWnA+CyLV1DU=; b=lcElZ+IdahLQIKtyF8KzPMU59L NT4X71vpSJPq10zxoouw8+d5CKya02jKShsS5nhZ69fPrUt6xX3V4/nX7P2tL2VnWLQv3f1vnWlGq ImaB5sZcdIM/K5lkGCw+2VF10f4XvuQnzUX0jRrJFWeZKD+5fOL93C0+h67BCsdHn6oVeVNBlGII7 IlTD/jKU9oKwrToM1DeNS18ek7GN49PUL0RuZsUCDXFBL8le8RkshsrNBe+WMC58r4RZqUoKbAYxo 6jFOU/4jwp+DbU2++Na6cQuEu/3VOX7qvW9cKFtapVJzHEJ4ehKqYdttzAg6NqFAxMYez3MJINy0r QWP9N8LQ==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hq-0000000AFqM-3I8S; Wed, 02 Apr 2025 21:06:14 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/8] filemap: Remove readahead_page() Date: Wed, 2 Apr 2025 22:06:03 +0100 Message-ID: <20250402210612.2444135-2-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 5C53640007 X-Stat-Signature: fdbn8rbfsazegdasrqc3bfk4z4swzdad X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1743627985-58405 X-HE-Meta: U2FsdGVkX1+w/VZlSh36bWlNrgMNpVs/TcRBhLfETeaoFsUNDivW224/Kxq+fk3n7wdFvVdwP878JVROG95ahLsL0LMY2FlUigCvL0zbN6Gg0rVjpxM2g1C+3OxhWfxhoU50s6yn+EA/gKw2cShl85g5fN5j05Ei6GPV/Mavjzv72Osfk48o5PbPOTWDpemAnD8WRXcGz7XKUQDthpEmj6GRGd/mn71NStLl0cklFyNzpEWxUEz2Z6EqXyqOzKqw640maNfsOOJTyGZkOmPoG5tKp8izHD5JcR/oEfjnmC4UXbSY92wpelgxMe1+ihXwAM1FYD+ZH+76wEaNTbxofqHEloEAQZUbWtM5Hu/0YBq5t3X7vTiudMA3O86PU/Pe07aigsR5WyLNqaMGxo/x1I4gZFlBv7QLjCQNl7FgXGUyfQkddKas0G77TwScs5za8fvzwOQDmpIjZjWYo4YXNkvXsKOu90OcPioFtDNKXQrEG2x8zZzbbVD+MwvRiJHTvQYKk+0H+jUtahzK3RQLniBTH+tACVkiIej1XYcKpWdzcC8I19XDEyRR1a/9YvuylfcV2RIR3GL225+SIDtakcXHgRrT9aQDMgiy430vYKEjmtCS9iTC0rkl0NlJkQf1OXD+3X8Au4HMNsfEDdzoNDk9NcG5lvW3LRcyxjzSkTXE3dum0KRrIIywzKZzEUm9JcNsHOJ8IuchRXehqR5bwTGorkBBlfFnB5yVfJsiBfRfO+8zBSwWme4bwba++44spBrvUYvJYx/A5/BVekWVlW8Q8DE4jiC9j+0+HlNDkr/2A/95XhJv5i+4fy9ODqFSn+8GWR+6oWcv1VU6UxWuKZVgYzERGB1FVcvPw3uL/nqswTBBPYvkiSXTavwFtlWsyx6qWrtz3ecFOAOseKfkIPf8zoIO+XFNZ8LwlXVTQy43NtPwyk5Zar0WQOy2xQ0RQtk43PIZXSYtGjozcir jxJ3iRY0 0OabsF2oBmmG5OwZngJIhXEGH4oChIMSuCVgdpGI20Eo9lyL9Ga8Ks23gI1kaqr/QtseP3NPkliIve5jA1MLz6GCLCGFhaEmgxNkHGZaOOlms4Exj26B9MPhzTgtICvLb6OpDJc+0bi+HxADRNozFEa12MXTLa1SLWQRyagrughMH1xO3aA15oiyQSLpAsdp2NFMaUfuNRiDeuFVpkCHIL7U68uYKd7spCgUxrNN2FxXe8s/kLlMDQzJk5XykeoF4gUtWgc6NgTZ6mFFFuJcPwb0bNGmTjObjBsKX 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: All filesystems have now been converted to call readahead_folio() so we can delete this wrapper. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 26baa78f1ca7..cd4bd0f8e5f6 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1308,9 +1308,9 @@ static inline bool filemap_range_needs_writeback(struct address_space *mapping, * struct readahead_control - Describes a readahead request. * * A readahead request is for consecutive pages. Filesystems which - * implement the ->readahead method should call readahead_page() or - * readahead_page_batch() in a loop and attempt to start I/O against - * each page in the request. + * implement the ->readahead method should call readahead_folio() or + * __readahead_batch() in a loop and attempt to start reads into each + * folio in the request. * * Most of the fields in this struct are private and should be accessed * by the functions below. @@ -1415,22 +1415,6 @@ static inline struct folio *__readahead_folio(struct readahead_control *ractl) return folio; } -/** - * readahead_page - Get the next page to read. - * @ractl: The current readahead request. - * - * Context: The page is locked and has an elevated refcount. The caller - * should decreases the refcount once the page has been submitted for I/O - * and unlock the page once all I/O to that page has completed. - * Return: A pointer to the next page, or %NULL if we are done. - */ -static inline struct page *readahead_page(struct readahead_control *ractl) -{ - struct folio *folio = __readahead_folio(ractl); - - return &folio->page; -} - /** * readahead_folio - Get the next folio to read. * @ractl: The current readahead request. From patchwork Wed Apr 2 21:06:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036491 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 5DD3FC36018 for ; Wed, 2 Apr 2025 21:06:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB78B28000B; Wed, 2 Apr 2025 17:06:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D42D8280003; Wed, 2 Apr 2025 17:06:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE20A28000B; Wed, 2 Apr 2025 17:06:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9CBD2280003 for ; Wed, 2 Apr 2025 17:06:34 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id F2E141C7D7D for ; Wed, 2 Apr 2025 21:06:35 +0000 (UTC) X-FDA: 83290337550.30.C562A61 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 54A3314000B for ; Wed, 2 Apr 2025 21:06:34 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p++baYfz; dmarc=none; spf=none (imf26.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=1743627994; 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=UL11Ny1HswpINtl0BZS325Krjlkrbh6vmj2yMHlUsgw=; b=GrYvN9CTpQsuJoyNhvqQS9btoIS5/r/6TnX5KRwLSjB5b5ouZsxs3fUnp+nCVyH5NlNjXV 1OUhSk8y7IV3CYSqsXHy0AS2Wtc2LdGnE9dsw1crKPww0s0zdSIC60bbiZLpRYq+WYiWXO Uf7FCnji+/98WdwrFkJMui8VOVPArmc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743627994; a=rsa-sha256; cv=none; b=MPukS5PLsESsE5tZ2n+0OXnMDObvtZQme+PEubt6QhkECLN2mJl+HgH6OV6sqprjHgZwuj ehYL/fhcR66yZZJCs8yCX3y9expik4JggTz45ftxT4FntVcCgEF0fxzOvph6sk6Q+c97UK oTjjvbAyEKwKWBBN73vpqKOfzLjVSS0= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p++baYfz; dmarc=none; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org 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=UL11Ny1HswpINtl0BZS325Krjlkrbh6vmj2yMHlUsgw=; b=p++baYfz9Bv+Q0RIgPo9kTFmHb 8vrNlEwLKYQangSwCJlWtjtfrT1AIDQf00Uyzf9pPhrb0e5O7++HaAWwxv1fK0zt1lHqU1RQEFGJA /AUB3y9q2bqukF63UezfCw6z5Ivhy59ckoIG0x/Qc3LfAygilO8eY5UUQLJ4a5R1iDxNfuHtD0H9n 49KmZbJDtJIdItnVZ8DDkloo4xQflOb3CQ+kprxRgHLu/KX0i7HJHSWoodsdaIC+dzWJBEgJADkas NkDjlalVz6SL4ZdkDApyZCcTu16hay92qCkAJsVFTQpRpaAIM4xDITdyePk53cOFydxBIMfcw6+Lr MAu7tkUg==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hq-0000000AFqO-3dXI; Wed, 02 Apr 2025 21:06:14 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/8] mm: Remove offset_in_thp() Date: Wed, 2 Apr 2025 22:06:04 +0100 Message-ID: <20250402210612.2444135-3-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 54A3314000B X-Stat-Signature: wo8uiw3wxw7e9hjrugwojzde7yxug481 X-Rspam-User: X-HE-Tag: 1743627994-579315 X-HE-Meta: U2FsdGVkX18XsI2Lp6e3ZigZvywAUOkrhIEnAoIAGm3kcnqQIDymS9Mqno0dNqo3XF4ZpdrkLIPfeham0SPylmCuepDAkaIrE+EXvhsExzeSqKdLSQNqc7LtIfXZGd8Vs1+RoNlIEcxpqPoDqV02VidabYCayh+C1HKQsCGZ9gifChejHecnEsG6JUinyirukKTnf2rujGqPHfQ6W2A9zuw3wC07SdjhjDBskQEcWKMQRMOzSiGHMZbgUwyKCXDEPbk/3Bok2K5BAxdPVIjXeZBPXUKFFIntmQXF/YuVEpcRc+oLxMydU1GF6M/LlmAt3YA/EbGTPVHFlrvk6P9wRaZzc16xvMMzeoOIhz39wOjaiH4EwW1hLCXVkCTowb10L+dT3m1FxzrjgpeFBgw7Coa+B/vPJkf0NfL1YwYEpfnxsi7JW/CtW80iuNvqKKB8tx+SX/nGt3oF0P0YuAQ1ecBcQa8PnVUDb5wHTeKq9ECO+qCoLUH9dgkmKPNAgLVm14i3lmz7jJiQVRMkO4/ITfOSOAOiiAQWTlWiy5y+GiZ+5ptbJlMTwLcrIBy2XoFWNCxhC6SeJmftv0mpP1c3XkbHK+GfzYop8FUDH6TcD08Iv46J2jcHNrdjYZ1PMpldQGNdoYsapZmDKgoT3DEJRRAYVgkBXSHwNlKxgYvkfgMpZwVBqJIfSvTmjtK0HvbXkISBnnz5HpFnob+zdpSkJkqn/2gC7tmngsd5pxDJ//orq/RqLIFYG4J1i+MBqjwIQzirJ9wqQONcIZ9GMfk1dn7ND+j8Uhq81LatrlXfvRtd2EUeTdWDqsrHsL5mgXzNCSWRdYmWSGt12XNbKoCMlW5HTdFxfdy+5tf38K1oKIe5J9Uh8sQgzDMIwxRxHyTh0tFCrcjjgTp2JaaJm1lI+bcapceeOJNCLAxe/0B0GqrjJPfTDne+CQXEV/NDF28tpaZTEK1Hfo33WM/sSRP 0A/YUjao PBxduJBOoH8TzrHRGy9XN3a8e16kiHa5cthFAUOV1EeoOnjSF6bjqV/sDb+UNLmoXsc43DkZdxjvzikJsD0fhhQ1FhKurnJ+j7eBpUmcj4uPuRRhxlvQ1gC26Y3hl6YcQU0WxpkDavZMJP/ISbV9odzBXSXKNJ56XWV/nFKorcU6EXtYv1IqEz6xBV6Dud+OJDXzc95E2KltuWEh0lH/BuIfVnJ8lxLreW6N8UcQywR/2J1hMC40I322LYm9KPLhS4fF5GARoQR5RsFXU/wfTAXGAnr7JGrQ211Id 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: All callers have been converted to call offset_in_folio(). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index d910b6ffcbed..99e9addec5cf 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2428,7 +2428,6 @@ static inline void clear_page_pfmemalloc(struct page *page) extern void pagefault_out_of_memory(void); #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) -#define offset_in_thp(page, p) ((unsigned long)(p) & (thp_size(page) - 1)) #define offset_in_folio(folio, p) ((unsigned long)(p) & (folio_size(folio) - 1)) /* From patchwork Wed Apr 2 21:06:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036483 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 03696C36018 for ; Wed, 2 Apr 2025 21:06:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ACFDD280006; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A569E280001; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91D0E280005; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) 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 7141D280003 for ; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9ACBD477E1 for ; Wed, 2 Apr 2025 21:06:18 +0000 (UTC) X-FDA: 83290336836.22.168BF86 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id C02371C0008 for ; Wed, 2 Apr 2025 21:06:16 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=raE6Hpsr; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743627977; 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=pe0Pjjm6xDZZPKUtc3KMY1jXMbHe2FmknyFtlN8EIWI=; b=kbGMBbeqdkv4yXS5qFD2H014laE1qLLBHjc7pPploFIquXH7IFdbglHlmOjTFtAg/8dtZn sp4DZDzLEUNbw99my5jnLHc58KqPUVMu1gR7i+vWm5Pjh/2tbD/b2LcMxKEiXXuBjety25 JTLILLX/ld3luQ+TRRy/EaghqMjknIg= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=raE6Hpsr; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743627977; a=rsa-sha256; cv=none; b=dqeFOGKWRfzY0e00mDF++4gJ5eZWwitiuecmKv9rhupVaF0YHWFWqIgkPzsLyuiOBO+R45 uKHvRuJ8HVVSvKsJgFV6MlA2b5RFA78qill7kRv9cb8olSRB1Cmkkiv4Ozk5vLI9pugcME xxRH/T6iVHsMkpry/jLJ1XOBDDOOtPY= 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=pe0Pjjm6xDZZPKUtc3KMY1jXMbHe2FmknyFtlN8EIWI=; b=raE6HpsrueXDb9uqvPB13rISbE KJAnPg1e81yzYuuxSGT+g7ro58lEysOfYQPl+VoCHzDhvYglzXvH/MlolRyXNbvbwcxMwJgsKbALl Wb/hP2jxBEYndgJDgEwGKcs4BtDIwYh0zyO/UbcpFRf/W0crLPKqh+KZ6W+eam+JNTUFQ821m/vZQ 9ex28ont48t2jNgurc4aA59N4EM8da5J6CeC3YAY5LrEgi3z3f+spwedf+WzDBOe6BduPhcW6cm8E 5NaRUc8dEg9F+aRAKBKPDVMl/y/L91BP3TuONymRuaIwr1p80Jr3k4QmDF5ttVDSuxXVQgY8QAaSH kC/JJw7A==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hq-0000000AFqQ-410d; Wed, 02 Apr 2025 21:06:14 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 3/8] iov_iter: Convert iter_xarray_populate_pages() to use folios Date: Wed, 2 Apr 2025 22:06:05 +0100 Message-ID: <20250402210612.2444135-4-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: C02371C0008 X-Stat-Signature: yoyw9o1tpk3nbfyay4yq91sk94ibetzi X-HE-Tag: 1743627976-140278 X-HE-Meta: U2FsdGVkX181HH5z0g8830sRi/JM4aNd91QN96e2WQemFJpTTvZ6tH/Imj978NlY4PrXJM2foOICyPv7RdAWfG25hViDpMvHSrECCnbkAQp/wXTuXKE506gBGpvFpQRKpXBPmWrWLoR2oxBK6J5OvNireyRw8DjO2DD7Mex/orHfKsL+znfPdQ7RQ7tlkXCwtqDZsGoCdqvBApRtaflft0reMsPdQLRpK2xbPgW6Gqfa8SoqcNYIRdc86F2+xpd6YjCa+kvTaLAussdnpD2NnIAxiecr+ccB0zMCH/3k+RGyFYF0BDUGiwaqFM2XAzixemdtwXvZlmUrzcIm/WRCMgnAOjhN6CkIUA1BtJdD1H1KiXFh9/bvIQ4dwTdqLLmTkej5mmzLnpOCdipl1hAOvXWtkfs2fzBvyChXtsvG2EaxxRrSesHT4Wah84+yjgTfGRn0jqGrcaALP3XY0NybwfmLDD0DiROxwrMzTqh56mwbItY6MwhnjkswvFIpaBhxiQsdEp35uhWkpqBklQTOIKKiS5eSg/hllEeUaDguwpSDZ7In3RO1/rJz5+dqwAQSkFATLsag/M9PXyro/ilx6Y9abvBBL3gEGS1O6siapAzac9ArR2yfmjy3qygLIzV4kxYy7kzyGr7zEmzk67Z6iOW2B3ZjBiwUrI+qhrCXgQTw58HiMDxVi01I6qT0WvoshD4SyJ/f075HqhrGvfobVRxD0q3jLYuRH7fcuFCFvGNxJrtcfwQOPTX7dIUozHlIH6EdNtDo1yVjZFIPwQPhdPvnwRNOSFYdoMoUIEYud9s527KClJMmVH51qNDu9T3pjpMcrOgRXpka2ST6d25xTq8p3wc5yblXwxp2gcseLCYXgBYOJoB51N5O6BV/TiJGJiVLwiy7QfYQpzPOoFHK1LRxPD55+sXrUAxfw50EGMZYUXQF2TaglmNA1Om2jLHyKLecOO+qV6KRIxLONSu XenPwtHX IFFfgRKaSbW8fpt3qLWsGbr5yy+ic0hZFj+O//02zpO/Gi7raDNOg9M+UytYjCgZk9iptxY0vfRUWx5wIbPgU9G60hectIjB3SBlO4WUFn2vHiVYO5xOHr0co/pXjqkdWMn+Eqq601FIAiJSa16Y5chIyLBzUzq3N8af0kjqFxPxjE4n86hA602VFH9i8Gvps9d8woPJ7bbIAFmhqg6eCSO0BTyA2vo/o12K51fNlOk0Kv6+vR+nUYDy+qDWwbTMSnJl2d/8zXVIjwF5gxT3c0edMjkNc7UInppUt 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: ITER_XARRAY is exclusively used with xarrays that contain folios, not pages, so extract folio pointers from it, not page pointers. Removes a hidden call to compound_head() and a use of find_subpage(). Signed-off-by: Matthew Wilcox (Oracle) --- lib/iov_iter.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 8c7fdb7d8c8f..7c50691fc5bb 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -1059,22 +1059,22 @@ static ssize_t iter_xarray_populate_pages(struct page **pages, struct xarray *xa pgoff_t index, unsigned int nr_pages) { XA_STATE(xas, xa, index); - struct page *page; + struct folio *folio; unsigned int ret = 0; rcu_read_lock(); - for (page = xas_load(&xas); page; page = xas_next(&xas)) { - if (xas_retry(&xas, page)) + for (folio = xas_load(&xas); folio; folio = xas_next(&xas)) { + if (xas_retry(&xas, folio)) continue; - /* Has the page moved or been split? */ - if (unlikely(page != xas_reload(&xas))) { + /* Has the folio moved or been split? */ + if (unlikely(folio != xas_reload(&xas))) { xas_reset(&xas); continue; } - pages[ret] = find_subpage(page, xas.xa_index); - get_page(pages[ret]); + pages[ret] = folio_file_page(folio, xas.xa_index); + folio_get(folio); if (++ret == nr_pages) break; } From patchwork Wed Apr 2 21:06:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036487 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 67FB3C3601B for ; Wed, 2 Apr 2025 21:06:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BA9C280007; Wed, 2 Apr 2025 17:06:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6407B280003; Wed, 2 Apr 2025 17:06:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A6DA280007; Wed, 2 Apr 2025 17:06:20 -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 16C44280003 for ; Wed, 2 Apr 2025 17:06:20 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4B8681407BF for ; Wed, 2 Apr 2025 21:06:21 +0000 (UTC) X-FDA: 83290336962.14.99F9B2F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id A732B4000F for ; Wed, 2 Apr 2025 21:06:19 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=S1WB6wUv; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743627979; 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=m4T5LNp9+vduHggkLGzj9TeayJ79kOVaHGxfjN+fZbw=; b=bm7qqD2lCjrg78CAwVKetHBFzi2XzxoiXiywNWC+ja3GgDXzw8fT8WN4dtrM9+ViEyQT7+ DpOzMLdO4IesErVbFLcZocTusIaQKDqYuszuCUkXSwN6mbXRvmgX0XUAJMUXwBlE6VD60n b3EZ3eJShk8W0Kz3IprCv3nycyKJIyA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=S1WB6wUv; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743627979; a=rsa-sha256; cv=none; b=wMQ5DFWRareJdODIW+O3SR1poxHFEGhuR8FWzjNLpBhG6/BpPQD1AFNG3AhO7u/Q+oB40g sddrrKS83SQcwyEBpwfOd3I8wSjj+jax/w9I+g2nnZ7O9yeEjuvroPYgKjV+A7sN26kd5m rRT10cOwBIXFRequ8ZlKXTSSxfolESU= 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=m4T5LNp9+vduHggkLGzj9TeayJ79kOVaHGxfjN+fZbw=; b=S1WB6wUvfDFoIOnVbTiCIdOdS7 Z/VKJRySCxvlDmz05MAXh6BrtyZb9211AryI9i2YT3PNl2SntCgyTdEHcLDSm/JroA0MUXA7BXr4l ZZ7d3Gm+sr8FJEfGBQ2MC0msiRrfYXSChveFCLKf5Afa8As4zecAkP+QFzgkcKxVxB0a3ILm+5Z46 0ZdDelC2V+242e51pvdhrroLLjnn7QcdfxHKe/EFVVX9DivrnFsGEapB+RpeaWWilwEzzxmNDVziH Km5tMq/f6gjc8vLmofREGkNe3Hq5Lq52gVOG/XF6slxcKKL/h3JG2dNKs2sII1VpHB/sIaausyLsU pWPG06nQ==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hr-0000000AFqS-07h1; Wed, 02 Apr 2025 21:06:15 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 4/8] iov_iter: Convert iov_iter_extract_xarray_pages() to use folios Date: Wed, 2 Apr 2025 22:06:06 +0100 Message-ID: <20250402210612.2444135-5-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: A732B4000F X-Rspamd-Server: rspam05 X-Rspam-User: X-Stat-Signature: a4dyr4hq4indngpwpok3zstk8yc9bdca X-HE-Tag: 1743627979-24918 X-HE-Meta: U2FsdGVkX1+bxlwd4WfWzm0CBVYCUGnhlDbKUQCGEdNQjNCs//5U4+Ah/Kh+cEKcgNVx2AAzwd3UTDtlozpx9rcJopL+rCZwG1Zjj1oXalxAp23o8wwqwiDOrF5j2JjAVVEwJVSujqZlLCcPnS2H0EEHmb83eQMOS6puelf0jNYxZ6qk12EBa6MjuUEtpyRHSgE/F44eRV4o2sSz86fahMJKIyyzgeozqDYQyXjVFV6pA+iyPyTITEEBrhVspj+FOxl4vIQ9hU0Gr/CIn5wIQ32gAcQ7Io5qzPLjHl+a/e7XuK1+oq6BtxZGmBJAzcX+gSzKVYd5z2xDokjHgLvoj9FO1Rp+QqwxILdOoYJYYwO/EI/agKr1cjQvCFySQRSQ7VtS5HcncVsDjHpQRn5T35LFfCYFrlOrmMWql0c+XQVc6ku6QrgB+ulZI/X+2i1pYlbnjCZtWjjN9irI+PCevPZTwz+bv823pIDPQwkhXjvSo2+QRTdSVgxlEgy7DgXcElUsyzU9UKFCOmBNpqO9jd9d/dsB9TFNWRH15nJ91FaephlhzWBTVJqNSuBAT4DsBUsD2YONZJmmI5pxfYlIcABp8DCLppcawoq13n3/P6XDPK7YIvZTyH7x6IvUs7jN/SNiSQyPN0oENb/oEovdqSZp4EYGSkxhIOe4AEDdY7JOP7DkchOnBcb3W8hcEdo/M+2Gk/Pe/yaeNJdT+spYRm6rVeBSlJXU5XpebrnopRKPoXaI9cFw5Tf+xWmykL02Fu33uoTt9lRx7mOK/G0OKdO2lePDXDMN9aGQ8rTlzNqIz0/1SgE23ToAnGCmOgoZareSO4a3o1cUfNfocKDkRK2UFxfzLU/+UUn5PLeHAO1cd6WgUhp0kn/puqtlGGjVWLqWvjyhupcNiRCp2XUHggUPNeRkRi8Tf31hk3NTQHmkZ7mohOfef6moEPOBvYY7ApsfR0bbW9n3J9JyC8F Wt3KIdz1 xOJ0oMWYbfN1JRYRpRrlpjEsfDjdqfdEuwoeUgdKX5sKV+TXTJ9395FpNF3PtD9vBiXQVrNF7hobgrNOxhzh8CeSOVVj4faI6EETBvIPJHSLhpCAa4vxfNSyGRQuCVW261Ucors36ebFv5ZzdvfnK6gEKLM66zbFG+CSwaAsCw2VfcczjCDNmUTDEc3oKF5PYHfOsfvZ5pp85bxhnnrdG1xhUjQbuuR+aGTsIqM1uSpO/bvH/28HQUyO29Al0IneMAY46x3WuttjhnJv8kpet4cSA1Ef8RDHReVBU 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: ITER_XARRAY is exclusively used with xarrays that contain folios, not pages, so extract folio pointers from it, not page pointers. Removes a use of find_subpage(). Signed-off-by: Matthew Wilcox (Oracle) --- lib/iov_iter.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 7c50691fc5bb..a56bbf71a5d6 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -1650,11 +1650,11 @@ static ssize_t iov_iter_extract_xarray_pages(struct iov_iter *i, iov_iter_extraction_t extraction_flags, size_t *offset0) { - struct page *page, **p; + struct page **p; + struct folio *folio; unsigned int nr = 0, offset; loff_t pos = i->xarray_start + i->iov_offset; - pgoff_t index = pos >> PAGE_SHIFT; - XA_STATE(xas, i->xarray, index); + XA_STATE(xas, i->xarray, pos >> PAGE_SHIFT); offset = pos & ~PAGE_MASK; *offset0 = offset; @@ -1665,17 +1665,17 @@ static ssize_t iov_iter_extract_xarray_pages(struct iov_iter *i, p = *pages; rcu_read_lock(); - for (page = xas_load(&xas); page; page = xas_next(&xas)) { - if (xas_retry(&xas, page)) + for (folio = xas_load(&xas); folio; folio = xas_next(&xas)) { + if (xas_retry(&xas, folio)) continue; - /* Has the page moved or been split? */ - if (unlikely(page != xas_reload(&xas))) { + /* Has the folio moved or been split? */ + if (unlikely(folio != xas_reload(&xas))) { xas_reset(&xas); continue; } - p[nr++] = find_subpage(page, xas.xa_index); + p[nr++] = folio_file_page(folio, xas.xa_index); if (nr == maxpages) break; } From patchwork Wed Apr 2 21:06:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036488 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 CF85DC3601E for ; Wed, 2 Apr 2025 21:06:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B7A82280008; Wed, 2 Apr 2025 17:06:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99EFA280003; Wed, 2 Apr 2025 17:06:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 841B2280008; Wed, 2 Apr 2025 17:06:22 -0400 (EDT) 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 64BE6280003 for ; Wed, 2 Apr 2025 17:06:22 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D3082C0805 for ; Wed, 2 Apr 2025 21:06:23 +0000 (UTC) X-FDA: 83290337046.01.8A7CB52 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 4A05D1C000E for ; Wed, 2 Apr 2025 21:06:22 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=E2XzTSoy; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743627982; 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=9u8Vjz9C0E4LvrVZKlU/rxeiFIcc78vR/nB2GrB7LV8=; b=7C/E/qCCV2lA3B2UEZ88mKLEoYc6JAcNDVndYI+N5+osCNAh237GsyiU1EytQv8fpk7toS NN+U2iO1Vu27pbnUC8XTFaDQQP8K+sq/VdLA7Yu7C/1EOuHnigAHYnF4jZB/cBmy/9TOEN sbbXSrVrZrdvEaxjYK00QkWRS/SIvwo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743627982; a=rsa-sha256; cv=none; b=pvwMB0sJ180hUDf2TU7reY0Szdcz7ohawpGhVEmIoiryZ3C1txFRZuSRs45ojIOtVZC5hJ QIAWcmm9FQ4J99bK8KvemR17cuKADPlOmEMmSPFtWDKan7NcnTWYfStP02UNZ0BH7vCeX7 zAEguOzRXZl7F5PR+pn7Gr1KbR/HFB0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=E2XzTSoy; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=9u8Vjz9C0E4LvrVZKlU/rxeiFIcc78vR/nB2GrB7LV8=; b=E2XzTSoyxW912FP5dXOOzZxQnK mExtIKyJWSjZM0kAHZhVxiU6tOokazeU0Fe7GY2ZCRp8J0gcloVL0CXUWtcUwHS/a2dB/KpS2V5l6 gWF4ytOrvykWlTrBmqXA2YzYU2nl/Mt58FBI9TeNkn7I6jpvjYwFGvxDQNbVeVJuBLmZYT4Kctmep USgKIRGGErnVEPFqSM8fqIm1dZQYMWCtqy5Ng0YQstNSUBMsQbbHkAGdSH16g4+IkV0pO4jSLhGje BvefpRZIwGGgmBoy1av3RWCKJ8hxWI2QiyPCh2KIxF1S1MEcin/0ffQoJapCsrAZn7uT252TrDRXJ D8NixFtg==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hr-0000000AFqU-0V6p; Wed, 02 Apr 2025 21:06:15 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 5/8] filemap: Remove find_subpage() Date: Wed, 2 Apr 2025 22:06:07 +0100 Message-ID: <20250402210612.2444135-6-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 4A05D1C000E X-Stat-Signature: p56zwia7iwzyaeuhfnngqafjio5ktj65 X-HE-Tag: 1743627982-315000 X-HE-Meta: U2FsdGVkX1+XuXI1VHq6lAuFUGwl0jivyhoLcVMH+7v/RfCOoLLDETQ5V7UwboBlWTcICFee01oW9CAc41VeiB+j7IqqGlwXe9fmOh5irL9Qce/aq0Ll0GP2jsxW6oLUQzh7q0919TrxcZJoD+aCmXq92xWYzyj/66JPN2eejAHsQ9HTz5Y/GMQWZFBwTen4B29+OQq2nQdisSEKjLBet1+psl9OfvJXklvZB5/xeXif650XnzJManmOPsqMDvm9QDJi6LwdrfbzQ+hgLDj4RqS7AIsjJ/isY2LI4XuAkjRbCHOyEZrVNHbhzRSTo0dmftfXmB1kEbF8wtmMJNnyPgbcyX8XAVM4urqk/tstgxNaBGrnYgQAHn6tNXxyrwiGIm+yBaLgeDTDYK8fyElF5YfJuHDzpJKWIcxUbkLtaYfYiOPOQeRZ+1AfzsBEpFbLyqxwiWrQOmJVbPtyB+6HHpGN1dLw8sBY/T6rEacH1ZIhxlhozsO+Ezy8YY5smiw5/RSEhMbqCtB2AMWH76P+V4ZZZw2dsYdm70PEMY8Ihg9jdjS6RkbN3xVOuIGb6PhRax5kmehlZ3DyJT87qA18RySDXQEgj1g8v8yyH73mByCyrWxoSTuaBqWWPaOd9qVXvyt+UIOxniWbF/aaWsBP47SpubM+pPkade6GQwCqfyYw0mU+dXqzWDzmvTEbHFIT70ilsSAkFLlJkjssfr/gqhzWYd+gMb0GeYAoB6CmlFi6jRgWsZh4oTnVi7tEwHZ3sUwao6u4YGzpUThvnwzc/SJrGvLX/gTd29ux6pnil7SDN0tPE/heG5dSWjCLn8P9ijfP4fy//jn0VTmblf0IBLQTt0+qOK5IWL8TJ8I3pDkmcJzbX4e2YdXndiZ7bZm0BhoG1vxuyovy9J3KURPOG1vsX5/G8Ic8WIa3HrMJELyh/A8hF1hC5QvhYlOrCBF3iNejkge+IXb13qYDs8C UAPuV+Xn IUZ4+5WupdxagGQ61EZJoafaJavG6Wpm5NIK1PnW+c9ol+jzG9AW5vFNSdl7d178QBraLnbZ0Z0qfZ6cvOYGMoLtQBFXqhWJTrXWafiVumgoHsf12kaRrov6WFNqo43SVs0v7JYQ1iqno0HL3lbMG0r7iUAU6tdquGqBl11C1jAoEf7TGs5so4J0qSN1yLwTaQqWXid7eY7UMH/UZXHl4ZBaXW0VoisAUL/HdJ9oPys3/iwA1r40U/lb7bDV5Yn2LUxZrdc+JZhIIHnycKvogyuHKDIqOIztHmTxy 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: All users of this function now call folio_file_page() instead. Delete it. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index cd4bd0f8e5f6..0ddd4bd8cdf8 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -945,19 +945,6 @@ static inline bool folio_contains(struct folio *folio, pgoff_t index) return index - folio_index(folio) < folio_nr_pages(folio); } -/* - * Given the page we found in the page cache, return the page corresponding - * to this index in the file - */ -static inline struct page *find_subpage(struct page *head, pgoff_t index) -{ - /* HugeTLBfs wants the head page regardless */ - if (PageHuge(head)) - return head; - - return head + (index & (thp_nr_pages(head) - 1)); -} - unsigned filemap_get_folios(struct address_space *mapping, pgoff_t *start, pgoff_t end, struct folio_batch *fbatch); unsigned filemap_get_folios_contig(struct address_space *mapping, From patchwork Wed Apr 2 21:06:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036486 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 3C835C36018 for ; Wed, 2 Apr 2025 21:06:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4719F280005; Wed, 2 Apr 2025 17:06:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15A77280003; Wed, 2 Apr 2025 17:06:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9BBE280005; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C1E5A280003 for ; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3399A1CA109 for ; Wed, 2 Apr 2025 21:06:19 +0000 (UTC) X-FDA: 83290336878.21.ECDB07A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id 2A50B1C0004 for ; Wed, 2 Apr 2025 21:06:16 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nBSfKrRq; dmarc=none; spf=none (imf20.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=1743627977; a=rsa-sha256; cv=none; b=utKGNf6186WmEir9n0SEaHNHiti0FKEEjRZnbrH1JUgOgwLMpsQJJyOmDTrt1xQEqWTB+8 fuRIOzp3BDlxYlO3wEWrU1m8wwa1nHagoYswijzGYSNezMatnZnqd/yqd/vVhfDRoakOXE 4e0Y01nIGipeQEn+XatYVMqo+IXMxMk= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nBSfKrRq; dmarc=none; spf=none (imf20.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=1743627977; 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=aeknInBgahlhrSIfl6BQ35gr/87Ob6URDMcFA+uZRVc=; b=qJYV2+Rg7Rn6mGZDZPQkmq0rUZcqZeCTiemccLqmC5giVAtrV5XOpZ4DOyn1sp5ulwIeow PqaDoqHoQVQBMOfusFxy8qwNnoTynkHL/fHlcbv5QWMlovSHQ+MjYBsy9IZPnYrRNpAN/t jmYJSihGQl+d0jCOzDTDpXf1gK7ubV0= 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=aeknInBgahlhrSIfl6BQ35gr/87Ob6URDMcFA+uZRVc=; b=nBSfKrRqW/CJy3iB/seVe8R54U +FqjMUO1A2E5UsJHgEobOCJKv8F4ginlYFU32AmXi8dkxt8+ZAk5qVue8Po3xbpMs7I5CgTjot4ET HRFdKNOe4U6hdXq3YJV0i7kABBZ33AzFc0U3jG8OI4JpjdW6GAMP1ZSbzySZ59j2iXxTMe1NRzeT0 DvzfmWWAzubo8osUsE8Qa5ePrdQkxxW+ZcwWUWlWjQkfh8VThs1TFLgKwRRP69BuC+Fkqa5WnhN1g mKRhfj7AbphkJe1aFphKbHrpKB68GWHNXMCgU/W+LSEmJf8UEUaHfG08+C43bt7c9jeZAIPPa3WDE 6YPPBgnw==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hr-0000000AFqW-0qhe; Wed, 02 Apr 2025 21:06:15 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 6/8] filemap: Convert __readahead_batch() to use a folio Date: Wed, 2 Apr 2025 22:06:08 +0100 Message-ID: <20250402210612.2444135-7-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2A50B1C0004 X-Stat-Signature: g81s19r6qpsphh548zz3h31qipgor38q X-Rspam-User: X-HE-Tag: 1743627976-914929 X-HE-Meta: U2FsdGVkX1/jcn2Uka5xW83xztJjz4XboSJJI4ghvDoBMWF/vI/vNZQ9g6PK13D4Q+coEVl83v0ju7rojpuMLBTRzTWhAV4tFuCE0ZASPMTt3LFzJISFZ27YaR/BoAu6Gc1Jv/whr6tWRghP/fHBCUhzzvHU0BUDanPmLrty8nZM98GjD0g0eH7r6uUubmty1XiSwrE9FV3YxgRp6ImCWZFJVgiFSQUB++EP4jEzFgW2qRcK9vNk3DoXsZk1CqeP4cOmsSJSInw3yUXCiaCsaKnXXpFBda0LcjPYE2od3WRuqVga1hCFAHulWfzS2zMNYCzKMMc5Y8kekRc8hZj2iTKP38WCvxvN4kqRNFMR1zi/u5ocuMaLfbVoHQsa7BqkAuVsiC09CnFmje5SwRGZ5e6H8zTaXZ/SaAe6izQ9S55/Z9K69MBCXUBVObeFaqheI3AKtCkcM9PJNe+Y9hRlYJM+qMsMyWoPQvDAgvwq8Q05BGPiokZo1jKdvZbx1TZ8wwsRGQCQh3Eh1KR4NxGu5qGLortr0Mq+NmvVxo1Z5Jmiycn5KV53xESObBBYx3cJ8jbT/MgpfNwGCt9Grxpow3KND7Zo4SUO8INngPxfrHtUOGHPCZmJ8HEuK89u/+F1cGD41un7BqzJM0wi1gBRX/ECo8cn5N9NeQrKbK3qc5fsuHJRSL5py78ymYyYZh3vjjAabKde0fiMtiTbuOk6OZW3ORZTKiIxqmVpl5Fd18EoRE6mY6HBLfM6j2EZf6rwPlaGtivNPi9i5xpTSyhYJljCKpFqojW85xYeFVdU1EfcD26wokcFxkNdRCGazervU20CsN0eLNrhK7QPl8j5nISb4j9C1Xxj8yN7XPBf3vUDqhYi7jWHpDP6E6MtIY+vwyjvSSJuKabkVGzv89Xu54VrMvYm9j8XnpmpqdgCcONHdsvtH1pdo2bC+X8tfzrPEb/8HVjF1i2buNwarGY HUKzU0fK MCT/vKX39aNBCNyV1qxTdTPqj7F5XJtikOqaASheF9KUcEIjGd8PxnbEBoQhqHKt1kh6iSgiFvL8Pi08rsidV9otpk/9y1FZJw5ZjZWXGxAQVl9x3TNUh2Kgaao0IAULvgsL0Jhlfjp0Mg7WWhqHlwvUg8gxIFPgAfLlg/yOfq1P+tdSTj2qlp8zEoz4BLgpalhRy7tE+XSDGVkMhQiWyweDWDznPf1N3tEYlEJ/YanGhAkurOJVCVBJVyo+Eb5UIPSCpFIh0wWcwDz9LcEfGIdedkYv2SnsozLus 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: Extract folios from i_mapping, not pages. Removes a hidden call to compound_head(), a use of thp_nr_pages() and an unnecessary assertion that we didn't find a tail page in the page cache. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0ddd4bd8cdf8..c5c9b3770d75 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1424,7 +1424,7 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, { unsigned int i = 0; XA_STATE(xas, &rac->mapping->i_pages, 0); - struct page *page; + struct folio *folio; BUG_ON(rac->_batch_count > rac->_nr_pages); rac->_nr_pages -= rac->_batch_count; @@ -1433,13 +1433,12 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, xas_set(&xas, rac->_index); rcu_read_lock(); - xas_for_each(&xas, page, rac->_index + rac->_nr_pages - 1) { - if (xas_retry(&xas, page)) + xas_for_each(&xas, folio, rac->_index + rac->_nr_pages - 1) { + if (xas_retry(&xas, folio)) continue; - VM_BUG_ON_PAGE(!PageLocked(page), page); - VM_BUG_ON_PAGE(PageTail(page), page); - array[i++] = page; - rac->_batch_count += thp_nr_pages(page); + VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio); + array[i++] = folio_page(folio, 0); + rac->_batch_count += folio_nr_pages(folio); if (i == array_sz) break; } From patchwork Wed Apr 2 21:06:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036484 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 38361C3601E for ; Wed, 2 Apr 2025 21:06:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9BD5280001; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB464280004; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96BB5280003; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) 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 70763280001 for ; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9132C1607E6 for ; Wed, 2 Apr 2025 21:06:18 +0000 (UTC) X-FDA: 83290336836.24.1F9CC69 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id D2764C000E for ; Wed, 2 Apr 2025 21:06:16 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=suhrBjDL; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743627977; 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=FK4WOp5c58Z+NW1ocgPzv/oQMmQ5qTAfrmyeSlx2/M4=; b=yZn+Mhn+btAqNNuMTAXY5IfQ1ePU+R4guhUvkbPus8bfFX5Ar7OI5EBmcByJzHkrLxi/Hb CFYAcIUALjC3gcD7kyjexNrSWskWQQo+M/oqmkFc/PhN1pMQxbxqytSnNjxXgXsk8zIWJ7 o44LCKiitbfqD+3Zyt520eoYjRC/DKM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743627977; a=rsa-sha256; cv=none; b=MROWHDKEQkZDwP0Apyi8OtUfjA05qjU+AKd6/fFTOwd2ml0Nca+BglbID17QZTOm1IIDQu kL1VH4CDt1BFyzy5EZlvEayB7YVXULrZBTeLqTSyqnuiWo1iBBxCqAjoqyFtJAgtDt8BBq FMDSICXFupwYyOWygenvCY4G5Fqpo1k= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=suhrBjDL; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=FK4WOp5c58Z+NW1ocgPzv/oQMmQ5qTAfrmyeSlx2/M4=; b=suhrBjDLDbKfVT2i3Wu1H0JKrE eKEkCQRVRl0mJNXbrsfHdzRalicBbWC4MsuV6n1s6xYB52VgXHfx0kSNNqNEpDoKjj7GBAUFfHbTG czMv2i+MiYP2o0E33C+tDMxYWm4yFrjstLqzXzFLXnas/vAueK/lVYDAgWj34Mnv0Fp6zxRST9WZC LnYcQQDA/6cBiLcCdLptTlovyFQUxY9lngBUcHv+bE8Zz7OhbJDH4+cw67VdyoVvXw5FN+6cv/aRH NNoXaVorUlfkGhzlhzgPy7ESETcpmVvcgH98SOiBdYD+kQBGWaoKaYeZwIwt9TB1BGIdK3I2PIvO/ QF0xapQw==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hr-0000000AFqi-1LhK; Wed, 02 Apr 2025 21:06:15 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 7/8] filemap: Remove readahead_page_batch() Date: Wed, 2 Apr 2025 22:06:09 +0100 Message-ID: <20250402210612.2444135-8-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D2764C000E X-Stat-Signature: ad3uzuddk6jjwoofzqo6gqsuc8de8kcu X-HE-Tag: 1743627976-67144 X-HE-Meta: U2FsdGVkX19Y5W7SfuUTtb6MJcnykYMg3v9LfC/gtavrHarnnZTxMzvkjuVIJgPbDXhWwsOywhtnYL/57/5CtCDRbwHuYXmCVl2ybAYrf+bYVdfyJ8yNyhGtDa/iZDLdgEgIa3Mc7ekbRaKegg5QPMgMSrVS7zHgkqQzRLq4HipNeiTKlvfMHapA65BABNfLHGpUj0MP8u/QkIFc489mpLTb9UOYefgQontqWHqFHqb4Cz7l6ZISJf7MLDVYUtyIwyk9kzAprGKSb4YBb1szP2b0ziBTAoZLC63RX6MmxJZ8z625G5W9TxUgF0wQnVzFTUmjVEvwSMHVI9Xkkfpi8oRcUFjbMNp/nG/kzr7EbQcxflNrkpe3P2I0ZNwVqhRXCsZHOISO9saTj8Jr6znDckbgQspa+UjQIpg/Ry1weLYEvzOerHg3aw6E4CHVOTZm+uRqyOeCz833pTAjjkI3Zjpgs3gpJrWxZxvAV/oEgM9/zQF/BHcvWCzrQJFqjeKzWLhjxLGRlDATkSv4upniV5m5rEUzbZMGnkzdcqCPVJudUWGsSlNOhLSvo97n5K/eGlyjaVTiD6md46/7eSLnAtO9xF7tU0ZnrLv8vbvRC37D/uVvSh0MOykthX6IEcyytv/l1imxfu/Nw/QoczO31n0L9QPNSmow316dgFmd5euakIb8AWjnV9lxUPiZ76dFQLOcc/MnJV5jhXI4agr32DOGHoSxabnk9ZIQk0dS9sZNUtu4ulqfnvPRrwLMFnJ+GP9OcmeMHX9YwMGVM9+s5W0PCf3xlFBYFOKx5G0V0OMPKzA2mhiN8qpH6y9eqoSW2Bh3ZBRVty+/doFMMoGZNX+Tp9Lac4olqjPymGqIXP7NBiLqmGAyeldEBAFCE7Jgru8d17SXv1jhtXHYILmMeZtWdwtJ8Gnp62cWudGGIZjx2O1RdMDvTBvprqI0Ed2S/IA5ECYGFg8GaV24xic veMj/LTi yt87Znd8lmf+90DS6xwo7GYmkX+JO2IJul2WWH7b3voFi34HvM1duyd7S6xvYcvJAs5dDXehhbF9USgKl/4PhpsPkz7S5DdNevmvgiadl+Q9nuzHx5l+ioJt3S6MSfZgGhIdeKa0dHfQN14UlPj6r2FigqvkGHdianoGMr4+SWN2pmGfe3LJy9m2fQgVBoTkhzOPCdic0FYAMDmV34OgJl+XpV1GlxvAs/rkqe3aEce3Rp6+kRKurTDhDqJw0FhEmfk9V+YRnNCxka53fZuBDNJgsCSHsIxLwLAhb 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: This function has no more callers; delete it. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index c5c9b3770d75..af25fb640463 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1447,20 +1447,6 @@ static inline unsigned int __readahead_batch(struct readahead_control *rac, return i; } -/** - * readahead_page_batch - Get a batch of pages to read. - * @rac: The current readahead request. - * @array: An array of pointers to struct page. - * - * Context: The pages are locked and have an elevated refcount. The caller - * should decreases the refcount once the page has been submitted for I/O - * and unlock the page once all I/O to that page has completed. - * Return: The number of pages placed in the array. 0 indicates the request - * is complete. - */ -#define readahead_page_batch(rac, array) \ - __readahead_batch(rac, array, ARRAY_SIZE(array)) - /** * readahead_pos - The byte offset into the file of this readahead request. * @rac: The readahead request. From patchwork Wed Apr 2 21:06:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036485 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 C9421C3601E for ; Wed, 2 Apr 2025 21:06:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CD44280004; Wed, 2 Apr 2025 17:06:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CCD67280007; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACC9A280005; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 82014280004 for ; Wed, 2 Apr 2025 17:06:17 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D10BF1A0846 for ; Wed, 2 Apr 2025 21:06:18 +0000 (UTC) X-FDA: 83290336836.25.0FB50D4 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf19.hostedemail.com (Postfix) with ESMTP id 363A11A0007 for ; Wed, 2 Apr 2025 21:06:16 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=f2DK+Qms; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743627977; 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=gdGXfhvjWL/gl6s0ULg0sXpHWuECaey6MytSISUvSmU=; b=qxO/89yLBGa8AMGAsX6KJcxP8kShQPyYVuzHtG3sFi0bbKNbTDnF2mbVIuwydPY09rQR25 uO0M2faXUEsTvcnHFjSTBUTkPp7eYy+WUVYmcrxo2vvH331X1tTJQnlIDSZPmvCnMmsen4 03nEKbQIwPftjcR4Jdr5kJm0enOz2Go= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=f2DK+Qms; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743627977; a=rsa-sha256; cv=none; b=gH4iDezMPt6RfeYW9ywBEwL3XeuNBYgiUiC8Pve+gTOql4n6t5kd3Oni64omUozyEKjDi7 oXfiC9V7fXOCBGOLKgf4yvjS7iVBu1G+uxH9mRKTuzFbryA2V/DvQNr+RMKbMnLYqt/067 64nnKwiVTmjyRtvtXmw2zfdp9AKjaQw= 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=gdGXfhvjWL/gl6s0ULg0sXpHWuECaey6MytSISUvSmU=; b=f2DK+QmsfkUD/9y4y4p6uFyAwb QLKoKT75nwTlNhnRPTNi4DRKLsQoa9GtN6h3hra4F9k9HdCm1YwdBPh6yfjNF7TKxYvc6Y6v3rLss VgWtvxQcw4Tg8/JpilLjBADO2U/dDu5JhewobDEw0UQreO3z5YMvcVI5Nhg2vJYlMtIexflianipV xPZD0HM/TzY6GxJDkjlkgGGFefv9/Zx6p8etSM+UZ5hw/CkXF6nn+cYzffzwgYI5qDL3fU/wybR0O MRWnM6IHE4AoGFEejZBW//wZypeDTU3eOybS8sDyc2IeoqsgK7Ct9iiDKqsUylW7aeewwxC7epke8 x+YdsdAQ==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u05Hr-0000000AFqp-23Ip; Wed, 02 Apr 2025 21:06:15 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 8/8] mm: Delete thp_nr_pages() Date: Wed, 2 Apr 2025 22:06:10 +0100 Message-ID: <20250402210612.2444135-9-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402210612.2444135-1-willy@infradead.org> References: <20250402210612.2444135-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 363A11A0007 X-Stat-Signature: us4beq7ykmpctdfczjtusg67ee1jg7pn X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1743627976-626612 X-HE-Meta: U2FsdGVkX1/r8qfnYF9+pavYLkkgKXywZy3vZv39/QNqViS02+HILzI+9puRbebWeyg5nvtp6sjmJ6X6domborDkYDG7BCJPW1DdDtDWzdLfUpVS8qvCmyu9ZV186rQSyR3JSjIUXe09oDPQHHEmt28bto5Z2oxVw1+AZ1JTqVxIHuTHDKVfDIZOkyQSZKTy4mro1PcZypfTTXnztvfSo00D33PB56STu/ePfjzTRwKeNWGhLrfVRSklJZ9HAMtavfOkDUGq4UPq5ASVVjmxzyHjhnxoYFzPtEvzJhClc5rzoiXcVhVDVXsRulrPO6/gBGqpTHk2HxTwuhpsnJDx8AuhCqiZH2zhivaQfJ+KHqO2Xohmg/v6+0AhJT7BEqH8qHO+J0FCqFsuxTfOF9SJHaFwTGyyBRkm/LCh7sEgnaBZilJMGYiXyAXnUnZKUOn545OUUm94W2w5e2kDyFFCPehnLoQBXqVVDjHxjHjs8rQyzZ5/llH7fM7KhMx7Hj9rCyaYG5uoBBmo6bysMasV3ahT/GSU8mCSAAyz1m/JAHicvNUj2oRaqFAAm7DSpQ1OJM6AVkSW+mAyIpHrBk8aOaKhrmeh/7FnMt1w4qQRL8rsPGd5HzO3QtZG//I6ZXgU+ZmJvhNAnPZRznmmrb7m9kJYijFry8isS2Fy26nc9nfl5/JHrRcA8BYGwo4FyCx4vFPHof7Uay6rGbwWtIUfMnknFBkwmbmL+HQLJGpAThTtPmcq+dk6MxR8dxx1ZG24p+POaSNZTkYjPij9tDL2ASpJ7/hOTYPNOXsqhJvEiZmFh2g3jgzBYhLVKzcDf3Z0B2hjm3IszACTE1LM3sJXq5a9uKPn8FwWt50gctmit7vKZPJwjru4kXGZeEaIjgSePXZCL6DZgOBFg6uY7zqBypjmzYMH9zcBvqZlTrnV38l8Ti253OqjJITKZUIIQpWhPMibsvK4xJFTJlnD4V5 LgeOuSfc AY60rtZ218lcYYKeD6PFQZe9M3CghlssAFJudqfOQzNXgyyJ1DVCykNvPJ22g/WxxDJY9R5+Iydn0cM7nSdnyyPN7juUMYAmM2rZX3lPpqexp4s5tkt+rLbBU54XCF9OfYpCmqMfOXS3vgU12tR4jzWwPsYW1jOkEq8adErVwgLpjnXAq3QHsc8jGGptGzR4FUSLd35zAfS9MBGOkc3Mh6f47axWOA44o4zf9S9UWvnDnKJ6d3Sv8JHOIHWevvAP0fui4o2FhnmaTb6IYjB/g+YDMbKReeL+hrGu/ 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: All callers now use folio_nr_pages(). Delete this wrapper. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 99e9addec5cf..0481e30f563e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2206,15 +2206,6 @@ static inline long compound_nr(struct page *page) return folio_large_nr_pages(folio); } -/** - * thp_nr_pages - The number of regular pages in this huge page. - * @page: The head page of a huge page. - */ -static inline long thp_nr_pages(struct page *page) -{ - return folio_nr_pages((struct folio *)page); -} - /** * folio_next - Move to the next physical folio. * @folio: The folio we're currently operating on.