Re: [RFC PATCH] mdadm: add --fast-initialize
From: Mariusz Tkaczyk <hidden>
Date: 2024-06-10 08:57:32
On Tue, 4 Jun 2024 10:19:59 -0600 Logan Gunthorpe [off-list ref] wrote:
On 2024-06-04 06:46, Xiao Ni wrote:quoted
Hi Mariusz The discard can't promise to write zero to nvme disks, right? If so, we can't use it for resync, because it can't make sure the raid is in sync state.Yes, discard requests are a best effort and the drive is free to ignore some or all of the request. See [1] for more information from Martin Peterson. I think if we have a device that has a fast zero operation that we know guarantees zeroing then the kernel's write-zeros operation should be changed to use it. We shouldn't make fast-but-dangerous options in mdadm. Thanks, Logan [1] https://lore.kernel.org/all/yq1fsgwbijv.fsf@ca-mkp.ca.oracle.com/T/#u (local)
Thanks for giving the valuable feedback. I'm not directly involved in technical details about this implementation and in fact I didn't read the previous discussion yet. You pointed great problem and I will make sure that it is addressed. I asked about mdadm API, it is despite the technical implementation. I would like to propose one command to integrate existing way (--write-zeroes) and potentially new way (if any other fast-initialization capability would be safe to add). Do you see it as right approach or we should keep them separately? Mariusz