lkml.org 
[lkml]   [2020]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v20 08/20] mm: page_idle_get_page() does not need lru_lock
    On Thu, Nov 05, 2020 at 10:36:49AM -0500, Johannes Weiner wrote:
    > But the code is highly specific - synchronizing one struct page member
    > for one particular use case. Let's keep at least a reference to what
    > we are synchronizing against. There is a non-zero chance that if the
    > comment goes out of date, so does the code. How about this?
    >
    > /*
    > * page_idle does a lockless/optimistic rmap scan on page->mapping.
    > * Make sure the compiler doesn't split the stores of anon_vma and
    > * the PAGE_MAPPING_ANON type identifier, otherwise the rmap code
    > * could mistake the mapping for a struct address_space and crash.
    > */

    Fine by me! There may be other cases where seeing a split store would
    be bad, so I didn't want to call out page_idle explicitly. But if you
    want to, I'm happy with this comment.

    \
     
     \ /
      Last update: 2020-11-05 16:44    [W:3.262 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site