Add a writable fast_path module parameter, on by default. When it is
off, every split of a request goes to the main kwork deferred list,
as before the fast path, so the fast path can be turned off at
runtime if it misbehaves, and the two modes can be compared on the
same device.

It is checked for each split in qio_try_fast(), so a change applies
to the splits prepared after it. Splits already on the fast path
complete there.

https://virtuozzo.atlassian.net/browse/VSTOR-95494
Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Andrey Zhadchenko <[email protected]>
---
v3: new patch

 drivers/md/dm-qcow2-map.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index fb2a1c7c42111..5d70ab5d68f4c 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -15,6 +15,11 @@
 #include "dm-rq.h"
 #include "dm-qcow2.h"
 
+static bool fast_path = true;
+module_param(fast_path, bool, 0644);
+MODULE_PARM_DESC(fast_path,
+               "Process qios not changing metadata outside main kwork");
+
 /* "Exactly one bit" has the same number in L1 and L2 */
 #define LX_REFCOUNT_EXACTLY_ONE (1ULL << 63)
 #define L1_RESERVED_ZERO_MASK 0x7F000000000001FFULL
@@ -4821,7 +4826,7 @@ static void qio_try_fast(struct qio *qio, struct 
list_head *deferred_qios)
 {
        list_del(&qio->link);
 
-       if (process_one_qio(qio->qcow2, qio, true))
+       if (!READ_ONCE(fast_path) || process_one_qio(qio->qcow2, qio, true))
                list_add_tail(&qio->link, deferred_qios);
 }
 
-- 
2.43.5

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to