mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
XArray: Update the LRU list in xas_split()
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 commit820c4e2e6f
("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:8fc75643c5
("XArray: add xas_split") Reported-by: Hugh Dickins <hughd@google.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
This commit is contained in:
parent
3e3c658055
commit
3ed4bb7715
@ -1081,6 +1081,7 @@ void xas_split(struct xa_state *xas, void *entry, unsigned int order)
|
||||
xa_mk_node(child));
|
||||
if (xa_is_value(curr))
|
||||
values--;
|
||||
xas_update(xas, child);
|
||||
} else {
|
||||
unsigned int canon = offset - xas->xa_sibs;
|
||||
|
||||
@ -1095,6 +1096,7 @@ void xas_split(struct xa_state *xas, void *entry, unsigned int order)
|
||||
} while (offset-- > xas->xa_offset);
|
||||
|
||||
node->nr_values += values;
|
||||
xas_update(xas, node);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xas_split);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user