From patchwork Wed May 4 18:28:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12838352 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 07C2BC433F5 for ; Wed, 4 May 2022 18:29:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B2E16B0074; Wed, 4 May 2022 14:29:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F65D6B0071; Wed, 4 May 2022 14:29:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1997C6B0078; Wed, 4 May 2022 14:29:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 018DF6B0071 for ; Wed, 4 May 2022 14:29:03 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BC03C215D0 for ; Wed, 4 May 2022 18:29:03 +0000 (UTC) X-FDA: 79428897366.20.965D8B7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id DF6254007E for ; Wed, 4 May 2022 18:28:58 +0000 (UTC) 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=xtJQZdlP/ohUFXkvDIj6AZxBVe+3GLnNjLe0L4Y5g5Q=; b=nrBeXmwoFC2pN2Ro433JUjUdx+ L27g37d/3gCz4ES2jOBZofxr0icTrIaBwWM0rEOOUMWkXr1u95e5oTjR6M6fyyBiifJnNQC5HjwsW X/IO5gShiWhf+idPDVG5lgi3uLqGjBcxMYNHpb9tw2ctnmnvj5hwb4/mUwkGVZFKt3cO464dqN5V3 vhqHDgNV8B6KDHEE+tPkpeNcPz6B+I839taY235ek00UD+NWZKD65ZFS+bCAyG0JIV/e+D78sZ27C LAdcN0Ucku/R3Z8rI+D12kvFGkXNrUB2h867qTJ4Ps9apFsM3olry+4ixQ6KLHonrqptxBW3Pyc9F Q6/vSGLw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmJkB-00Gq5V-PK; Wed, 04 May 2022 18:29:00 +0000 From: "Matthew Wilcox (Oracle)" To: akpm@linuxfoundation.org, linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH v2 00/26] Folio patches for 5.19 Date: Wed, 4 May 2022 19:28:31 +0100 Message-Id: <20220504182857.4013401-1-willy@infradead.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nrBeXmwo; spf=none (imf11.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: DF6254007E X-Stat-Signature: b645e1i1jp9j45x969r8yr78ezdbo7ex X-HE-Tag: 1651688938-703502 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: Sorry for the bugginess that slipped through my testing in v1. I think this series addresses all of the reported problems. v2: - Add "alpha: Fix alloc_zeroed_user_highpage_movable()" - Rework the shmem_alloc_page() -> shmem_alloc_folio() conversion to be less disruptive (and buggy) - Use folio_test_pmd_mappable() instead of folio_test_large() to fix the !THP builds - Initialise 'folio' to NULL in shmem_swapin_folio to fix the error case - Avoid using HPAGE_PMD_NR in shmem_getpage_gfp() - Remove BUILD_BUG from can_split_folio() - Add the mm parts needed to convert ->migratepage to migrate_folio for fs in the next merge window v1: - Finish the conversion from alloc_pages_vma() to vma_alloc_folio() - Finish converting shrink_page_list() to folios - Start converting shmem from pages to folios (alas, not finished, I have simply run out of time with all the debugging/fixing needed for 5.18) Matthew Wilcox (Oracle) (26): shmem: Convert shmem_alloc_hugepage() to use vma_alloc_folio() mm/huge_memory: Convert do_huge_pmd_anonymous_page() to use vma_alloc_folio() alpha: Fix alloc_zeroed_user_highpage_movable() mm: Remove alloc_pages_vma() vmscan: Use folio_mapped() in shrink_page_list() vmscan: Convert the writeback handling in shrink_page_list() to folios swap: Turn get_swap_page() into folio_alloc_swap() swap: Convert add_to_swap() to take a folio vmscan: Convert dirty page handling to folios vmscan: Convert page buffer handling to use folios vmscan: Convert lazy freeing to folios vmscan: Move initialisation of mapping down vmscan: Convert the activate_locked portion of shrink_page_list to folios mm: Allow can_split_folio() to be called when THP are disabled vmscan: Remove remaining uses of page in shrink_page_list mm/shmem: Use a folio in shmem_unused_huge_shrink mm/swap: Add folio_throttle_swaprate mm/shmem: Convert shmem_add_to_page_cache to take a folio mm/shmem: Turn shmem_should_replace_page into shmem_should_replace_folio mm/shmem: Add shmem_alloc_folio() mm/shmem: Convert shmem_alloc_and_acct_page to use a folio mm/shmem: Convert shmem_getpage_gfp to use a folio mm/shmem: Convert shmem_swapin_page() to shmem_swapin_folio() mm: Add folio_mapping_flags() mm: Add folio_test_movable() mm/migrate: Convert move_to_new_page() into move_to_new_folio() arch/alpha/include/asm/page.h | 2 +- arch/arm64/include/asm/pgtable.h | 6 +- include/linux/gfp.h | 18 +- include/linux/huge_mm.h | 1 - include/linux/memcontrol.h | 14 ++ include/linux/migrate.h | 5 + include/linux/page-flags.h | 5 + include/linux/pgtable.h | 2 +- include/linux/swap.h | 23 ++- mm/huge_memory.c | 9 +- mm/memcontrol.c | 16 +- mm/mempolicy.c | 51 +++-- mm/migrate.c | 58 +++--- mm/shmem.c | 320 +++++++++++++++--------------- mm/swap_slots.c | 14 +- mm/swap_state.c | 48 ++--- mm/swapfile.c | 17 +- mm/vmscan.c | 326 ++++++++++++++++--------------- 18 files changed, 482 insertions(+), 453 deletions(-)