[Devel] [PATCH RHEL9 COMMIT] Revert "drivers/vhost: rework attaching cgroups to be worker aware"

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 16 17:03:17 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-70.22.1.vz9.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-70.22.1.vz9.17.9
------>
commit c56b32e5de292725a3861a70182f815e53994250
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Wed Nov 16 15:56:14 2022 +0300

    Revert "drivers/vhost: rework attaching cgroups to be worker aware"
    
    This reverts commit 534c9b7a50c0111ec3460afb56a806f5ee75f574.
    
    Will apply v5 of the patchset.
    https://jira.sw.ru/browse/PSBM-139414
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 drivers/vhost/vhost.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 5199495d948a..bcdbbec06ddf 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -262,16 +262,6 @@ void vhost_work_dev_flush(struct vhost_dev *dev)
 }
 EXPORT_SYMBOL_GPL(vhost_work_dev_flush);
 
-static void vhost_worker_flush(struct vhost_worker *w)
-{
-	struct vhost_flush_struct flush;
-
-	init_completion(&flush.wait_event);
-	vhost_work_init(&flush.work, vhost_flush_work);
-	vhost_work_queue_at_worker(w, &flush.work);
-	wait_for_completion(&flush.wait_event);
-}
-
 /* Flush any work that has been scheduled. When calling this, don't hold any
  * locks that are also used by the callback. */
 void vhost_poll_flush(struct vhost_poll *poll)
@@ -577,14 +567,14 @@ static void vhost_attach_cgroups_work(struct vhost_work *work)
 	s->ret = cgroup_attach_task_all(s->owner, current);
 }
 
-static int vhost_worker_attach_cgroups(struct vhost_worker *w)
+static int vhost_attach_cgroups(struct vhost_dev *dev)
 {
 	struct vhost_attach_cgroups_struct attach;
 
 	attach.owner = current;
 	vhost_work_init(&attach.work, vhost_attach_cgroups_work);
-	vhost_work_queue_at_worker(w, &attach.work);
-	vhost_worker_flush(w);
+	vhost_work_queue(dev, &attach.work);
+	vhost_work_dev_flush(dev);
 	return attach.ret;
 }
 
@@ -652,7 +642,7 @@ long vhost_dev_set_owner(struct vhost_dev *dev)
 		dev->nworkers = 1;
 		wake_up_process(worker); /* avoid contributing to loadavg */
 
-		err = vhost_worker_attach_cgroups(&dev->workers[0]);
+		err = vhost_attach_cgroups(dev);
 		if (err)
 			goto err_cgroup;
 	}


More information about the Devel mailing list