[Devel] [PATCH RHEL8 COMMIT] ploop: Use defer_pios() instead of manual code

Konstantin Khorenko khorenko at virtuozzo.com
Tue Jun 29 16:08:14 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.50
------>
commit 5351620a667349d65f69a64b46744006f0788385
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Jun 29 16:08:14 2021 +0300

    ploop: Use defer_pios() instead of manual code
    
    Use generic code
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    ==========================
    Preparation for #PSBM-124550 (part 2)
    
    Kirill Tkhai (14):
          ploop: Kill "get_delta_name" alias
          ploop: Use initial pio for COW
          ploop: Rename cluster_pio into aux_pio
          ploop: Shorten variable names
          ploop: Rename in submit_cluster_write()
          ploop: Use defer_pios() instead of manual code
          ploop: Use array of pios instead of separate lists
          ploop: Generalize dispatch_pios usage
          ploop: Unify process_delta_wb()
          ploop: Remove unused struct member
          ploop: Rename page_nr
          ploop: Return md page from ploop_bat_entries()
          ploop: Kill dead check in ploop_attach_end_action()
          ploop: Delay bio if md page is BUSY
---
 drivers/md/dm-ploop-map.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 9bf3554d4f95..1f34ebcc0b6a 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -417,19 +417,13 @@ static void del_cluster_lk(struct ploop *ploop, struct pio *pio)
 {
 	LIST_HEAD(pio_list);
 	unsigned long flags;
-	bool queue = false;
 
 	spin_lock_irqsave(&ploop->deferred_lock, flags);
 	unlink_pio(ploop, pio, &pio_list);
-	if (!list_empty(&pio_list)) {
-		list_splice_tail(&pio_list, &ploop->deferred_pios);
-		queue = true;
-	}
 	spin_unlock_irqrestore(&ploop->deferred_lock, flags);
 
-	if (queue)
-		queue_work(ploop->wq, &ploop->worker);
-
+	if (!list_empty(&pio_list))
+		defer_pios(ploop, NULL, &pio_list);
 }
 
 static void link_submitting_pio(struct ploop *ploop, struct pio *pio,
@@ -453,13 +447,8 @@ static void unlink_completed_pio(struct ploop *ploop, struct pio *pio)
 	unlink_pio(ploop, pio, &pio_list);
 	spin_unlock_irqrestore(&ploop->inflight_lock, flags);
 
-	if (!list_empty(&pio_list)) {
-		spin_lock_irqsave(&ploop->deferred_lock, flags);
-		list_splice_tail(&pio_list, &ploop->deferred_pios);
-		spin_unlock_irqrestore(&ploop->deferred_lock, flags);
-
-		queue_work(ploop->wq, &ploop->worker);
-	}
+	if (!list_empty(&pio_list))
+		defer_pios(ploop, NULL, &pio_list);
 }
 
 static bool pio_endio_if_all_zeros(struct pio *pio)


More information about the Devel mailing list