From patchwork Sun Jan 2 21:57:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12702378 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 0C1C0C433EF for ; Sun, 2 Jan 2022 21:58:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35B516B0089; Sun, 2 Jan 2022 16:58:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 163F36B0096; Sun, 2 Jan 2022 16:58:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E80296B0093; Sun, 2 Jan 2022 16:58:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id CC7AB6B008A for ; Sun, 2 Jan 2022 16:58:04 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 979F58F6C5 for ; Sun, 2 Jan 2022 21:58:04 +0000 (UTC) X-FDA: 78986710488.25.E553FDB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 94C5B140004 for ; Sun, 2 Jan 2022 21:57:51 +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=qYoR+lUuovbnZBGZyRMSKPICbdE+wrgcgioEqNG9+9Y=; b=b8i8J8bSBDIn0UAXSrOztCcr3z mU30Q4Z7pZv1gL3a7TSswiUcsgg6iVuwgf2OPADANZtBk31h3KsXoIbonBsoenM93A1hZz/c37l30 rVMYw7odi2PLOEYPlk2sUjgkgCgXsdAGTEd2X0LyJun+xOGVnPo9Eg40XxPHirzOByUADkbzhkg6Z ymrrWr0BT4RZ42aalMLKOdHPpJHytzZUBTrgz9odU3HXOeUh2rK5vZMjaDi+Hp6j+aFbaaFOCn/3i Invm8JGpPsGzBowby26jj3px0lOeB0YdgOHA7V2SymWHiMiQchVMgddjG4di0h+lAsnSpe/C7Zhxn OmTee/pA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n48r5-00CLnt-Po; Sun, 02 Jan 2022 21:57:31 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , John Hubbard , Andrew Morton Subject: [PATCH 00/17] Convert GUP to folios Date: Sun, 2 Jan 2022 21:57:12 +0000 Message-Id: <20220102215729.2943705-1-willy@infradead.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 94C5B140004 X-Stat-Signature: 4rtcfhs8j8fueghbygjuwgxzhc6uxwtt Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=b8i8J8bS; spf=none (imf23.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-Rspamd-Server: rspam10 X-HE-Tag: 1641160671-818295 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: This patch series is against my current folio for-next branch. I know it won't apply to sfr's next tree, and it's not for-next material yet. I intend to submit it for 5.18 after I've rebased it to one of the 5.17-rc releases. The overall effect of this (ignoring the primary "preparing for folios that are not PAGE or PMD sized" purpose) is to reduce the size of gup.o by ~700 bytes in the config I normally test with. This patchset just converts existing implementations to use folios. There's no new API for consumers here to provide information in a more efficient (address, length) format. That will be a separate patchset. Matthew Wilcox (Oracle) (17): mm: Add folio_put_refs() mm: Add folio_pincount_available() mm: Add folio_pincount_ptr() mm: Convert page_maybe_dma_pinned() to use a folio gup: Add try_get_folio() mm: Remove page_cache_add_speculative() and page_cache_get_speculative() gup: Add gup_put_folio() gup: Add try_grab_folio() gup: Convert gup_pte_range() to use a folio gup: Convert gup_hugepte() to use a folio gup: Convert gup_huge_pmd() to use a folio gup: Convert gup_huge_pud() to use a folio gup: Convert gup_huge_pgd() to use a folio gup: Convert for_each_compound_head() to gup_for_each_folio() gup: Convert for_each_compound_range() to gup_for_each_folio_range() mm: Add isolate_lru_folio() gup: Convert check_and_migrate_movable_pages() to use a folio arch/powerpc/include/asm/mmu_context.h | 1 - include/linux/mm.h | 58 +++-- include/linux/mm_types.h | 6 + include/linux/pagemap.h | 11 - mm/folio-compat.c | 8 + mm/gup.c | 312 ++++++++++++------------- mm/hugetlb.c | 7 +- mm/internal.h | 3 +- mm/vmscan.c | 43 ++-- 9 files changed, 222 insertions(+), 227 deletions(-) Reviewed-by: William Kucharski Reviewed-by: Jason Gunthorpe