Skip to content

zram: support asynchronous GC for lazy slot freeing#735

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

zram: support asynchronous GC for lazy slot freeing#735
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1080269=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented Apr 12, 2026

Pull request for series with
subject: zram: support asynchronous GC for lazy slot freeing
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1080269

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 12, 2026

Upstream branch: 9a9c8ce
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080269
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 13, 2026

Upstream branch: 028ef9c
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080269
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from 479475e to e0c0f8d Compare April 13, 2026 06:23
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 8f17195 to 6b4d829 Compare April 14, 2026 06:46
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 14, 2026

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

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from e0c0f8d to 2d27aca Compare April 14, 2026 06:49
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6b4d829 to ceec5ed Compare April 21, 2026 06:51
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 21, 2026

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

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from 2d27aca to acba6be Compare April 21, 2026 07:04
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from ceec5ed to 3b54e52 Compare April 22, 2026 20:20
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 22, 2026

Upstream branch: 6596a02
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080269
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from acba6be to c9d287f Compare April 22, 2026 20:28
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 3b54e52 to 6a0b974 Compare April 23, 2026 16:58
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 23, 2026

Upstream branch: 507bd4b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080269
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from c9d287f to bde187a Compare April 23, 2026 17:06
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6a0b974 to 59ca59b Compare April 24, 2026 00:56
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

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

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from bde187a to ebfdc73 Compare April 24, 2026 01:03
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 94f0438 to 857ada9 Compare April 24, 2026 07:54
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

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

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from ebfdc73 to d8becc3 Compare April 24, 2026 07:58
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 857ada9 to 482ce5b Compare April 29, 2026 02:21
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 29, 2026

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

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from d8becc3 to 9f3669b Compare April 29, 2026 02:39
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 482ce5b to 5a9f7c7 Compare April 30, 2026 07:29
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 30, 2026

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

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from 9f3669b to eb2421c Compare April 30, 2026 07:40
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 5a9f7c7 to 25a041f Compare May 3, 2026 02:07
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 3, 2026

Upstream branch: 66edb90
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080269
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from eb2421c to 45578d0 Compare May 3, 2026 02:51
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 25a041f to 6f75bd1 Compare May 4, 2026 10:57
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 4, 2026

Upstream branch: 6d35786
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080269
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from 45578d0 to 771fefa Compare May 4, 2026 11:41
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6f75bd1 to 1f0d33a Compare May 5, 2026 15:39
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 5, 2026

Upstream branch: 6d35786
series: https://patchwork.kernel.org/project/linux-block/list/?series=1080269
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from 771fefa to 3a419eb Compare May 5, 2026 16:12
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 1f0d33a to b1870f6 Compare May 10, 2026 15:59
Swap freeing can be expensive when unmapping a VMA containing
many swap entries. This has been reported to significantly
delay memory reclamation during Android’s low-memory killing,
especially when multiple processes are terminated to free
memory, with slot_free() accounting for more than 80% of
the total cost of freeing swap entries.

Two earlier attempts by Lei and Zhiguo added a new thread in the mm core
to asynchronously collect and free swap entries [1][2], but the
design itself is fairly complex.

When anon folios and swap entries are mixed within a
process, reclaiming anon folios from killed processes
helps return memory to the system as quickly as possible,
so that newly launched applications can satisfy their
memory demands. It is not ideal for swap freeing to block
anon folio freeing. On the other hand, swap freeing can
still return memory to the system, although at a slower
rate due to memory compression.

Therefore, in zram, we introduce a GC worker to allow anon
folio freeing and slot_free to run in parallel, since
slot_free is performed asynchronously, maximizing the rate at
which memory is returned to the system.

Xueyuan’s test on RK3588 shows that unmapping a 256MB swap-filled
VMA becomes 3.4× faster when pinning tasks to CPU2, reducing the
execution time from 63,102,982 ns to 18,570,726 ns.

A positive side effect is that async GC also slightly improves
do_swap_page() performance, as it no longer has to wait for
slot_free() to complete.

Xueyuan’s test shows that swapping in 256MB of data (each page
filled with repeating patterns such as “1024 one”, “1024 two”,
“1024 three”, and “1024 four”) reduces execution time from
1,358,133,886 ns to 1,104,315,986 ns, achieving a 1.22× speedup.

[1] https://lore.kernel.org/all/20240805153639.1057-1-justinjiang@vivo.com/
[2] https://lore.kernel.org/all/20250909065349.574894-1-liulei.rjpt@vivo.com/

Tested-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
Signed-off-by: Barry Song (Xiaomi) <baohua@kernel.org>
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 10, 2026

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

@blktests-ci blktests-ci Bot force-pushed the series/1080269=>linus-master branch from 3a419eb to e04909a Compare May 10, 2026 16:34
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.

0 participants