Re: [PATCH v2 3/7] mm/gup: Fix the outdated code comments above get_user_pages_unlocked()
From: Baoquan He
Date: Tue Apr 01 2025 - 10:37:03 EST
On 04/01/25 at 10:14am, David Hildenbrand wrote:
> On 31.03.25 10:13, Baoquan He wrote:
> > Since commit f0818f472d8d ("mm: gup: add get_user_pages_locked
> > and get_user_pages_unlocked"), get_user_pages() doesn't need to have
> > mmap_lock held anymore. It calls __get_user_pages_locked() which
> > can acquire and drop the mmap_lock internaly.
>
> s/internaly/internally/
>
> But your statement is wrong. get_user_pages() must be called with the
> mmap_lock held, because it sets "int locked = 1;" when calling
> __get_user_pages_locked().
You are right. I missed that line. Oscar pointed that out in v1 thread.
I will drop this patch. Thanks.