[Devel] [PATCH RHEL9 COMMIT] Revert "drivers/vhost: add ioctl to increase the number of workers"

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 368c7af3e8a63dd1a855e4cb41c094d897e48bb2
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Wed Nov 16 15:56:10 2022 +0300

    Revert "drivers/vhost: add ioctl to increase the number of workers"
    
    This reverts commit 83860720697fc673ea32138b92835f40ebdbea60.
    
    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      | 32 +-------------------------------
 include/uapi/linux/vhost.h |  9 ---------
 2 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 9066241e8dc6..0542eab1e815 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -656,25 +656,6 @@ static int vhost_add_worker(struct vhost_dev *dev)
 	return err;
 }
 
-static int vhost_set_workers(struct vhost_dev *dev, int n)
-{
-	int i, ret;
-
-	if (n > dev->nvqs)
-		n = dev->nvqs;
-
-	if (n > VHOST_MAX_WORKERS)
-		n = VHOST_MAX_WORKERS;
-
-	for (i = 0; i < n - dev->nworkers ; i++) {
-		ret = vhost_add_worker(dev);
-		if (ret)
-			break;
-	}
-
-	return ret;
-}
-
 /* Caller should have device mutex */
 long vhost_dev_set_owner(struct vhost_dev *dev)
 {
@@ -1828,7 +1809,7 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
 	struct eventfd_ctx *ctx;
 	u64 p;
 	long r;
-	int i, fd, n;
+	int i, fd;
 
 	/* If you are not the owner, you can become one */
 	if (ioctl == VHOST_SET_OWNER) {
@@ -1885,17 +1866,6 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp)
 		if (ctx)
 			eventfd_ctx_put(ctx);
 		break;
-	case VHOST_SET_NWORKERS:
-		r = get_user(n, (int __user *)argp);
-		if (r < 0)
-			break;
-		if (n < d->nworkers) {
-			r = -EINVAL;
-			break;
-		}
-
-		r = vhost_set_workers(d, n);
-		break;
 	default:
 		r = -ENOIOCTLCMD;
 		break;
diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
index d6d87f6315f6..13caf114bcde 100644
--- a/include/uapi/linux/vhost.h
+++ b/include/uapi/linux/vhost.h
@@ -71,15 +71,6 @@
 #define VHOST_SET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_state)
 #define VHOST_GET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x14, struct vhost_vring_state)
 
-/* Set number of vhost workers
- * Currently nuber of vhost workers can only be increased.
- * All workers are freed upon reset.
- * If the value is too big it is silently truncated to the maximum number of
- * supported vhost workers
- * Even if the error is returned it is possible that some workers were created
- */
-#define VHOST_SET_NWORKERS _IOW(VHOST_VIRTIO, 0x1F, int)
-
 /* The following ioctls use eventfd file descriptors to signal and poll
  * for events. */
 


More information about the Devel mailing list