From: Yeoreum Yun <yeoreum.yun@arm.com>
To: "Liam R. Howlett" <liam@infradead.org>
Cc: Yeoreum Yun <yeoreum.yun@arm.com>, Jason Gunthorpe <jgg@ziepe.ca>,
John Hubbard <jhubbard@nvidia.com>, Peter Xu <peterx@redhat.com>,
linux-mm@kvack.org, Jan Kara <jack@suse.cz>,
Josef Bacik <josef@toxicpanda.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Lorenzo Stoakes <ljs@kernel.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Jann Horn <jannh@google.com>,
Pedro Falcato <pfalcato@suse.de>,
David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Harrison Crosse <harrison@crosse.dev>
Subject: Re: [PATCH 3/3] mm: gup: make mmap_lock acquisition in __mm_populate() killable
Date: Fri, 4 Dec 2026 08:38:38 +0000 [thread overview]
Message-ID: <axJ8DjItdojfkJxD@e129823.arm.com> (raw)
In-Reply-To: <a5k4fwls5ca6i3ebsfvjmkjftj3r47o7ih3nf2reql653daoaw@earub2fhy7bz>
On Thu, Dec 03, 2026 at 10:35:44PM -0500, Liam R. Howlett wrote:
> On 26/12/03 03:17PM, Yeoreum Yun wrote:
> > __mm_populate() uses mmap_read_lock() to acquire mmap_lock.
> > If the lock is contended, a task waiting here cannot abort
> > the wait on a fatal signal.
> >
> > Use mmap_read_lock_killable() and exit the populate loop if lock
> > acquisition is interrupted.
>
> You are restating the code here.
Okay, I'll rephrase it but just allowing a fatal signal to abort
and making the locking behavior consistent with the retry path.
>
> >
> > Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
>
>
> > ---
> > mm/gup.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/mm/gup.c b/mm/gup.c
> > index 4c0d00c37c21..65ce0c5a8e02 100644
> > --- a/mm/gup.c
> > +++ b/mm/gup.c
> > @@ -2049,7 +2049,8 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
> > */
> > if (!locked) {
> > locked = 1;
>
> Please move the locked = 1 below the return on the failure of trying to
> lock. It's fine today, but may not always be.
Acked.
>
> > - mmap_read_lock(mm);
> > + if (mmap_read_lock_killable(mm))
> > + return -EINTR;
> > vma = find_vma_intersection(mm, nstart, end);
> > } else if (nstart >= vma->vm_end)
> > vma = find_vma_intersection(mm, vma->vm_end, end);
> >
> > --
> > 2.43.0
> >
--
Sincerely,
Yeoreum Yun
next prev parent reply other threads:[~2026-12-04 8:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 15:17 [PATCH 0/3] mm: gup: handle fault retries in __mm_populate() Yeoreum Yun
2026-12-03 15:17 ` [PATCH 1/3] " Yeoreum Yun
2026-12-04 3:23 ` Liam R. Howlett
2026-12-04 8:30 ` Yeoreum Yun
2026-12-04 5:29 ` kernel test robot
2026-12-04 15:17 ` sashiko-bot
2026-12-03 15:17 ` [PATCH 2/3] mm: gup: remove unused argument in populate_vma_page_range() Yeoreum Yun
2026-12-04 3:28 ` Liam R. Howlett
2026-12-04 8:41 ` Yeoreum Yun
2026-12-04 15:17 ` sashiko-bot
2026-12-03 15:17 ` [PATCH 3/3] mm: gup: make mmap_lock acquisition in __mm_populate() killable Yeoreum Yun
2026-12-04 3:35 ` Liam R. Howlett
2026-12-04 8:38 ` Yeoreum Yun [this message]
2026-12-04 3:23 ` [PATCH 0/3] mm: gup: handle fault retries in __mm_populate() Liam R. Howlett
2026-12-04 19:58 ` Yeoreum Yun
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=axJ8DjItdojfkJxD@e129823.arm.com \
--to=yeoreum.yun@arm.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=harrison@crosse.dev \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=josef@toxicpanda.com \
--cc=liam@infradead.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=peterx@redhat.com \
--cc=pfalcato@suse.de \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.