[Devel] [PATCH RHEL8 COMMIT] ploop: Return md from ploop_prepare_reloc_index_wb()

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jul 2 22:43:28 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 20ceaaf506adb0a59b60d4f424c134187580291e
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Jul 2 22:43:28 2021 +0300

    ploop: Return md from ploop_prepare_reloc_index_wb()
    
    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-cmd.c | 10 ++++++----
 drivers/md/dm-ploop-map.c |  2 ++
 drivers/md/dm-ploop.h     |  4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 183524f61243..96a214f373db 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -279,6 +279,7 @@ static int ploop_grow_relocate_cluster(struct ploop *ploop,
 {
 	unsigned int new_dst, clu, dst_clu;
 	struct pio *pio = cmd->resize.pio;
+	struct md_page *md;
 	bool is_locked;
 	int ret = 0;
 
@@ -303,7 +304,7 @@ static int ploop_grow_relocate_cluster(struct ploop *ploop,
 	if (ret < 0)
 		goto out;
 
-	ret = ploop_prepare_reloc_index_wb(ploop, piwb, clu,
+	ret = ploop_prepare_reloc_index_wb(ploop, &md, piwb, clu,
 					   &new_dst);
 	if (ret < 0)
 		goto out;
@@ -315,7 +316,7 @@ static int ploop_grow_relocate_cluster(struct ploop *ploop,
 		goto out;
 	}
 
-	ploop_make_md_wb(ploop, piwb->md);
+	ploop_make_md_wb(ploop, md);
 	/* Write new index on disk */
 	ploop_submit_index_wb_sync(ploop, piwb);
 	ret = blk_status_to_errno(piwb->bi_status);
@@ -348,11 +349,12 @@ static int ploop_grow_update_header(struct ploop *ploop,
 	unsigned int size, first_block_off;
 	struct ploop_pvd_header *hdr;
 	u32 nr_be, offset, clus;
+	struct md_page *md;
 	u64 sectors;
 	int ret;
 
 	/* hdr is in the same page as bat_entries[0] index */
-	ret = ploop_prepare_reloc_index_wb(ploop, piwb, 0, NULL);
+	ret = ploop_prepare_reloc_index_wb(ploop, &md, piwb, 0, NULL);
 	if (ret)
 		return ret;
 
@@ -368,7 +370,7 @@ static int ploop_grow_update_header(struct ploop *ploop,
 	offset = hdr->m_FirstBlockOffset = cpu_to_le32(first_block_off);
 	kunmap_atomic(hdr);
 
-	ploop_make_md_wb(ploop, piwb->md);
+	ploop_make_md_wb(ploop, md);
 	ploop_submit_index_wb_sync(ploop, piwb);
 	ret = blk_status_to_errno(piwb->bi_status);
 	if (!ret) {
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index a937f3638b35..c2c5a10138d0 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1807,6 +1807,7 @@ static void handle_cleanup(struct ploop *ploop, struct pio *pio)
  * is caller duty.
  */
 int ploop_prepare_reloc_index_wb(struct ploop *ploop,
+				 struct md_page **ret_md,
 				 struct ploop_index_wb *piwb,
 				 unsigned int clu,
 				 unsigned int *dst_clu)
@@ -1836,6 +1837,7 @@ int ploop_prepare_reloc_index_wb(struct ploop *ploop,
 			goto out_reset;
 	}
 
+	*ret_md = md;
 	return 0;
 
 out_reset:
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index babdfdb7f672..5cadffba881e 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -538,8 +538,8 @@ extern int ploop_rw_page_sync(unsigned rw, struct file *file,
 			      u64 index, struct page *page);
 extern void map_and_submit_rw(struct ploop *ploop, u32 dst_clu, struct pio *pio, u8 level);
 
-extern int ploop_prepare_reloc_index_wb(struct ploop *, struct ploop_index_wb *,
-					unsigned int, unsigned int *);
+extern int ploop_prepare_reloc_index_wb(struct ploop *, struct md_page **,
+		   struct ploop_index_wb *, unsigned int, unsigned int *);
 extern void ploop_reset_bat_update(struct ploop_index_wb *);
 extern void ploop_submit_index_wb_sync(struct ploop *, struct ploop_index_wb *);
 extern int ploop_message(struct dm_target *ti, unsigned int argc, char **argv,


More information about the Devel mailing list