diff options
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/vhost.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 30d93c2b45b8..dd2d019b889f 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/highmem.h> | 23 | #include <linux/highmem.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/kthread.h> | 25 | #include <linux/kthread.h> |
26 | #include <linux/cgroup.h> | ||
26 | 27 | ||
27 | #include <linux/net.h> | 28 | #include <linux/net.h> |
28 | #include <linux/if_packet.h> | 29 | #include <linux/if_packet.h> |
@@ -253,9 +254,14 @@ static long vhost_dev_set_owner(struct vhost_dev *dev) | |||
253 | } | 254 | } |
254 | 255 | ||
255 | dev->worker = worker; | 256 | dev->worker = worker; |
257 | err = cgroup_attach_task_current_cg(worker); | ||
258 | if (err) | ||
259 | goto err_cgroup; | ||
256 | wake_up_process(worker); /* avoid contributing to loadavg */ | 260 | wake_up_process(worker); /* avoid contributing to loadavg */ |
257 | 261 | ||
258 | return 0; | 262 | return 0; |
263 | err_cgroup: | ||
264 | kthread_stop(worker); | ||
259 | err_worker: | 265 | err_worker: |
260 | if (dev->mm) | 266 | if (dev->mm) |
261 | mmput(dev->mm); | 267 | mmput(dev->mm); |