On 9/10/25 19:27, Bart Van Assche wrote:
The dm core splits REQ_PREFLUSH bios that have data into two bios.
First, a REQ_PREFLUSH bio with no data is submitted to all underlying
dm devices. Next, the REQ_PREFLUSH flag is cleared and the same bio is
resubmitted. This approach is essential if there are multiple underlying
devices to provide correct REQ_PREFLUSH semantics.
Splitting a bio into an empty flush bio and a non-flush data bio is
not necessary if there is only a single underlying device. Hence this
patch that does not split REQ_PREFLUSH bios if there is only one
underlying device.
This patch preserves the order of REQ_PREFLUSH writes if there is only
one underlying device and if one or more write bios have been queued
past the REQ_PREFLUSH bio before the REQ_PREFLUSH bio is processed.
Cc: Mike Snitzer <[email protected]>
Cc: Damien Le Moal <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
---
Changes compared to v1:
- Made the patch description more detailed.
- Removed the reference to write pipelining from the patch description.
drivers/md/dm.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
Hmm. But if additional writes can sneak in between sending the empty
flush and the original write bio, why does that happen only for targets
with one device?
IOW: Doesn't this reordering also happen for targets with several
devices?
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
[email protected] +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich