lkml.org 
[lkml]   [2023]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v3 26/35] mm: fall back to mmap_lock if vma->anon_vma is not yet set
    On Wed, Feb 15, 2023 at 09:17:41PM -0800, Suren Baghdasaryan wrote:
    > When vma->anon_vma is not set, page fault handler will set it by either
    > reusing anon_vma of an adjacent VMA if VMAs are compatible or by
    > allocating a new one. find_mergeable_anon_vma() walks VMA tree to find
    > a compatible adjacent VMA and that requires not only the faulting VMA
    > to be stable but also the tree structure and other VMAs inside that tree.
    > Therefore locking just the faulting VMA is not enough for this search.
    > Fall back to taking mmap_lock when vma->anon_vma is not set. This
    > situation happens only on the first page fault and should not affect
    > overall performance.

    I think I asked this before, but don't remember getting an aswer.
    Why do we defer setting anon_vma to the first fault? Why don't we
    set it up at mmap time?

    \
     
     \ /
      Last update: 2023-03-27 00:25    [W:4.090 / U:1.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site