Commit b7b618da authored by Miaohe Lin's avatar Miaohe Lin Committed by Andrew Morton

mm: memory-failure: remove unneeded page state check in shake_page()

Remove unneeded PageLRU(p) and is_free_buddy_page(p) check as slab caches
are not shrunk now.  This check can be added back when a lightweight range
based shrinker is available.

Link: https://lkml.kernel.org/r/20230628014929.3441386-1-linmiaohe@huawei.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Acked-by: default avatarNaoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 64891ba3
...@@ -363,17 +363,14 @@ void shake_page(struct page *p) ...@@ -363,17 +363,14 @@ void shake_page(struct page *p)
{ {
if (PageHuge(p)) if (PageHuge(p))
return; return;
if (!PageSlab(p)) {
lru_add_drain_all();
if (PageLRU(p) || is_free_buddy_page(p))
return;
}
/* /*
* TODO: Could shrink slab caches here if a lightweight range-based * TODO: Could shrink slab caches here if a lightweight range-based
* shrinker will be available. * shrinker will be available.
*/ */
if (PageSlab(p))
return;
lru_add_drain_all();
} }
EXPORT_SYMBOL_GPL(shake_page); EXPORT_SYMBOL_GPL(shake_page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment