From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC327E82CA7 for ; Wed, 27 Sep 2023 15:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231752AbjI0P61 (ORCPT ); Wed, 27 Sep 2023 11:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbjI0P6T (ORCPT ); Wed, 27 Sep 2023 11:58:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01E479C for ; Wed, 27 Sep 2023 08:58:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EDABC433C9; Wed, 27 Sep 2023 15:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1695830297; bh=sgt1oDc/1G1WEao1bl8HY+H757P1KQr3ICjH+P7sXyo=; h=Date:To:From:Subject:From; b=FApTWL34yXwfElJvVIBEzqe4J0bLKH6oOiAcgoTVr3Bl0fQtudXQI55zrG5jOWfNI 8W2gp8VPhTEWta6SPaBxlCSaCvuUehJKLGz6r9XDv6zKBCWxSbRCQaiYors0vtsOne 2efe4negt2fhrFUu0WbgonbMP3yhPQr40rG+oZqo= Date: Wed, 27 Sep 2023 08:58:17 -0700 To: mm-commits@vger.kernel.org, surenb@google.com, willy@infradead.org, akpm@linux-foundation.org From: Andrew Morton Subject: + mm-handle-read-faults-under-the-vma-lock.patch added to mm-unstable branch Message-Id: <20230927155817.8EDABC433C9@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm: handle read faults under the VMA lock has been added to the -mm mm-unstable branch. Its filename is mm-handle-read-faults-under-the-vma-lock.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-handle-read-faults-under-the-vma-lock.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Matthew Wilcox (Oracle)" Subject: mm: handle read faults under the VMA lock Date: Wed, 27 Sep 2023 06:25:03 +0100 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. Link: https://lkml.kernel.org/r/20230927052505.2855872-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton --- mm/memory.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/mm/memory.c~mm-handle-read-faults-under-the-vma-lock +++ a/mm/memory.c @@ -4620,10 +4620,9 @@ static vm_fault_t do_read_fault(struct v 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))) _ Patches currently in -mm which might be from willy@infradead.org are i915-limit-the-length-of-an-sg-list-to-the-requested-length.patch mm-report-success-more-often-from-filemap_map_folio_range.patch mm-abstract-moving-to-the-next-pfn.patch mm-convert-dax-lock-unlock-page-to-lock-unlock-folio.patch buffer-pass-gfp-flags-to-folio_alloc_buffers.patch buffer-hoist-gfp-flags-from-grow_dev_page-to-__getblk_gfp.patch buffer-hoist-gfp-flags-from-grow_dev_page-to-__getblk_gfp-fix.patch ext4-use-bdev_getblk-to-avoid-memory-reclaim-in-readahead-path.patch buffer-use-bdev_getblk-to-avoid-memory-reclaim-in-readahead-path.patch buffer-convert-getblk_unmovable-and-__getblk-to-use-bdev_getblk.patch buffer-convert-sb_getblk-to-call-__getblk.patch ext4-call-bdev_getblk-from-sb_getblk_gfp.patch buffer-remove-__getblk_gfp.patch hugetlb-use-a-folio-in-free_hpage_workfn.patch hugetlb-remove-a-few-calls-to-page_folio.patch hugetlb-convert-remove_pool_huge_page-to-remove_pool_hugetlb_folio.patch mm-make-lock_folio_maybe_drop_mmap-vma-lock-aware.patch mm-call-wp_page_copy-under-the-vma-lock.patch mm-handle-shared-faults-under-the-vma-lock.patch mm-handle-cow-faults-under-the-vma-lock.patch mm-handle-read-faults-under-the-vma-lock.patch mm-handle-write-faults-to-ro-pages-under-the-vma-lock.patch