Skip to contentSkip to conversation

Make vhost multi-threaded and associate each thread to its guest's cgroup

DISCUSSION Michael S. Tsirkin 2 participants 3 messages Jul 27, 2010 – Jul 28, 2010

Subsystems (4)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

Sridhar,
I pushed a patchset with all known issues fixed,
on my vhost-net-next branch.

For now this ignores the cpu mask issue, addressing only the cgroups issue.

Would appreciate testing and reports.

Thanks,

Signature · 1 line
MST
#1 lore raw
Quoted 8 lines · Michael S. Tsirkin

Sridhar,
I pushed a patchset with all known issues fixed,
on my vhost-net-next branch.

For now this ignores the cpu mask issue, addressing only the cgroups issue.

Would appreciate testing and reports.

I had to apply the following patch to get it build. With this patch, i am seeing similar results as i saw earlier.

Thanks
Sridhar

drivers/vhost/vhost.c +2 -1
index 996e751..8543898 100644
@@ -23,6 +23,7 @@
 #include <linux/highmem.h>
 #include <linux/slab.h>
 #include <linux/kthread.h>
+#include <linux/cgroup.h>
 
 #include <linux/net.h>
 #include <linux/if_packet.h>
@@ -252,7 +253,7 @@ static long vhost_dev_set_owner(struct vhost_dev *dev)
 	}
 
 	dev->worker = worker;
-	err = cgroup_attach_task_current_cg(poller);
+	err = cgroup_attach_task_current_cg(worker);
 	if (err)
 		goto err_cgroup;
 	wake_up_process(worker);	/* avoid contributing to loadavg */
author maintainer
#2 lore raw
Quoted 8 lines · Sridhar Samudrala
Quoted 7 lines · Michael S. Tsirkin

Sridhar,
I pushed a patchset with all known issues fixed,
on my vhost-net-next branch.

For now this ignores the cpu mask issue, addressing only the cgroups issue.

Quoted 7 lines
Quoted 1 line

Would appreciate testing and reports.

I had to apply the following patch to get it build. With this patch, i am seeing similar results as i saw earlier.

Thanks
Sridhar

Excellent, thanks for the testing.

Quoted 22 lines
drivers/vhost/vhost.c +2 -1
index 996e751..8543898 100644
@@ -23,6 +23,7 @@
 #include <linux/highmem.h>
 #include <linux/slab.h>
 #include <linux/kthread.h>
+#include <linux/cgroup.h>
 
 #include <linux/net.h>
 #include <linux/if_packet.h>
@@ -252,7 +253,7 @@ static long vhost_dev_set_owner(struct vhost_dev *dev)
 	}
 
 	dev->worker = worker;
-	err = cgroup_attach_task_current_cg(poller);
+	err = cgroup_attach_task_current_cg(worker);
 	if (err)
 		goto err_cgroup;
 	wake_up_process(worker);	/* avoid contributing to loadavg */