From patchwork Mon Jul 24 18:54:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13325264 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 E22D9EB64DD for ; Mon, 24 Jul 2023 18:54:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CF386B0080; Mon, 24 Jul 2023 14:54:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77CC56B0081; Mon, 24 Jul 2023 14:54:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66A4C6B0082; Mon, 24 Jul 2023 14:54:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 58AB56B0080 for ; Mon, 24 Jul 2023 14:54:35 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 283A2120AF2 for ; Mon, 24 Jul 2023 18:54:35 +0000 (UTC) X-FDA: 81047406510.13.0462C21 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id 89F49100022 for ; Mon, 24 Jul 2023 18:54:33 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="vZT/Y4MR"; dmarc=none; spf=none (imf14.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=1690224873; 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=2zzyOQ/ELoedvwtKEVTyBAp/APkj84uTCSU6QcCalhU=; b=mA6BGhM/pbNT4EcrRjAwv1FNWodvUePCJ53vYQeo5IqZU+3QOsbG4gLIueWuepP2AK/Dmt V1l5KrJbdgXW+Vs2QTggqdGkTE0/o/ranIi998tSKYtn28lUoXpIsl7Yd6z9kUZwVINclM cyirDwKI4HYsJ2QZmznTVbFxdQdh8mQ= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="vZT/Y4MR"; dmarc=none; spf=none (imf14.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=1690224873; a=rsa-sha256; cv=none; b=nsdbZ7mvdy98WK0k22fsB28gVyopSKQpr17crW2F6+JgCywm9OQ5K9ag7MlI9e8i2PifJ5 L4Zh5McYc8xVQwatS2YuxlWTebRt7s/W42/+0jQJ+SiUGzyga2hab/03swNLO1QjQTqEmg puhf/jL4NtnIG5PiIUWE5yCSGBjqGbk= 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=2zzyOQ/ELoedvwtKEVTyBAp/APkj84uTCSU6QcCalhU=; b=vZT/Y4MRkSR2RWKBXfsnQJA9eJ L58r4l8glD5QAZyt8P99Pd+9h6TZHk1p3STq52FhfkuvDHTAY56TxbnU0iNvbtrY46ajoLfYr8+9Y Xab08FxxN9u96Oy9O2EqCQBhhR8IqAXPAKcKwVITdLpuQyJeCl6hba5/5Gtlaz067Neul3z5HnTsj 8JJXJB7btmdCN2D2HxK2UhW07sJqLYq3nQqmbtMcMmbbYCIgdpGpkWeMPQoZxtFQzkow5VuH1PymB U6tWF0TV1UFZMZhi6ccwHiMJsPddRyE8c1l3x/Hmu6MWCqvJLyhWXGr1aTdNXgqvuZE1s0VJSwtE6 f4FbI8LA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qO0h9-004iQz-VH; Mon, 24 Jul 2023 18:54:12 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Punit Agrawal Subject: [PATCH v3 00/10] Handle most file-backed faults under the VMA lock Date: Mon, 24 Jul 2023 19:54:00 +0100 Message-Id: <20230724185410.1124082-1-willy@infradead.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 89F49100022 X-Stat-Signature: duke75ndg9xqo37eyqdzpt3ezpyxwfzd X-HE-Tag: 1690224873-579444 X-HE-Meta: U2FsdGVkX18w4w/q9JtjxePO3DuZ4A1ya9J0qS6GywIAzq11YvfkB7nu/WmDfj/cHTCaQjo6gzLn30iUKY3gZ7ayJD97WzfIqWFc5Pg4lzsiOjA8+5YWLbO38Zfe4EIvGEKObdjcZ38UnN6xeM2g2MI105H+LlxVTFyiGj4pqDPT3Ut9c2KO4Fwv21WE944d3d+LYm4QeKJlsxCF3aPSg2kWAjHZUUHB51ClHBh1OckCZ5gp7VREGNVlsDb3Ou/YKk7pLfjntp7sHoaiEgruX3CntZg1SpnLHgrUMjbHai1IBIL2SGyhFq2wn2ZI5Q1/Pk16frBlxeuegAUY1caCjVDskfCfnHjjNxotOLg9OWK9MOKvgHh4ObK610cz2AIXELTUtQQF7CiGZsJM2FjnzmGqR/dA0j2KWLWfhEAcM/0ydTJp5sFv+rScrudChtPWJa8vs+6e1VA1sSz+Z2GeEvKdSdSnnoczC2nEkStu6kCWP1YA9bVba1h+Pn1MJFk8DFZJaXf5b1mDyX6BA8MvBa6UJa3XWmXLQak3q7La1nQGmqSSKJqq3CbBkVzk+Ny8V/1nEK+Al6gmnXzcMyxVagEiBiC0kXrc4lnoGvzT3a8IW1NOCGNdQ4cNz89p/dEkihiSPx7UWPkONaqWmgDFjlBgvT5hC/PCCnis2cB/ct7NJOx4Qg36Lsd68+nAJyg2DIzMbDihjl9FTYVpLTopSfsPOAa4I5iisYY34gFFH1hM3PmPgKToH4YnlzsES5porYTayhO2sCC1HsaOCqewWINQYpcjY/n1cD5wtb8XEcA59Jh5LmRx4pMGhm2p1qlYcprWU2DMScKlOrEPr5AIyUF357uCFGCEeh93uqapZTuc6S9wtZDY9G/ZHA2S46jS3Uw+oy3+Fzy199MyNSWxFSZ5SolMDjHe/+tUVbCBH2Tr9QT9A55M/ufXRQu1C8GrmcVvcXjqytqINa9nDA5 cnZ0Dc8n rgHbsJNWd1//4/f1efquqYC0cu+TzMUY0Tt5feRJ1GTCGdWe286clNo48i0OBn7+3bo1haLgR8BPThrqwJKSRNjGAC8LvBj1YEhPs2R1bmMH2ARAXcVixG5bcpw== 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 patchset adds the ability to handle page faults on parts of files which are already in the page cache without taking the mmap lock. Several people have volunteered to run benchmarks on this, so I haven't. I am running it through xfstests and it hasn't appear to introduce any regressions so far. This patchset is against next-20230724. v3: - Remove the reversion and reapplication of Arjun Roy's patch; "Remove CONFIG_PER_VMA_LOCK ifdefs" is brought to the front, and Arjun's patch is instead fixed. - Add the missing pte_unmap() pointed out by Jann Horn - Do not call ->huge_fault under the VMA lock, also pointed out by Jann - Add the last two patches that handle faults on existing PTEs - Add R-b from Suren (for the patches that remained intact) - Better wording in commit messages Matthew Wilcox (Oracle) (10): mm: Remove CONFIG_PER_VMA_LOCK ifdefs mm: Allow per-VMA locks on file-backed VMAs mm: Move FAULT_FLAG_VMA_LOCK check from handle_mm_fault() mm: Handle PUD faults under the VMA lock mm: Handle some PMD faults under the VMA lock mm: Move FAULT_FLAG_VMA_LOCK check down in handle_pte_fault() mm: Move FAULT_FLAG_VMA_LOCK check down from do_fault() mm: Run the fault-around code under the VMA lock mm: Handle swap and NUMA PTE faults under the VMA lock mm: Handle faults that merely update the accessed bit under the VMA lock MAINTAINERS | 1 - arch/arm64/mm/fault.c | 2 - arch/powerpc/mm/fault.c | 4 -- arch/riscv/mm/fault.c | 4 -- arch/s390/mm/fault.c | 2 - arch/x86/mm/fault.c | 4 -- include/linux/mm.h | 6 +++ include/linux/net_mm.h | 17 -------- include/net/tcp.h | 1 - mm/hugetlb.c | 6 +++ mm/memory.c | 97 +++++++++++++++++++++++++++++------------ net/ipv4/tcp.c | 11 ++--- 12 files changed, 86 insertions(+), 69 deletions(-) delete mode 100644 include/linux/net_mm.h