Skip to content

mm: Reduce direct reclaim stalls with RAM-backed swap#610

Open
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1060584=>linus-master
Open

mm: Reduce direct reclaim stalls with RAM-backed swap#610
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1060584=>linus-master

Conversation

@blktests-ci
Copy link

@blktests-ci blktests-ci bot commented Mar 3, 2026

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

@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 3, 2026

Upstream branch: af4e9ef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the linus-master_base branch 2 times, most recently from ecd10e2 to d0e1bed Compare March 4, 2026 07:45
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 4, 2026

Upstream branch: af4e9ef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from 93f1861 to 90b650d Compare March 4, 2026 07:59
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from d0e1bed to 6b51c57 Compare March 4, 2026 09:34
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 4, 2026

Upstream branch: 0031c06
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from 90b650d to 94065dc Compare March 4, 2026 09:43
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 6b51c57 to 78036b2 Compare March 4, 2026 19:57
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 4, 2026

Upstream branch: ecc64d2
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from 94065dc to e541283 Compare March 4, 2026 20:06
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 78036b2 to bbb3394 Compare March 5, 2026 12:20
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

Upstream branch: c107785
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from e541283 to 72bf071 Compare March 5, 2026 12:28
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from bbb3394 to 901a429 Compare March 5, 2026 21:37
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

Upstream branch: 5ee8dbf
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from 72bf071 to 548a968 Compare March 5, 2026 21:45
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 901a429 to 1f19ba6 Compare March 10, 2026 06:29
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 10, 2026

Upstream branch: 1f318b9
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from 548a968 to b106798 Compare March 10, 2026 06:34
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 1f19ba6 to e79276a Compare March 11, 2026 08:02
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 11, 2026

Upstream branch: None
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from b106798 to 94056dc Compare March 11, 2026 08:10
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from e79276a to 0dd9afc Compare March 12, 2026 01:40
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 12, 2026

Upstream branch: 80234b5
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from 94056dc to 570f4cf Compare March 12, 2026 02:06
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 0dd9afc to 2e598ed Compare March 13, 2026 07:29
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>
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 13, 2026

Upstream branch: 0257f64
series: https://patchwork.kernel.org/project/linux-block/list/?series=1060584
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1060584=>linus-master branch from 570f4cf to 633fa96 Compare March 13, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant