Commits
Andrey Ryabinin authored and Konstantin Khorenko committed c57f0c47f12
mm/tcache,tswap: Don't try to shrink if tswap/tcache disabled shrink_tcrutches() calls tcache/tswap_shrink_scan() regardless of wether tcache/tswap enabled or have any pages. If tcache was disabled at via tcache.enabled=0 boot parameter, it will crash: BUG: unable to handle kernel NULL pointer dereference at 0000000000000010 IP: [<ffffffffbe03794b>] tcache_lru_isolate+0x2b/0x1e0 Call Trace: tcache_shrink_scan+0x46/0x130 shrink_tcrutches+0xe8/0x150 balance_pgdat+0x434/0x810 kswapd+0x173/0x440 kthread+0xd1/0xe0 ret_from_fork_nospec_begin+0x21/0x21 RIP [<ffffffffbe03794b>] tcache_lru_isolate+0x2b/0x1e0 Fix this by calling tcache/tswap_shrink_scan() only if tcache/tswap enabled and have anything to reclaim. https://jira.sw.ru/browse/HCI-168 Fixes: fe87c15bf3ac ("mm/vmscan: shrink tcache, tswap upfront everything else") Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Reviewed-by: Konstantin Khorenko <khorenko@virtuozzo.com>