lkml.org 
[lkml]   [2024]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/rmap: remove unnecessary page_table_lock
April 22, 2024 at 7:24 PM, "David Hildenbrand" <david@redhat.com> wrote:



>
> On 22.04.24 12:52, Yajun Deng wrote:
>
> >
> > page_table_lock is a lock that for page table, we won't change page
> >
> > table in __anon_vma_prepare(). As we can see, it works well in
> >
> > anon_vma_clone(). They do the same operation.
> >
>
> We are reusing mm->page_table_lock to serialize, not the *actual* low-level page table locks that really protect PTEs.
>
> With that locking gone, there would be nothing protection vma->anon_vma.
>
> Note that anon_vma_clone() is likely called with the mmap_lock held in write mode, which is not the case for __anon_vma_prepare() ...

Yes, anon_vma_clone() is called with the mmap_lock held. I added mmap_assert_write_locked(dst->vm_mm) to prove it.
I added mmap_assert_write_locked(vma->vm_mm) in __anon_vma_prepare() at the same time, it shows __anon_vma_prepare()
is also called with the mmap_lock held too.

>
> I think this change is wrong.
>
> -- Cheers,
>
> David / dhildenb
>

\
 
 \ /
  Last update: 2024-05-27 17:57    [W:1.018 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site