From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796243117; b=FIXFdH0xxm3Kik4jt1siBv4RwhZ+gOiRSNZNE+f4BdkmhHHSFg6ZBTljDtCiY1Vdtiah o+Vs1rtw4/KR6A5KogQW+VHn0+3LOngnQq6JWhG0Y8f0kqFH56zFSRD25c4yDlLAP3T8O UUiPNpCDL5FJaIzOXplebNdBsn5M/AMnv+a4P4+J3WFLo2ziWngH87DGpi+tKiJnULSJZ ZxIA95XVt952m7J9yLC7pOcz6bUuPlkfpK0s0zil9iu+rXSo1fAl6tsK8bY3eXvgLdWGQ h8ptnCISa4udD76p6m26Wt8ur48wMjWo5PMVYpqFkZrtvxTWbgJqIMRB1TnCP/iIuPA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796243117; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=Lu7+8WxC4123gONk2bUYnZglb4xWp1cBnkB05mSW6Qo=; b=ySQxZXQWAtrTSjWoVKsrIV95YNJoCZTmMiAdtGJZ74uWAlu7q/YoWcqfr5hvBOOWI2IS VDEGaYNCHBnXt1wLg0QMkHNfOS1Y9ru/u5z6CoQzb8LMu3T7e5cp8O/NuYqii9XtLgc+T PKandkOf8iN6pCq9TE/8z26psjc6NVOu0SQIv3f9iSyLsLpnYGtn4obnPqjDg0gvMacmE l/YXagV2LFyclLjE2UZrpdqVj/oimyoJFS7NlwzR9pHvpzhwmEyN9nGk+VNV10uxNJdWG hUeB5OWkCsIFqkQgnz+GjrishVOTDWxbcrthUObSBmEt0z0yGdttdo9E4KguckAcS/w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=of7iLrWK; arc=none smtp.remote-ip=209.85.208.45 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA82A606A330 for ; Wed, 2 Dec 2026 20:25:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA82A606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=of7iLrWK Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-6b8977f2785so18213051a12.3 for ; Wed, 02 Dec 2026 12:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796243115; x=1796847915; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Lu7+8WxC4123gONk2bUYnZglb4xWp1cBnkB05mSW6Qo=; b=of7iLrWKv0C8wf0Fu6U7fXa04oncRh0+6SGoiHKMF+6pBp3l4Glgc9sV2lsao+jxRI tggf3qFEAz0T05CbBRbeHy0oUT8+fHaXWklZJvOnv15W3nlh5vEnF9MbrZ3Q/X6/7E6q grm95opRTPy02RXUfIMXszULEd1EQ7tnA3kWlLeyYwuEDR0FUNw9fgod9jYkBm50Hx9J l+2VhBJnBOX9gHcsBlGlvihi5CD+Ee1Svjn2aur5Xv6yt+As17jnW8Ktx7q1S8/JzysR 4wKNJCBEyW5R7hl451pXtHgZ9I/NHrkwstp2vWr5FGhUUXYzEjl/OQHoYp8sOWMICReo pjjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796243115; x=1796847915; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Lu7+8WxC4123gONk2bUYnZglb4xWp1cBnkB05mSW6Qo=; b=ftDFqPIf317/JEtkEEKmcGNFIl6le1LqlaVwHt1JfWQyyMZdb77IDWYnYy0JFQ3o2q a6cxyU5pDFpW3roVe6qZlwIkZuFTn6pZWxuuu4nSti+dJcSF7I47po0NK2PX0Z3XwNPp I5rtk9LZbQcVm8/B69A76o8b+2RMZTiVJf3Gwj6B5Av4NpSsayt4ep7zg03JOZWB/y1W M2EQUSU2z99xKgkgtiDg2Afvmb2WSO9zZuPeWuBJhzZjsXEicB5yGLels9h4B4zJPY8G s/tTIl8wmORbYoaH3QEjaQ3Wrs8+TSHcd6bf4MtyYBIrYZad1aBbmSzzYmvptaILHiax g7cg== X-Forwarded-Encrypted: i=1; AL+hErHc8yim8uzV2l/aoy6jXORGptCUBDZ2+1sdGC9bkxW08lI8b/f8W4RtRw6asD9dVGAG0rntuknV/0/CCo8=@vger.kernel.org X-Gm-Message-State: APuU4Z/KC7GQe4LrgH9sXTDGfWSYYB6PlaKe0L3aXN2SxnDUfYIKjB3Z UVFaUw/YNH1uqZcSYlXP5lUbOnP4/gSOYdvJ0Kr8YDcBANUwwIrSiM1Zk56o6g== X-Gm-Gg: AZFdTZecQyeIh0aeZLAsEeR6qSAQGSAOU2yF+WyryDXcKNBGzDseTmF7WeFIqaju02w pb88Mcp8I9lEfVNrtmxUzgj4XJWPNwFUcGmYAXH4zN3JRgn5T8LTJtnCJqoLxAyhG3xUYjzQ7af 1JX36MmDslpO0nJYfK5leMI6o0wpaO4DJO6iZn7mjdj1bhn2uRL6zC2U4Lz8BmiuD9B8WgmKfVQ z2EuBO92vN02RfGMZ+v8DX+LQApSYmm/1eE9l4ycECqIGAGlBCgoXfdVSRedb4QbosJ4zbCt3Xb fMsNIHCtLz4OIp9jhLu6yWvsV38AdtFJZLFsSh6BVPJRpdfCfR5uMdFv0NI8nUBS7GJ7loGUrV0 mdvwAwrJv+f0699sQ9jvGdSI9cLBhsOoEJNl4ry6sqdn1l3ejzmCtPTOu+EvFtpuku6lNpEhtwU hxp2+VJSvwEFdPUg9IDt0h2m1kv91nGHuU1bwotBPhJ0pwbxYeOcqNFFbPf5Fh0X/zvpWp5m8WE MaCwGSBEV4/ovcUvBDMNHVot2n1EBPJs6x62WN2ziE0ztg+0ZCVLCULV4oUFvXE3hChs0Fci7cB QbsG86C6iFdiTtqAm/FRaCk0Vhw9FA1eD1Yhd7NwY1YlJjzHNsvZEoTX9lBfgzz+qimFlY6zubB 5Yg== X-Received: by 2002:a05:6402:1815:b0:6ba:201b:ca31 with SMTP id 4fb4d7f45d1cf-6ba37c76a45mr23549988a12.6.1796243115177; Wed, 02 Dec 2026 12:25:15 -0800 (PST) Received: from localhost.localdomain (87-205-122-125.dynamic.inetia.pl. [87.205.122.125]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6ba370cc257sm15758547a12.13.2026.12.02.12.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 12:25:14 -0800 (PST) From: Kyrylo Biryuk 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 Message-ID: <20261202202513.664519-1-illofspeed@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261128182503.1466284-1-illofspeed@gmail.com> References: <20261128182503.1466284-1-illofspeed@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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