From: Vlastimil Babka <vbabka@suse.cz>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Suren Baghdasaryan <surenb@google.com>,
Chris Li <chriscli@google.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Shakeel Butt <shakeel.butt@linux.dev>,
Jann Horn <jannh@google.com>, Pedro Falcato <pfalcato@suse.de>
Subject: Re: [PATCH v2 2/2] mm: Use vma_start_write_killable() in dup_mmap()
Date: Tue, 11 Nov 2025 10:16:50 +0100 [thread overview]
Message-ID: <bc419597-238f-4858-bdd3-98b752312c27@suse.cz> (raw)
In-Reply-To: <20251110203204.1454057-3-willy@infradead.org>
On 11/10/25 21:32, Matthew Wilcox (Oracle) wrote:
> Allow waiting for the VMA write lock to be interrupted by fatal signals.
> The explicit check for fatal_signal_pending() can be removed as it
> is checked during vma_start_write_killable(). Improves the latency
> of killing the task as we do not wait for the reader to finish before
> checking for signals.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reviewed-by: Suren Baghdasaryan <surenb@google.com>
> Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> mm/mmap.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 5fd3b80fda1d..03773fe777b7 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -1750,7 +1750,9 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
> for_each_vma(vmi, mpnt) {
> struct file *file;
>
> - vma_start_write(mpnt);
> + retval = vma_start_write_killable(mpnt);
> + if (retval < 0)
> + goto loop_out;
> if (mpnt->vm_flags & VM_DONTCOPY) {
> retval = vma_iter_clear_gfp(&vmi, mpnt->vm_start,
> mpnt->vm_end, GFP_KERNEL);
> @@ -1761,14 +1763,6 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
> continue;
> }
> charge = 0;
> - /*
> - * Don't duplicate many vmas if we've been oom-killed (for
> - * example)
> - */
> - if (fatal_signal_pending(current)) {
> - retval = -EINTR;
> - goto loop_out;
> - }
> if (mpnt->vm_flags & VM_ACCOUNT) {
> unsigned long len = vma_pages(mpnt);
>
next prev parent reply other threads:[~2025-11-11 9:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 20:32 [PATCH v2 0/2] vma_start_write_killable Matthew Wilcox (Oracle)
2025-11-10 20:32 ` [PATCH v2 1/2] mm: Add vma_start_write_killable() Matthew Wilcox (Oracle)
2025-11-11 8:58 ` Vlastimil Babka
2025-11-13 13:20 ` Lorenzo Stoakes
2025-11-13 14:40 ` Matthew Wilcox
2025-11-17 19:50 ` Suren Baghdasaryan
2025-11-10 20:32 ` [PATCH v2 2/2] mm: Use vma_start_write_killable() in dup_mmap() Matthew Wilcox (Oracle)
2025-11-11 9:16 ` Vlastimil Babka [this message]
2025-11-13 13:25 ` Lorenzo Stoakes
2025-11-13 14:30 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc419597-238f-4858-bdd3-98b752312c27@suse.cz \
--to=vbabka@suse.cz \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=chriscli@google.com \
--cc=jannh@google.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=pfalcato@suse.de \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox