diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2023-06-28 09:49:29 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-08-18 10:12:06 -0700 |
commit | b7b618da0edc85280e1c9c8f4f5239571e7c1d3e (patch) | |
tree | 3de81099821289e0142dc890aa11b235c87fa6b6 | |
parent | 64891ba3e51fb841b0af70db029038eb93bd5a43 (diff) | |
download | lwn-b7b618da0edc85280e1c9c8f4f5239571e7c1d3e.tar.gz lwn-b7b618da0edc85280e1c9c8f4f5239571e7c1d3e.zip |
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.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | mm/memory-failure.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ece5d481b5ff..1ddb25a1073e 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -363,17 +363,14 @@ void shake_page(struct page *p) { if (PageHuge(p)) 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 * shrinker will be available. */ + if (PageSlab(p)) + return; + + lru_add_drain_all(); } EXPORT_SYMBOL_GPL(shake_page); |