From patchwork Fri May 24 18:18:10 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: 13673439 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 93F02C25B74 for ; Fri, 24 May 2024 18:18:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26C256B0083; Fri, 24 May 2024 14:18:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21C6F6B0088; Fri, 24 May 2024 14:18:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E4E06B0095; Fri, 24 May 2024 14:18:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E4BF96B0083 for ; Fri, 24 May 2024 14:18:22 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8E2E1120A94 for ; Fri, 24 May 2024 18:18:22 +0000 (UTC) X-FDA: 82154099244.06.F30C823 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 8A63040005 for ; Fri, 24 May 2024 18:18:19 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=SUJxLaaR; 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=1716574700; 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:references:dkim-signature; bh=ygUGtOrzDXJ/Rd/U9tyuehHtPZgXxPfY3bzAvySpgbw=; b=AKFWAbDw6zCxFTnaQgBn4qjt2gOBYJmHU7r8kRzghfZo5rb653Mnc08dmAwN5EldZsDtja AciCh+D8MtaQ1L1ieoFNdtpFVmgHr+pkTD1ai8EzMtYw4pnmTqF+GqYk1pHX1x4T71nKDV O0AtaNgqXp6Np/JziWWDc220twvB23o= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=SUJxLaaR; 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=1716574700; a=rsa-sha256; cv=none; b=prigEIy7Q+nYfM7abOdypSE+qkJjIsDZbbNpzFxdtZEopbrx2wE0sUpE8z+CJZdrvadN+R 2/bCH5g7Vm7XnpFQgH1dPHET5QuvewzyB1anPg61aN8qmFbQXCGapA19BvPlVCPAgT6ezQ D2MVyWPKh64nT/auE8YkSt/BQXMJOGI= 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: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=ygUGtOrzDXJ/Rd/U9tyuehHtPZgXxPfY3bzAvySpgbw=; b=SUJxLaaRyUfegf5DNTM/7MwmVL cwCtOsRVnql7wcHKxa5CnvE6U2QLu/Eqts1T/V4Io56gIaiNyG9Mw1TUaU2UFLFHlpEmyh3cdb6CD 7izK8b/k09jK8XcQRG5pzeUB7Wg+Q5YkuClFcS1nyAH3hOAudtbDLx7XDqn6Xt5IxOuX0apCbtw/j Tq5hQLCyzcak7G0wFn7Kr8G9l16FU4rt2kJRbVMTY3bRa/qnmPBuWZbF94aRM7UVXtzmRz24rDnMV vQmYNtGZwBHg/UBW1kPTr7GDBcjkbAzXhMlbeDV7zklNyrIZNl1fQ56UUVX243jET34aDCufB8jRC 619XJyBQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZUc-00000002vnQ-20FS; Fri, 24 May 2024 18:18:14 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, David Hildenbrand , Eric Biggers , Sidhartha Kumar Subject: [PATCH] mm: remove page_mapping() Date: Fri, 24 May 2024 19:18:10 +0100 Message-ID: <20240524181813.698813-1-willy@infradead.org> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 8A63040005 X-Stat-Signature: 6i1r9e9sqe5tr5b51bd3gpch9ztuphs9 X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1716574699-855236 X-HE-Meta: U2FsdGVkX1+MPkwKQgX+TaSm3dGivL5C6CfTmxQ1z3HJQptet5xCmBwppXMgLT03WuWSM3Ihgb4tF7Rn8IsJ0BUoytxXGTanohcBUR1YFXZlQJqixmhrWUxT60TWZ8nXLcbXBp59N+R7dUzXXBL4vIUCfSM46V8oWUlxch3QsepA8davnBjtnKMbax5/wBFykMVXQQDIACVrBT9zMzwvxq0muxNH/oAx1yW2t+JGLdMzFVYgRBwBbVR6AkQv17/85QQ/NAuDB+jTBUPUjjpKasMVGrmarSG8bjWth6E5Xc9nXFfzQzni3UD1U/62tTr42BhLc5tUhVjeOFVefdbCuGKkjXha1NJuPYO2CGQZyci6CvnfyGUx2xCJjELEKcnCnLygvBkmNAX/xoIzkCeznzB2APam6rIpSax3Pc/MDmdBIVDDtN0Y6ffVuF6vtDToVpsoZpoXZlYXaFUed6+rUYd4ohhV7zRe3gw7rbYbi4J/DUWMfODonjMm4nBe3HgwxsB3mQRG3kkWCHLFiiJ7DLyLmlm6RI3b7gpVv1dRRjiLzdzVc4G8G+kHIK7blZdK704fdxDw6l7TLZ0pt+7QcXsZPvhxiJ1VKxkdfHn8h3aAfDJhf+z1yPXhV8n9+Qu3Xz4f2hVloTK9saH72BfVjQWWPBEWa1e2qMF8qXWDDXn0tuwoTh/9EMsh6Luo52Zi9Cj/IUbygaLsfKgSqumE0ZFTZQplRtqtoZoov1HdCR48/I8AZs9mRusJ4bJRNmDb6CYkQvVfTnzWy+eSkl3dmpxCawzlKcJnIbBwz0dFOWGxxK32UmZ4ZF08QvuBQkIpW2QjrlFW6kksUuDAPBnCxz6gZWkJB62KJWSbTHJ4+yvuZN92vhFLbiZ0QkooFRL1sckWutsWW9+QE0pZ3X8CJb6hejPl6lcucBqe9ugqcQn6RVHtB6+lMH8J3+9f3NuETPeZXyPVj3/7chq3ihl xhOzSx7s JVwxkUIo24662SVa4frXsjFDad1w2awWLP08kiodX/SYN0eIanjO5J+xl/KLBYNdB11DMOayuRW+igiXS5ks4J77EfXv9bl+mjaGDvoMQO2RkCarNSw2KIvVZFu6XIORM6Q+ONo99RZhGO/jCxB1+A3q9rCNwIpgBMvw0rYxcL+Xv2dc0z0G29zNEpYZd60SgE3L+GRMQnUMbX586D2OsM93PGcpcP/l9SaRNXWUpywzq8SWDWr8NEXjWo8L1Ec0Yvj0abzDMn6ypa48XHpHglToqsgjK2N0dxLvMF7MNbSaCIO3WKACl1K4WiXKsyWL4cXB2rBo+etjo/kDFvkDAZ280n3XeyIO7I9n1 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 are now converted, delete this compatibility wrapper. Also fix up some comments which referred to page_mapping. Link: https://lkml.kernel.org/r/20240423225552.4113447-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Cc: Eric Biggers Cc: Sidhartha Kumar --- arch/arm/include/asm/cacheflush.h | 2 +- arch/arm64/include/asm/cacheflush.h | 2 +- arch/mips/mm/cache.c | 2 +- arch/sparc/mm/init_64.c | 2 +- include/linux/buffer_head.h | 2 +- include/linux/page-flags.h | 23 ++++++++++++----------- include/linux/pagemap.h | 1 - mm/folio-compat.c | 6 ------ 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index 1075534b0a2e..8ed8b9a24efe 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h @@ -283,7 +283,7 @@ void flush_cache_pages(struct vm_area_struct *vma, unsigned long user_addr, * flush_dcache_page is used when the kernel has written to the page * cache page at virtual address page->virtual. * - * If this page isn't mapped (ie, page_mapping == NULL), or it might + * If this page isn't mapped (ie, folio_mapping == NULL), or it might * have userspace mappings, then we _must_ always clean + invalidate * the dcache entries associated with the kernel mapping. * diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h index fefac75fa009..28ab96e808ef 100644 --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h @@ -117,7 +117,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *, * flush_dcache_folio is used when the kernel has written to the page * cache page at virtual address page->virtual. * - * If this page isn't mapped (ie, page_mapping == NULL), or it might + * If this page isn't mapped (ie, folio_mapping == NULL), or it might * have userspace mappings, then we _must_ always clean + invalidate * the dcache entries associated with the kernel mapping. * diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index df1ced4fc3b5..bf9a37c60e9f 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -112,7 +112,7 @@ void __flush_dcache_pages(struct page *page, unsigned int nr) } /* - * We could delay the flush for the !page_mapping case too. But that + * We could delay the flush for the !folio_mapping case too. But that * case is for exec env/arg pages and those are %99 certainly going to * get faulted into the tlb (and thus flushed) anyways. */ diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 00b247d924a9..53d7cb5bbffe 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -490,7 +490,7 @@ void flush_dcache_folio(struct folio *folio) } set_dcache_dirty(folio, this_cpu); } else { - /* We could delay the flush for the !page_mapping + /* We could delay the flush for the !folio_mapping * case too. But that case is for exec env/arg * pages and those are %99 certainly going to get * faulted into the tlb (and thus flushed) anyways. diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index e022e40b099e..14acf1bbe0ce 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -53,7 +53,7 @@ typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); * filesystem and block layers. Nowadays the basic I/O unit * is the bio, and buffer_heads are used for extracting block * mappings (via a get_block_t call), for tracking state within - * a page (via a page_mapping) and for wrapping bio submission + * a folio (via a folio_mapping) and for wrapping bio submission * for backward compatibility reasons (e.g. submit_bh). */ struct buffer_head { diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 104078afe0b1..d1bdbaaccc96 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -655,27 +655,28 @@ PAGEFLAG_FALSE(VmemmapSelfHosted, vmemmap_self_hosted) #endif /* - * On an anonymous page mapped into a user virtual memory area, - * page->mapping points to its anon_vma, not to a struct address_space; + * On an anonymous folio mapped into a user virtual memory area, + * folio->mapping points to its anon_vma, not to a struct address_space; * with the PAGE_MAPPING_ANON bit set to distinguish it. See rmap.h. * * On an anonymous page in a VM_MERGEABLE area, if CONFIG_KSM is enabled, * the PAGE_MAPPING_MOVABLE bit may be set along with the PAGE_MAPPING_ANON - * bit; and then page->mapping points, not to an anon_vma, but to a private + * bit; and then folio->mapping points, not to an anon_vma, but to a private * structure which KSM associates with that merged page. See ksm.h. * * PAGE_MAPPING_KSM without PAGE_MAPPING_ANON is used for non-lru movable - * page and then page->mapping points to a struct movable_operations. + * page and then folio->mapping points to a struct movable_operations. * - * Please note that, confusingly, "page_mapping" refers to the inode - * address_space which maps the page from disk; whereas "page_mapped" - * refers to user virtual address space into which the page is mapped. + * Please note that, confusingly, "folio_mapping" refers to the inode + * address_space which maps the folio from disk; whereas "folio_mapped" + * refers to user virtual address space into which the folio is mapped. * * For slab pages, since slab reuses the bits in struct page to store its - * internal states, the page->mapping does not exist as such, nor do these - * flags below. So in order to avoid testing non-existent bits, please - * make sure that PageSlab(page) actually evaluates to false before calling - * the following functions (e.g., PageAnon). See mm/slab.h. + * internal states, the folio->mapping does not exist as such, nor do + * these flags below. So in order to avoid testing non-existent bits, + * please make sure that folio_test_slab(folio) actually evaluates to + * false before calling the following functions (e.g., folio_test_anon). + * See mm/slab.h. */ #define PAGE_MAPPING_ANON 0x1 #define PAGE_MAPPING_MOVABLE 0x2 diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 3d69589c00a4..e8ac3b910746 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -401,7 +401,6 @@ static inline void filemap_nr_thps_dec(struct address_space *mapping) #endif } -struct address_space *page_mapping(struct page *); struct address_space *folio_mapping(struct folio *); struct address_space *swapcache_mapping(struct folio *); diff --git a/mm/folio-compat.c b/mm/folio-compat.c index f31e0ce65b11..f05906006b3c 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -10,12 +10,6 @@ #include #include "internal.h" -struct address_space *page_mapping(struct page *page) -{ - return folio_mapping(page_folio(page)); -} -EXPORT_SYMBOL(page_mapping); - void unlock_page(struct page *page) { return folio_unlock(page_folio(page));