From mboxrd@z Thu Jan 1 00:00:00 1970 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 E2B8FC3DA63 for ; Tue, 23 Jul 2024 03:12:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62E646B0083; Mon, 22 Jul 2024 23:12:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DF476B0088; Mon, 22 Jul 2024 23:12:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CCC06B0089; Mon, 22 Jul 2024 23:12:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 303B56B0083 for ; Mon, 22 Jul 2024 23:12:08 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C876581C04 for ; Tue, 23 Jul 2024 03:12:07 +0000 (UTC) X-FDA: 82369543494.24.BF15680 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id A0AF480003 for ; Tue, 23 Jul 2024 03:12:05 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=M70k9AFd; spf=none (imf02.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=1721704303; a=rsa-sha256; cv=none; b=OBDiGegK64dJUxZuDVOB7eCFyd4IuiGHjl2/3l1y/O0fZ/8viQken9jrQvLrcn5CynwJZP 6iXBznoRQ8VjbjiWw5pVIQNpKppWcosklcz+03Hux7dGVu6V08yIUyjrNEtx5vBLw7+9i0 rWf3aIHSvvGcwJj/B9V3lIegjFHZ54M= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=M70k9AFd; spf=none (imf02.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=1721704303; 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-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=9+ZzNfLKx1x+E/jrJLAE81V36izhpkebUp8gJEUE2eA=; b=g7a4LEsscjmCuMfCSVgHbbVO5GOt3i0EKnhiMhVHODR9tttjHNerwy8u/PNQxiRnA19vUx 3JeUp4F3zgjB6IIvsjCzSvrKdPIXmq/cX85dJQwo2kyv9/rRbDL7yWjisbmRCDukusUb8h bPgMN1NKu28ACyDHyDGiqV7VGhWxlZo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=9+ZzNfLKx1x+E/jrJLAE81V36izhpkebUp8gJEUE2eA=; b=M70k9AFdXAIjqyFoFZ8dKa4CER 0Tu4Fjf82g0j6gzR6KhFTK3dLjXvbth5y6OGCMjndHbd+3iNTqX+CNw3v8PINiYX6FZs7lsQB9zH6 mgwatODQFBAB7glBxd6Ytj1MtieNXCYECGFn3L1peItYuDxEwS64zXr8D/Gv6qhWuJmijuoTSs3uf UdvBkB2gsFxenVGZNUq+fSSmiU7CpzYiKEnhJznCtegk4Ps+TqwlvpsVX2/Wrw9a97O+g5rfpbiGB 3iqDGx6gdJnah8LqEn6yi+K3RUu0ZJrC+eCZNPSdQESSYqGcU4nhATCei0Q/XA7BP5Vc/iolfFjEg JPfey3Ow==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sW5wX-00000006Sue-3Xpv; Tue, 23 Jul 2024 03:12:01 +0000 Date: Tue, 23 Jul 2024 04:12:01 +0100 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: State of removing page->index Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Stat-Signature: t7z84i7xc14dt1bgdn677kuuo7wkwt64 X-Rspamd-Queue-Id: A0AF480003 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1721704325-701188 X-HE-Meta: U2FsdGVkX1/GEvJSx0+Jl3WE6AWuBry4tj9hPeS8v9QoNaxs18ij7qeTDzwjD8+p5mzsCawXj6h0sKrutAexSpA5UesVIKfUmQkzvi5gWF+meFAPrtSHZo6lbPEUxSji8rru702jXI1AFBrt/V36/UIjpn9ouRFj0Bs5pN1NbogFw+ndFzIEXohDZkUQH0B17HGhtf25zdCTxQSoNTsv2kdXHqnsN1yj9a4/+vpXWVglTVOo/Kw2TpokWeHXpksxne83crAaL8J6KoZclQ2+yrthUFo5clVdZMiP4it7iHjM8f6KmGMCUlFWGBHIw8lmeAH4XttoKzUqqWCUrNSrWes8ZXR6F98m63OPX38s8a/OBWf29cBWlLzz1qwLdGgMEUMvBwsRtQDlPwSya2qnIYzsDD40sFdCXwtGPt7Xgo2f2tDwX8FJh2zjsQQBz9SuZd/uGl7Bow1Xn/mSnKh0J6JfPHGivL9AabnN0uL4oXbASUKYW3v72RzcrtiWy19gBLyDtkHmJ+JQ8gjCFOwQ7yBwAgygMfc2ZwZyg1oVQeacththwCjqIiePjuh/OlG9V6SSKDDg2w42s0BVBSPFyg+Cb35RqaAs0XFd7sMq/wWFbjPjom98WCocQgMjfIN26vks4hYrWe/MdBydXQMzOeFM7uowINbkR9SHvpTA0K9iP8hmBabu8G9wt66Xjp3DkZgjoABH+y8FsbsCFsUYI5lnbPVL4P2DUryTADMTIVcSjlK92f8WJm3SeNLZLmxVALUZNAldBw+6wrBo9Xhax1rYQZvqj9SehfPHCzTjuZM/43ILakS6O+fwj/uElk+PPOmz3umSiSyZtkVgCaELB98btB7mFP5vyCZW1oHQSPEhu7XqilFiQJmkf/fximUjuDO+qnlHPRbjNw40K+tzNKbt6n/1Gmkvq0LX5H0A50Y1ARVd4tFj9bdnrMCWROJzyrWh9T35f1xXdza5rYI 8J9miO6A bxnT21T6qazNQaPZRNgIyR1eH+PIq5ItxkM+2JbeekYneFgB8wUrM5pjJVmL/+3oDl23ogQV2XEsVNE4ybFG63ZR+lf3+ZeEPMD24RECzTYBEQMhppeUa4WvX0RAOyfbh9tF0vKdhEu7j2bCuJGLhZAQ/1OQPgpuNa8f9NtvKRwCjpmnIdNT55yOfR37jrNbSbIh0ZtFkdl5JOiqtsY8zVURHgnkg786ot8Q+oq0Y7a1AAYKTe3P2riYfqh9xnd0PaIUAki3jRAStilI= 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: My project for the next few weeks is removing page->index. The last patch in the series is mostly: +++ b/include/linux/mm_types.h @@ -103,7 +103,7 @@ struct page { /* See page-flags.h for PAGE_MAPPING_FLAGS */ struct address_space *mapping; union { - pgoff_t index; /* Our offset within map ping. */ + pgoff_t __folio_index; /* Our offset wi thin mapping. */ unsigned long share; /* share count for fsdax */ }; /** This is a stepping stone to shrinking struct page by half (64 bytes down to 32 bytes) [1] and allocating struct folio separately from struct page. It's currently 15 patches: bootmem: Stop using page->index mm: Constify page_address_in_vma() mm: Convert page_to_pgoff() to page_pgoff() mm: Mass constification of folio/page pointers fs: Turn page_offset() into a wrapper around folio_pos() fs: Remove page_mkwrite_check_truncate() mm: Remove references to page->index in huge_memory.c mm: Use page->private instead of page->index in percpu perf: Remove setting of page->index and ->mapping dax: Remove access to page->index null_blk: Remove accesses to page->index watch_queue: Use page->private instead of page->index isofs: Partially convert zisofs_read_folio to use a folio dax: Use folios more widely within DAX mm: Rename page->index to page->__folio_index I haven't pushed the git tree because the build bots will choke on the following files which still use page->index: drivers/hwtracing/intel_th/msu.c drivers/net/ethernet/sun/niu.c drivers/staging/fbtft/fbtft-core.c drivers/video/fbdev/core/fb_defio.c fs/btrfs/compression.c fs/btrfs/extent_io.c fs/btrfs/file.c fs/btrfs/super.c fs/ceph/addr.c fs/ceph/dir.c fs/ceph/inode.c fs/crypto/crypto.c fs/ecryptfs/crypto.c fs/ecryptfs/mmap.c fs/ecryptfs/read_write.c fs/erofs/data.c fs/f2fs/checkpoint.c fs/f2fs/compress.c fs/f2fs/data.c fs/f2fs/dir.c fs/f2fs/file.c fs/f2fs/inline.c fs/f2fs/inode.c fs/f2fs/node.c fs/f2fs/segment.c fs/f2fs/super.c fs/fuse/file.c fs/jffs2/file.c fs/jfs/jfs_metapage.c fs/ntfs3/frecord.c fs/ocfs2/alloc.c fs/ocfs2/aops.c fs/ocfs2/mmap.c fs/reiserfs/file.c fs/reiserfs/inode.c fs/smb/client/smb2ops.c fs/squashfs/file.c fs/squashfs/page_actor.c fs/ufs/dir.c mm/zsmalloc.c Some of these will be fixed with scheduled pull requests (jfs), or are improved (and maybe solved) by other pending series (ufs, ecryptfs, jffs2, zsmalloc). Expect to see a few patches from me over the next few weeks that seem random; there is a destination in mind, and if everything lines up, we might be able to get to it by the next merge window. Probably something will miss landing in v6.12 and it'll be the v6.13 release before page->index goes away entirely. I believe I have someone lined up to help with ocfs2. If anyone wants to help with the remaining filesystems (btrfs & f2fs in particular!), let me know. I'm honestly tempted to mark reiserfs BROKEN at this point. The diffstat of what I currently have looks like this: arch/x86/mm/init_64.c | 9 +++---- drivers/block/null_blk/main.c | 8 +++--- drivers/dax/device.c | 9 +++---- fs/ceph/addr.c | 11 ++++---- fs/dax.c | 53 ++++++++++++++++++++------------------- fs/isofs/compress.c | 13 +++++----- include/linux/bootmem_info.h | 25 +++++++++++++------ include/linux/ksm.h | 7 +++--- include/linux/mm_types.h | 6 ++--- include/linux/pagemap.h | 58 ++++++------------------------------------- include/linux/rmap.h | 12 ++++----- kernel/events/core.c | 2 -- kernel/watch_queue.c | 4 +-- mm/bootmem_info.c | 11 ++++---- mm/huge_memory.c | 18 +++++++------- mm/internal.h | 13 +++++++--- mm/ksm.c | 5 ++-- mm/memory-failure.c | 28 +++++++++++---------- mm/page_vma_mapped.c | 5 ++-- mm/percpu.c | 4 +-- mm/rmap.c | 18 ++++++++------ mm/sparse.c | 8 +++--- mm/util.c | 2 +- 23 files changed, 153 insertions(+), 176 deletions(-) ... mostly it's a 1:1 replacement of page with folio, or ->index with ->private, but we get to delete some stuff along the way. [1] https://kernelnewbies.org/MatthewWilcox/Memdescs/Path Yes, page->mapping is next on the list in case you're touching a page->index and notice a page->mapping next door to it.