[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <17323677-08b1-46c3-90a8-5418d0bde9fe@cybernetics.com>
Date: Tue, 29 Jul 2025 15:01:28 -0400
From: Tony Battersby <tonyb@...ernetics.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Song Liu <song@...nel.org>, Yu Kuai <yukuai3@...wei.com>,
Christian Brauner <brauner@...nel.org>, "Darrick J. Wong"
<djwong@...nel.org>, linux-raid@...r.kernel.org, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] iomap: align writeback to RAID stripe boundaries
On 7/29/25 14:38, Matthew Wilcox wrote:
> On Tue, Jul 29, 2025 at 12:13:42PM -0400, Tony Battersby wrote:
>> Improve writeback performance to RAID-4/5/6 by aligning writes to stripe
>> boundaries. This relies on io_opt being set to the stripe size (or
>> a multiple) when BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE is set.
> When you say "aligning writes to stripe boundaries", what you actually
> seem to be doing here is sending writes down once we hit a write stripe
> boundary, instead of accumulating writes that cross stripe boundaries.
> Do I understand correctly?
>
> If so, the performance gain we see here is presumably from the DM/MD
> driver not having to split bios that cross boundaries?
>
> Further, wouldn't it be simpler to just put a new condition in
> iomap_can_add_to_ioend() rather than turning iomap_add_to_ioend()
> into a nested loop?
>
Yes, you understand correctly. The test creates a number of sequential
writes, and this patch cuts the stream of sequential bios on the stripe
boundaries rather than letting the bios span stripes, so that MD doesn't
have to do extra work for writes that cross the boundary. I am actually
working on an out-of-tree RAID driver that benefits hugely from this
because it doesn't have the complexity of the MD caching layer. But
benchmarks showed that MD benefited from it (slightly) also, so I
figured it was worth submitting.
The problem with using iomap_can_add_to_ioend() is that it returns
true/false, whereas sometimes it is necessary to add some of the folio
to the current bio and the rest to a new bio.
Tony Battersby
Cybernetics
Powered by blists - more mailing lists