[Devel] [PATCH RHEL8 COMMIT] ploop: Resubmit pios from main kwork

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jul 2 22:43:31 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.6.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.el8
------>
commit 1b3852f7a6e306340cc84facee781850c59a87c9
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Jul 2 22:43:30 2021 +0300

    ploop: Resubmit pios from main kwork
    
    Move it to main work after md writeback is async.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    ==========================
    Parallel async BAT pages submission and improvements
    
    [1-15]:
    https://jira.sw.ru/browse/PSBM-124550
    
    [16-22]:
    following improvements
    
    Kirill Tkhai (22):
          ploop: Remove absolet comment
          ploop: Add md and piwb cross pointers
          ploop: Add @md argument to locate_new_cluster_and_attach_pio()
          ploop: Refactoring in process_one_discard_pio()
          ploop: Pass type argument to ploop_prepare_bat_update()
          ploop: Move md is busy check to delay_if_md_busy()
          ploop: Introduce batch list for md pages writeback
          ploop: Check for md dirty instead of md piwb
          ploop: Reread piwb after ploop_prepare_bat_update()
          ploop: Change argument in ploop_prepare_bat_update()
          ploop: Return md from ploop_prepare_reloc_index_wb()
          ploop: Change arguments and rename ploop_reset_bat_update()
          ploop: Allow parallel wb of md pages
          ploop: Async md writeback
          ploop: Rename ploop_submit_index_wb_sync()
          ploop: Resubmit pios from main kwork
          ploop: Rename process_delta_wb()
          ploop: Do fsync after bat page write
          ploop: Do not iterate excess clusters in notify_delta_merged()
          ploop: Use kvec in ploop_delta_check_header()
          ploop: Add argument to ploop_read_delta_metadata()
          ploop: Underline clu and page is u32
---
 drivers/md/dm-ploop-map.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index ce887a885017..deb6f3bf2c60 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1062,7 +1062,7 @@ static void ploop_queue_resubmit(struct pio *pio)
 	list_add_tail(&pio->list, &ploop->resubmit_pios);
 	spin_unlock_irqrestore(&ploop->deferred_lock, flags);
 
-	queue_work(ploop->wq, &ploop->fsync_worker);
+	queue_work(ploop->wq, &ploop->worker);
 }
 
 void ploop_enospc_timer(struct timer_list *timer)
@@ -1074,7 +1074,7 @@ void ploop_enospc_timer(struct timer_list *timer)
 	list_splice_init(&ploop->enospc_pios, &ploop->resubmit_pios);
 	spin_unlock_irqrestore(&ploop->deferred_lock, flags);
 
-	queue_work(ploop->wq, &ploop->fsync_worker);
+	queue_work(ploop->wq, &ploop->worker);
 }
 
 void ploop_event_work(struct work_struct *ws)
@@ -1617,16 +1617,19 @@ void do_ploop_work(struct work_struct *ws)
 	LIST_HEAD(deferred_pios);
 	LIST_HEAD(discard_pios);
 	LIST_HEAD(cow_pios);
+	LIST_HEAD(resubmit_pios);
 	unsigned int pf_io_thread = (current->flags & PF_IO_THREAD);
 
 	current->flags |= PF_IO_THREAD;
 
 	spin_lock_irq(&ploop->deferred_lock);
+	list_splice_init(&ploop->resubmit_pios, &resubmit_pios);
 	list_splice_init(&ploop->pios[PLOOP_LIST_DEFERRED], &deferred_pios);
 	list_splice_init(&ploop->pios[PLOOP_LIST_DISCARD], &discard_pios);
 	list_splice_init(&ploop->pios[PLOOP_LIST_COW], &cow_pios);
 	spin_unlock_irq(&ploop->deferred_lock);
 
+	process_resubmit_pios(ploop, &resubmit_pios);
 	process_deferred_pios(ploop, &deferred_pios);
 	process_discard_pios(ploop, &discard_pios);
 	process_delta_wb(ploop, &cow_pios);
@@ -1639,7 +1642,6 @@ void do_ploop_work(struct work_struct *ws)
 void do_ploop_fsync_work(struct work_struct *ws)
 {
 	struct ploop *ploop = container_of(ws, struct ploop, fsync_worker);
-	LIST_HEAD(resubmit_pios);
 	LIST_HEAD(flush_pios);
 	struct file *file;
 	struct pio *pio;
@@ -1647,15 +1649,8 @@ void do_ploop_fsync_work(struct work_struct *ws)
 
 	spin_lock_irq(&ploop->deferred_lock);
 	list_splice_init(&ploop->flush_pios, &flush_pios);
-	list_splice_init(&ploop->resubmit_pios, &resubmit_pios);
 	spin_unlock_irq(&ploop->deferred_lock);
 
-	/*
-	 * FIXME: move this to main kwork, after BAT write
-	 * will be made async.
-	 */
-	process_resubmit_pios(ploop, &resubmit_pios);
-
 	file = top_delta(ploop)->file;
 	ret = vfs_fsync(file, 0);
 


More information about the Devel mailing list