[Devel] [PATCH RHEL8 COMMIT] ploop: Make split_pios_to_list() to add initial pio to the list too

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jul 2 22:47:59 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.51
------>
commit 1166f8fe71143936e7de9bff179003385cd00bc4
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Jul 2 22:47:59 2021 +0300

    ploop: Make split_pios_to_list() to add initial pio to the list too
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    ==========================
    ploop: Split pios in kwork
    
    https://jira.sw.ru/browse/PSBM-131208
    
    Kirill Tkhai (10):
          ploop: Remove debug noinline in create_bvec_from_rq()
          ploop: Manage flush pios in generic way
          ploop: Teach dispatch_pios() work with flush pios
          ploop: Make split_pios_to_list() to add initial pio to the list too
          ploop: Introduce embedded_pio_to_prq()
          ploop: Introduce ploop_prq_valid()
          ploop: Move create_bvec_from_rq() up
          ploop: Split pios from kwork context
          ploop: Add sanity check of passed BAT from disk
          ploop: Reread file size after index update
---
 drivers/md/dm-ploop-map.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index a4cc8de169c4..692cf1e80936 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -196,10 +196,11 @@ static struct pio * split_and_chain_pio(struct ploop *ploop,
 }
 
 static int split_pio_to_list(struct ploop *ploop, struct pio *pio,
-			     struct list_head *list)
+			     struct list_head *ret_list)
 {
 	u32 clu_size = CLU_SIZE(ploop);
 	struct pio *split;
+	LIST_HEAD(list);
 
 	while (1) {
 		loff_t start = to_bytes(pio->bi_iter.bi_sector);
@@ -217,12 +218,14 @@ static int split_pio_to_list(struct ploop *ploop, struct pio *pio,
 		if (!split)
 			goto err;
 
-		list_add_tail(&split->list, list);
+		list_add_tail(&split->list, &list);
 	}
 
+	list_splice_tail(&list, ret_list);
+	list_add_tail(&pio->list, ret_list);
 	return 0;
 err:
-	while ((pio = pio_list_pop(list)) != NULL) {
+	while ((pio = pio_list_pop(&list)) != NULL) {
 		pio->bi_status = BLK_STS_RESOURCE;
 		pio_endio(pio);
 	}
@@ -1737,10 +1740,9 @@ static void submit_pio(struct ploop *ploop, struct pio *pio)
 
 		if (WARN_ON_ONCE(pio->bi_op != REQ_OP_FLUSH))
 			goto kill;
+		list_add_tail(&pio->list, &list);
 	}
 
-	list_add(&pio->list, &list);
-
 	spin_lock_irqsave(&ploop->deferred_lock, flags);
 	if (unlikely(ploop->stop_submitting_pios)) {
 		list_splice_tail(&list, &ploop->suspended_pios);


More information about the Devel mailing list