From 46df73f20f02dc487aa41817b7d1da16662d89c9 Mon Sep 17 00:00:00 2001 From: Jamie Pryde Date: Thu, 4 Sep 2025 11:52:53 +0100 Subject: [PATCH] osd: Choose PDW over traditional RMW if number of reads required is equal We currently only choose to do a parity delta write if the number of reads required is fewer than for a traditional read modify write. Performance testing shows a small benefit to doing PDW for random I/O workloads when the number of reads is the same. Signed-off-by: Jamie Pryde --- src/osd/ECTransaction.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/ECTransaction.cc b/src/osd/ECTransaction.cc index 4785e661314c..177e703ad918 100644 --- a/src/osd/ECTransaction.cc +++ b/src/osd/ECTransaction.cc @@ -220,10 +220,10 @@ ECTransaction::WritePlanObj::WritePlanObj( // Some kind of reconstruct is needed for conventional, but NOT for PDW! do_parity_delta_write = true; } else { - /* Everything we need for both is available, opt for which ever is less - * reads. + /* Everything we need for both is available, opt for whichever is fewer + * reads. Choose PDW in a tie as it's slightly more performant at random I/O. */ - do_parity_delta_write = pdw_read_shards.size() < read_shards.size(); + do_parity_delta_write = pdw_read_shards.size() <= read_shards.size(); } if (do_parity_delta_write) { -- 2.47.3