summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc
diff options
context:
space:
mode:
authorKyrylo Biryuk <illofspeed@gmail.com>2026-11-03 23:04:38 +0100
committerMikulas Patocka <mpatocka@redhat.com>2026-11-04 19:40:11 +0100
commitdab527d83462a618d99bfc96370ce45ae3428706 (patch)
tree58be59d021ab1df94a507100a4f52ee7203db623 /rust/kernel/alloc
parent9bb1d14877f4929be17f7fdbeb4cfdf5025d464b (diff)
dm zoned: do not reclaim a random zone into another random zone
dmz_reclaim_rnd_data() falls back to a random destination zone when no free sequential zone is available and the target has cache zones. When the target is idle and the cache zone list is empty, dmz_get_rnd_zone_for_reclaim() selects random zones of the zoned device as well, so a random zone is then copied into another random zone. That frees nothing: the next pass picks the next random zone and copies it again, for as long as the target stays idle. Seen on a two-device target (256 GiB regular cache device plus a 27 TB host-managed drive) used as an md RAID5 member: after a full rebuild every chunk was mapped and no sequential zone was free, and the idle drive kept reading and writing while the free zone counters in "dmsetup status" did not change. Only switch to a random destination zone when the zone being reclaimed is a cache zone: moving it to the zoned device still frees cache space. This depends on "dm zoned: back off when reclaim cannot make progress": without it, dmz_reclaim_work() would retry the resulting -ENOSPC at once, and run dmz_check_dev(), for as long as the target stays idle. Tested on 7.4-rc1 together with the previous patch, on a two-device target (a 512 MiB RAM-backed regular cache device plus a 1 GiB scsi_debug host-managed drive) filled until no sequential zone was free, then idle for 60 seconds: the stock module made 877 random-to-random copies; with this series it made none, and each pass failed with -ENOSPC once per DMZ_IDLE_PERIOD without a device check. Fixes: c5c788595292 ("dm zoned: start reclaim with sequential zones") Cc: stable@vger.kernel.org Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@kernel.org> Signed-off-by: Kyrylo Biryuk <illofspeed@gmail.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions