diff options
author | 2024-12-18 15:34:24 +0900 | |
---|---|---|
committer | 2025-01-25 20:22:20 -0800 | |
commit | 424d0e5828ada98130081b9846f6557158e3f9dd (patch) | |
tree | 8912ab8b5232cdcad82e114127e42ed219bcef2c /mm/hugetlb.c | |
parent | zram: use zram_read_from_zspool() in writeback (diff) | |
download | wireguard-linux-424d0e5828ada98130081b9846f6557158e3f9dd.tar.xz wireguard-linux-424d0e5828ada98130081b9846f6557158e3f9dd.zip |
zram: cond_resched() in writeback loop
zram writeback is a costly operation, because every target slot (unless
ZRAM_HUGE) is decompressed before it gets written to a backing device.
The writeback to a backing device uses submit_bio_wait() which may look
like a rescheduling point. However, if the backing device has
BD_HAS_SUBMIT_BIO bit set __submit_bio() calls directly
disk->fops->submit_bio(bio) on the backing device and so when
submit_bio_wait() calls blk_wait_io() the I/O is already done. On such
systems we effective end up in a loop
for_each (target slot) {
decompress(slot)
__submit_bio()
disk->fops->submit_bio(bio)
}
Which on PREEMPT_NONE systems triggers watchdogs (since there are no
explicit rescheduling points). Add cond_resched() to the zram writeback
loop.
Link: https://lkml.kernel.org/r/20241218063513.297475-8-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
0 files changed, 0 insertions, 0 deletions