[Devel] [PATCH RHEL8 COMMIT] ploop: Move alloc wq up

Konstantin Khorenko khorenko at virtuozzo.com
Tue May 11 18:30:58 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.27
------>
commit 09d22e762541a6774a917df2a465da9d39eef535
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue May 11 18:30:58 2021 +0300

    ploop: Move alloc wq up
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    ploop: Preparation to kill-loop from dm-ploop (series 4)
    
    Currently, ploop requires underlining loop for top delta. This is overkill,
    since we may submit bios directly to fs, without using it.
    
    Initially there was a possibility, we may use device-mapper format snapshots
    instead of ploop-based. But we don't do that, so we have to use loop for top
    delta and directly submit bios to the rest of deltas. So, these two ways to do
    the same actions are wrong.
    
    This is preparations #3 for further series.
    Let's this goes to testing earlier.
    
    Kirill Tkhai (8):
          ploop: Fix prealloc_md_pages() defaults
          ploop: Move alloc wq up
          ploop: Pass nr_deltas to parse_bat_entries()
          ploop: Pass @ploop to md_page_cluster_is_in_top_delta()
          ploop: Kill "message snapshot" interface
          ploop: Introduce top_level()
          ploop: Do not try to track bios on resize
          ploop: Make fields in dm_ploop_endio_hook separate
    
    https://jira.sw.ru/browse/PSBM-123654
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-target.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 155327242fc5..a07cee3fea46 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -241,6 +241,13 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto err;
 	}
 
+	ploop->wq = alloc_ordered_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM);
+	if (!ploop->wq) {
+		ti->error = "could not create workqueue for metadata object";
+		ret = -ENOMEM;
+		goto err;
+	}
+
 	/*
 	 * We do not add FMODE_EXCL, because further open_table_device()
 	 * unconditionally adds it. See call stack.
@@ -258,14 +265,6 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto err;
 	}
 
-	ret = -ENOMEM;
-
-	ploop->wq = alloc_ordered_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM);
-	if (!ploop->wq) {
-		ti->error = "could not create workqueue for metadata object";
-		goto err;
-	}
-
 	ret = ploop_add_deltas_stack(ploop, &argv[2], argc - 2);
 	if (ret)
 		goto err;


More information about the Devel mailing list