mm: Reduce direct reclaim stalls with RAM-backed swap#610
mm: Reduce direct reclaim stalls with RAM-backed swap#610blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
Conversation
|
Upstream branch: af4e9ef |
ecd10e2 to
d0e1bed
Compare
|
Upstream branch: af4e9ef |
93f1861 to
90b650d
Compare
d0e1bed to
6b51c57
Compare
|
Upstream branch: 0031c06 |
90b650d to
94065dc
Compare
6b51c57 to
78036b2
Compare
|
Upstream branch: ecc64d2 |
94065dc to
e541283
Compare
78036b2 to
bbb3394
Compare
|
Upstream branch: c107785 |
e541283 to
72bf071
Compare
bbb3394 to
901a429
Compare
|
Upstream branch: 5ee8dbf |
72bf071 to
548a968
Compare
901a429 to
1f19ba6
Compare
|
Upstream branch: 1f318b9 |
548a968 to
b106798
Compare
1f19ba6 to
e79276a
Compare
|
Upstream branch: None |
b106798 to
94056dc
Compare
e79276a to
0dd9afc
Compare
|
Upstream branch: 80234b5 |
94056dc to
570f4cf
Compare
0dd9afc to
2e598ed
Compare
The current should_reclaim_retry() code does not account for the fact the number of logical swap pages available for RAM-backed swap (zram, brd) is dependent on having enough free physical pages, and simply always assumes that enough pages are reclaimable to satisfy the allocation. For instance, given a system with a 200GiB zram device (10% used) and 100MB of free physical pages, should_reclaim_retry() incorrectly concludes that it can swap 180GiB worth of anon pages to swap. Because it appears to be always possible to write to swap, the OOM killer is delayed and the system retries in direct reclaim for prolonged periods (20-30 minutes observed in production). Fix this by excluding anon pages from the reclaimable estimate when all active swap devices are RAM-backed. Once file-backed pages are exhausted the watermark check fails and the kernel falls through to OOM as expected. To identify RAM-backed swap devices at swapon time, introduce BLK_FEAT_RAM_BACKED (set by zram and brd) and SWP_RAM_BACKED (swapfile.c). A cached bool swap_all_ram_backed is maintained under swap_lock by swap_update_all_ram_backed() during swapon/swapoff, which is locklessly accessed in should_reclaim_retry(). Signed-off-by: Matt Fleming <mfleming@cloudflare.com>
|
Upstream branch: 0257f64 |
570f4cf to
633fa96
Compare
Pull request for series with
subject: mm: Reduce direct reclaim stalls with RAM-backed swap
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1060584