From patchwork Mon Jan 10 22:10:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 12709189 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 5F0A7C433F5 for ; Mon, 10 Jan 2022 22:10:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C58EF6B0071; Mon, 10 Jan 2022 17:10:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C081C6B0073; Mon, 10 Jan 2022 17:10:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF6076B0074; Mon, 10 Jan 2022 17:10:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 9E00C6B0071 for ; Mon, 10 Jan 2022 17:10:05 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 527308F6D9 for ; Mon, 10 Jan 2022 22:10:05 +0000 (UTC) X-FDA: 79015771170.31.968438F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id 6285FC000C for ; Mon, 10 Jan 2022 22:10:04 +0000 (UTC) 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=Lq+Jl4DXgtBGicvQ7aGakW8SUBQPZaqzx7+IAKMXSC4=; b=u8qQaT+6tQGk4HpfkqhvEhyR/k +wQ6kxWuRtPZklrdndrhTW4KPqWPCIDg+KT1tFPWclL50EzNqGnoFqOxJxJ4Omto9z9ZUIDn7OfKJ WjOt7H1zr7eSykpBWwoIqZ+QTi2U4v8H6tjwylvuW+ERO997bAwKRyoo8AbD7prl+pBqo/x8yWclf dV1Bey6lPSUBuZIbsX+n0SMv4oiVoBGt9B3nfSf3W+qZOhn/+IU3Ko+X16O4j2Gx1eU4nEVngT5hz ay7/FigwJBXW/ydvdDomfUmGcm5VT8elJenELDAcwd5CUYrQIsXQGGD+QvawQjRI51z/0uQKqJFH0 S94+pa7Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n72rY-002kwQ-Vy; Mon, 10 Jan 2022 22:10:01 +0000 Date: Mon, 10 Jan 2022 22:10:00 +0000 From: Matthew Wilcox To: Linus Torvalds Cc: linux-mm@kvack.org, Andrew Morton Subject: [GIT PULL] Page cache for 5.17 Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Rspamd-Queue-Id: 6285FC000C X-Stat-Signature: fygboxahyyoigabbaoe9a34qyqs9rcs5 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=u8qQaT+6; dmarc=none; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam02 X-HE-Tag: 1641852604-267177 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: The following changes since commit 2a987e65025e2b79c6d453b78cb5985ac6e5eb26: Merge tag 'perf-tools-fixes-for-v5.16-2021-12-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux (2021-12-07 15:36:45 -0800) are available in the Git repository at: git://git.infradead.org/users/willy/pagecache.git tags/folio-5.17 for you to fetch changes up to 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3: mm: Use multi-index entries in the page cache (2022-01-08 00:28:41 -0500) ---------------------------------------------------------------- Convert much of the page cache to use folios This patchset stops just short of actually enabling large folios. It converts everything that I noticed needs to be converted, but there may still be places I've overlooked which still have page size assumptions. The big change here is using large entries in the page cache XArray instead of many small entries. That only affects shmem for now, but it's a pretty big change for shmem since it changes where memory needs to be allocated (at split time instead of insertion). ---------------------------------------------------------------- Matthew Wilcox (Oracle) (49): filemap: Remove PageHWPoison check from next_uptodate_page() fs/writeback: Convert inode_switch_wbs_work_fn to folios mm/doc: Add documentation for folio_test_uptodate mm/writeback: Improve __folio_mark_dirty() comment pagevec: Add folio_batch iov_iter: Add copy_folio_to_iter() iov_iter: Convert iter_xarray to use folios mm: Add folio_test_pmd_mappable() filemap: Add folio_put_wait_locked() filemap: Convert page_cache_delete to take a folio filemap: Add filemap_unaccount_folio() filemap: Convert tracing of page cache operations to folio filemap: Add filemap_remove_folio and __filemap_remove_folio filemap: Convert find_get_entry to return a folio filemap: Remove thp_contains() filemap: Convert filemap_get_read_batch to use folios filemap: Convert find_get_pages_contig to folios filemap: Convert filemap_read_page to take a folio filemap: Convert filemap_create_page to folio filemap: Convert filemap_range_uptodate to folios readahead: Convert page_cache_async_ra() to take a folio readahead: Convert page_cache_ra_unbounded to folios filemap: Convert do_async_mmap_readahead to take a folio filemap: Convert filemap_fault to folio filemap: Add read_cache_folio and read_mapping_folio filemap: Drop the refcount while waiting for page lock filemap: Convert filemap_get_pages to use folios filemap: Convert page_cache_delete_batch to folios filemap: Use folios in next_uptodate_page filemap: Use a folio in filemap_map_pages filemap: Use a folio in filemap_page_mkwrite filemap: Add filemap_release_folio() truncate: Add truncate_cleanup_folio() mm: Add unmap_mapping_folio() shmem: Convert part of shmem_undo_range() to use a folio truncate,shmem: Add truncate_inode_folio() truncate: Skip known-truncated indices truncate: Convert invalidate_inode_pages2_range() to use a folio truncate: Add invalidate_complete_folio2() filemap: Convert filemap_read() to use a folio filemap: Convert filemap_get_read_batch() to use a folio_batch filemap: Return only folios from find_get_entries() mm: Convert find_lock_entries() to use a folio_batch mm: Remove pagevec_remove_exceptionals() fs: Convert vfs_dedupe_file_range_compare to folios truncate: Convert invalidate_inode_pages2_range to folios truncate,shmem: Handle truncates that split large folios XArray: Add xas_advance() mm: Use multi-index entries in the page cache fs/f2fs/f2fs.h | 2 + fs/fs-writeback.c | 24 +- fs/remap_range.c | 116 +++-- include/linux/huge_mm.h | 14 + include/linux/mm.h | 68 +-- include/linux/page-flags.h | 13 +- include/linux/pagemap.h | 59 +-- include/linux/pagevec.h | 67 ++- include/linux/uio.h | 7 + include/linux/xarray.h | 18 + include/trace/events/filemap.h | 32 +- lib/iov_iter.c | 30 +- lib/xarray.c | 6 +- mm/filemap.c | 1006 +++++++++++++++++++--------------------- mm/folio-compat.c | 11 + mm/huge_memory.c | 18 +- mm/internal.h | 14 +- mm/khugepaged.c | 12 +- mm/memory.c | 49 +- mm/migrate.c | 29 +- mm/page-writeback.c | 6 +- mm/readahead.c | 24 +- mm/shmem.c | 174 ++++--- mm/swap.c | 26 +- mm/truncate.c | 304 ++++++------ 25 files changed, 1114 insertions(+), 1015 deletions(-)