Message ID | 20230927052505.2855872-6-willy@infradead.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 57876E80A89 for <linux-mm@archiver.kernel.org>; Wed, 27 Sep 2023 05:25:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E385C8D007D; Wed, 27 Sep 2023 01:25:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DE8168D0002; Wed, 27 Sep 2023 01:25:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD72B8D007D; Wed, 27 Sep 2023 01:25:22 -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 B8E508D0002 for <linux-mm@kvack.org>; Wed, 27 Sep 2023 01:25:22 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 80FD8120F01 for <linux-mm@kvack.org>; Wed, 27 Sep 2023 05:25:22 +0000 (UTC) X-FDA: 81281239284.17.C0B8641 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id DEEF3C0002 for <linux-mm@kvack.org>; Wed, 27 Sep 2023 05:25:20 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ercYuRq6; spf=none (imf28.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=1695792321; 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:in-reply-to:references:references:dkim-signature; bh=bcm+M3iLEHwImzaKDo5AQyWqQd+Kb1x46vwh8DrPUKQ=; b=utgNH3Inn9NUJU1MbbUbN3ee6Rz/lMfyk66XbbvQHezdsTosXJ1dUhGNNfooReOnUw6gsv OP+O9jbkR2FJEcJ0uY1KH00QMH+Y4NFFxRj36DcdJINQVz33AgdZrQ6YnRog4gAIVmbwUQ f2Ks9qwW97vrvaiKID2z/cEAn5zPOg0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695792321; a=rsa-sha256; cv=none; b=gfFODweJmRQZ1Wh+8yiiLoFN2OaGSNwWsUew/GzZN1aufQP1H+U8EJJSLpTH+ng/Ar/Nd+ z+fPRncGKV+7Iw7zQUnd5ZlUg1FFu3MhDhPdxSFFmxMlssQZ41MRip6vckzHAH+Mrz7bdY SKTmN30xi6zKfsSsG0upjBd1JQ9lwvE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ercYuRq6; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=bcm+M3iLEHwImzaKDo5AQyWqQd+Kb1x46vwh8DrPUKQ=; b=ercYuRq6ui0ImEvYQJHJdJYNg5 tYohqyb352TcyFFAPYkQdsGmXSNyDvbWGnuJt0UTrPhJ57vva7JWwteAyrmbvVcUldNz/tcafzA1I EEIWwOtNGt7LvjZXcQUeEu74JlE5+ge933oT5Zvw2kiNfWMKTU7qGoiY6x1qxtZ0tEtgvHkTTW2ep pj5kQdZgw3rMAogSpMgvi5v09gP+E2lrZzKIHFlnaWf1Y5vunJmrJtKBlCsV3ZLZzwAY9WpU3q8av R7KtCBWs0Bl1Iw/TtGnOZCTY/5s8yjnWzJdyOx6YIE9xZ5khuH293xAmGzkRjDbayCxZ0MtrmEzLi oaFwSNqg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qlN2o-00Bywx-Sc; Wed, 27 Sep 2023 05:25:06 +0000 From: "Matthew Wilcox (Oracle)" <willy@infradead.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>, linux-mm@kvack.org, Suren Baghdasaryan <surenb@google.com> Subject: [PATCH 5/6] mm: Handle read faults under the VMA lock Date: Wed, 27 Sep 2023 06:25:03 +0100 Message-Id: <20230927052505.2855872-6-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230927052505.2855872-1-willy@infradead.org> References: <20230927052505.2855872-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DEEF3C0002 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: b1jdzdi59so5951nhw9t5r86fg7s9kcu X-HE-Tag: 1695792320-210053 X-HE-Meta: U2FsdGVkX1/HNFcjFUj8DsXNGqKcwu9B/IaMq4Y2QfhODcQtB/WmQHk9Oiq/axVv2Ejg4lCARF8K4+x4maE7/J1VIpCLrLhBWXBgx9LgtrFcWuhbbcvHh/HobOmHsKI0BcjN5X7d1iGoE6yWZBbgvELHfIDh+d8AyPCqDkKGRfJybFcx1f9JzzHlkpIqkkAzjz7kQbAwnZVeaqwelbDvCJvj/VfvtsxD5ydvkTpkR714d3s2hVWokhfWrGvuvYYv6L/s9ep4+5/Hu+k2Llr3ajWk9gpOrDU/fG4QzGPG0fBcC9hegNQ0ySr0b3uyWH5oyaQgl9SF93cdntljt3S0yKd3EuzntfVjKoXJq6tlk2voGqPlb+0f7qB8A2BadxkrikgGPAcWn8i+aZbJFgXFKfbq/w6qV0cMQQ7MbzELfCLQRueGezpTuV87Wj0NFHKF3gdtTzAJfu4owWxvgmcA1LGfWKGC/gFaGKpELptr0A71oAElKTfM0PcB4lwgWRL+Y33H8OP/JVw0PtjrTlWFcdkXouD6Ho6AjmV+4lqem8h7u3fvc8rJfMbCqWzlYMk6aZHC2jppGAJ3Itk1EmEHKu7uVzxE57xyG78cQ2dzf0ozp+6h/+29WEwtFg0k4WQOWnCGJsYRJA+9edbZ9djhtsnMkQ8RfadZ32e/FgD2hdeC/kELRJBi9wsN1q/iCBYT//m/hdobTI6j5yBEx/FgKClEEB/KcyeTgscZeAjNUZC9qL9cgWmH2U4C1uUm800K5k4WIBZWa869kc83kv1TEIyYm8oHA3GT/bi/+NscIAgteHTes3frQMiJ7UE0aTH+W1opyw5HwnFIaRvToeKaxZagzhX/6OES96O/2dG8g29dSThxngeyBritXaHLXdB7KfmDgMI5An7Ra82Mua7MpzPYuvylrL6bOqxprilgr/7Wkmap/ASc1HJUygkohAba2ezImTuCLt4vHJA/QvC eHEmAwu6 3keOiPm0/mg8BOk4cthZDBWhreAoGYaviAiAazW7j+AsmKOLzXwfrCei2e1FkxK+K+KuTGMPy1Yjoygxk0PXoIKCPO6t9NHoy/C6rLvGLVuHFaVu81JTBnSgGKRPQBW7huQbDSzMs1nZDrTHIDDWW/UXo2PWbPB4zLSUsx/1PetIJEGjlEVrZ1sb4xQ== 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: <linux-mm.kvack.org> |
Series |
Handle more faults under the VMA lock
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index 02231a9394ed..5f92126dc527 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4617,10 +4617,9 @@ static vm_fault_t do_read_fault(struct vm_fault *vmf) return ret; } - if (vmf->flags & FAULT_FLAG_VMA_LOCK) { - vma_end_read(vmf->vma); - return VM_FAULT_RETRY; - } + ret = vmf_maybe_unlock_vma(vmf); + if (ret) + return ret; ret = __do_fault(vmf); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY)))
Most file-backed faults are already handled through ->map_pages(), but if we need to do I/O we'll come this way. Since filemap_fault() is now safe to be called under the VMA lock, we can handle these faults under the VMA lock now. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- mm/memory.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)