From: Kyrylo Biryuk <illofspeed@gmail.com>
To: dm-devel@lists.linux.dev
Cc: mpatocka@redhat.com, snitzer@kernel.org, agk@redhat.com,
bmarzins@redhat.com, dlemoal@kernel.org, hare@kernel.org,
hare@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8] dm zoned: keep polling for idle reclaim after a reclaim pass
Date: Wed, 2 Dec 2026 21:25:13 +0100 [thread overview]
Message-ID: <20261202202513.664519-1-illofspeed@gmail.com> (raw)
In-Reply-To: <20261128182503.1466284-1-illofspeed@gmail.com>
Please hold the "[PATCH v8] dm zoned: keep polling for idle reclaim after a
reclaim pass" patch. I found a write amplification problem that it allows,
and I am working on a new version.
With the idle poll always armed, the idle rule of dmz_should_reclaim()
(mainline: the target has been idle for DMZ_IDLE_PERIOD, 10 seconds, and
has random zones) keeps starting reclaim passes. By my reading of the
code, a chunk with a buffer zone is then merged about 10 seconds after
the last I/O to the target, which copies the chunk's valid data (up to
256 MiB); I did not trace individual merges. A workload that writes
small amounts periodically therefore keeps causing chunk-sized rewrites
while it is otherwise idle. My v8 tests wrote bursts and then checked
that the zones drained while idle; they did not include periodic small
writes.
I saw it with a Synology DSM guest (a NAS operating system) running a
5-disk RAID6 that had three single-device dm-zoned targets as members,
each on an emulated host-managed disk (zloop, 62 random zones of
256 MiB). The module was built from the v7.0 dm-zoned sources and run on
a 7.0.14-30-pve kernel. It carried four local patches (the two v7 fixes, a
version of the idle polling patch from the earlier series that re-arms
the poll at the end of every pass, and a check that idle reclaim needs a
random or cache zone holding data) and the v8 hunk. I did not run v8
alone on this workload.
During an 8-minute window (493 s) with the guest idle and all random
zones already free:
- each target received about 0.23 MiB from the guest;
- each backing disk was written 6,131 to 6,643 MiB (about 12.4 to 13.5
MiB/s), or about 26,000 to 28,000 times the data written to the
target. That write volume equals about 24 to 26 full-zone copies in 8
minutes.
The stock module of the same kernel on the same disks, idle for 472 s:
- each target received 2.6 to 3.2 MiB;
- each backing disk was written 2.8 to 3.3 MiB (write amplification
1.02 to 1.04).
During three guest reboots the write amplification on the backing disks,
from the reboot command until the web UI was up, was 22.7 to 47.1 times
with the polling module (22.7 to 31.1 times for the second and third
reboots alone; the first started 91 s after a write burst with 7 to 8
random zones still in use). The time from the reboot command to the web
UI was 342 to 414 s with the polling module. One reboot with the stock
module gave 1.01 to 1.02 and 301 s. The stock module did not drain the
random zones at idle (43 of 62 stayed free); the polling module did (62
of 62), at that price. In a later run, the first boot after the stock
module was loaded, with 38 of 62 random zones free, gave 10.2 to 17.1.
I have tested one candidate change since then: at idle, merge a chunk
only if it has been quiet for 600 s and fewer than 60 % of the random
zones are free. In a steady idle hour on the same setup it did no merges
(write amplification 1.00). But the guest's own boot writes lowered the
free random zones from 38 of 62 (61 %) to 35 to 37 of 62 (56 to 60 %),
below that threshold, and the following reboot windows still merged
chunks (7 of 9 target windows, the first one included; write
amplification up to about 7 on a target, 256 MiB per merge). This
candidate therefore does not solve the reboot case. I am not proposing a
fix yet. I will follow up when a version has been tested against guest
reboots as well as periodic small writes.
I used LLM coding assistants for the test harnesses, the analysis of the
results and the draft of this message. I reviewed the results and I am
responsible for this message.
Thanks,
Kyrylo
prev parent reply other threads:[~2026-12-02 20:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 18:25 Kyrylo Biryuk
2026-12-02 20:25 ` Kyrylo Biryuk [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261202202513.664519-1-illofspeed@gmail.com \
--to=illofspeed@gmail.com \
--cc=agk@redhat.com \
--cc=bmarzins@redhat.com \
--cc=dlemoal@kernel.org \
--cc=dm-devel@lists.linux.dev \
--cc=hare@kernel.org \
--cc=hare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=snitzer@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®