[lkml]   [2022]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 5.10 552/599] XArray: Update the LRU list in xas_split()
    From: Matthew Wilcox (Oracle) <>

    commit 3ed4bb77156da0bc732847c8c9df92454c1fbeea upstream.

    When splitting a value entry, we may need to add the new nodes to the LRU
    list and remove the parent node from the LRU list. The WARN_ON checks
    in shadow_lru_isolate() catch this oversight. This bug was latent
    until we stopped splitting folios in shrink_page_list() with commit
    820c4e2e6f51 ("mm/vmscan: Free non-shmem folios without splitting them").
    That allows the creation of large shadow entries, and subsequently when
    trying to page in a small page, we will split the large shadow entry
    in __filemap_add_folio().

    Fixes: 8fc75643c5e1 ("XArray: add xas_split")
    Reported-by: Hugh Dickins <>
    Signed-off-by: Matthew Wilcox (Oracle) <>
    Signed-off-by: Greg Kroah-Hartman <>
    lib/xarray.c | 2 ++
    1 file changed, 2 insertions(+)

    --- a/lib/xarray.c
    +++ b/lib/xarray.c
    @@ -1080,6 +1080,7 @@ void xas_split(struct xa_state *xas, voi
    if (xa_is_value(curr))
    + xas_update(xas, child);
    } else {
    unsigned int canon = offset - xas->xa_sibs;

    @@ -1094,6 +1095,7 @@ void xas_split(struct xa_state *xas, voi
    } while (offset-- > xas->xa_offset);

    node->nr_values += values;
    + xas_update(xas, node);

     \ /
      Last update: 2022-04-05 22:19    [W:2.602 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site