login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
May
»
31
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost pollers
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Li Zefan
Subject:
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost pollers
Date: Sunday, May 30, 2010 - 6:11 pm
Tejun Heo wrote:
quoted text
> Apply the cpumask and cgroup of the initializing task to the created > vhost poller. > > Based on Sridhar Samudrala's patch. > > Cc: Michael S. Tsirkin <mst@redhat.com> > Cc: Sridhar Samudrala <samudrala.sridhar@gmail.com> > --- > drivers/vhost/vhost.c | 36 +++++++++++++++++++++++++++++++----- > 1 file changed, 31 insertions(+), 5 deletions(-) > > Index: work/drivers/vhost/vhost.c > =================================================================== > --- work.orig/drivers/vhost/vhost.c > +++ work/drivers/vhost/vhost.c > @@ -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> > @@ -176,12 +177,30 @@ repeat: > long vhost_dev_init(struct vhost_dev *dev, > struct vhost_virtqueue *vqs, int nvqs) > { > - struct task_struct *poller; > - int i; > + struct task_struct *poller = NULL; > + cpumask_var_t mask; > + int i, ret = -ENOMEM; > + > + if (!alloc_cpumask_var(&mask, GFP_KERNEL)) > + goto out; >
If we "goto out", we will end up calling kthread_stop(poller), but seems kthread_stop() requires the task_struct pointer != NULL.
quoted text
> poller = kthread_create(vhost_poller, dev, "vhost-%d", current->pid); > - if (IS_ERR(poller)) > - return PTR_ERR(poller); > + if (IS_ERR(poller)) { > + ret = PTR_ERR(poller); > + goto out; > + } > + > + ret = sched_getaffinity(current->pid, mask); > + if (ret) > + goto out; > + > + ret = sched_setaffinity(poller->pid, mask); > + if (ret) > + goto out; > + > + ret = cgroup_attach_task_current_cg(poller); > + if (ret) > + goto out; > > dev->vqs = vqs; > dev->nvqs = nvqs; > @@ -202,7 +221,14 @@ long vhost_dev_init(struct vhost_dev *de > vhost_poll_init(&dev->vqs[i].poll, > dev->vqs[i].handle_kick, POLLIN, dev); > } > - return 0; > + > + wake_up_process(poller); /* avoid contributing to loadavg */ > + ret = 0; > +out: > + if (ret) > + kthread_stop(poller); > + free_cpumask_var(mask); > + return ret; > } > > /* Caller should have device mutex */
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 2/3] workqueue: Add an API to create a singlethread ...
, Sridhar Samudrala
, (Tue May 18, 5:04 pm)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Michael S. Tsirkin
, (Thu May 27, 2:14 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Oleg Nesterov
, (Thu May 27, 5:44 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Michael S. Tsirkin
, (Thu May 27, 6:12 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Tejun Heo
, (Thu May 27, 9:15 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Sridhar Samudrala
, (Thu May 27, 9:24 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Michael S. Tsirkin
, (Thu May 27, 9:41 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Tejun Heo
, (Thu May 27, 9:56 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Oleg Nesterov
, (Thu May 27, 10:30 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Michael S. Tsirkin
, (Thu May 27, 10:32 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Tejun Heo
, (Thu May 27, 2:20 pm)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Michael S. Tsirkin
, (Fri May 28, 8:08 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Tejun Heo
, (Fri May 28, 8:54 am)
Re: [PATCH 2/3] workqueue: Add an API to create a singleth ...
, Michael S. Tsirkin
, (Sun May 30, 4:29 am)
[PATCH 3/3] vhost: apply cpumask and cgroup to vhost pollers
, Tejun Heo
, (Sun May 30, 1:25 pm)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost p ...
, Li Zefan
, (Sun May 30, 6:11 pm)
[PATCH UPDATED 3/3] vhost: apply cpumask and cgroup to vho ...
, Tejun Heo
, (Sun May 30, 11:58 pm)
Re: [PATCH 2/3] cgroups: Add an API to attach a task to cu ...
, Tejun Heo
, (Mon May 31, 12:00 am)
Re: [PATCH UPDATED 3/3] vhost: apply cpumask and cgroup to ...
, Li Zefan
, (Mon May 31, 12:48 am)
Re: [PATCH UPDATED2 3/3] vhost: apply cpumask and cgroup t ...
, Tejun Heo
, (Mon May 31, 3:20 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Oleg Nesterov
, (Mon May 31, 7:39 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Tejun Heo
, (Mon May 31, 8:07 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Michael S. Tsirkin
, (Mon May 31, 8:22 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Oleg Nesterov
, (Mon May 31, 8:31 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Tejun Heo
, (Mon May 31, 8:38 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Tejun Heo
, (Mon May 31, 8:45 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Michael S. Tsirkin
, (Mon May 31, 9:00 am)
[PATCH 3/3] vhost: apply cpumask and cgroup to vhost workers
, Tejun Heo
, (Tue Jun 1, 2:35 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost w ...
, Michael S. Tsirkin
, (Tue Jun 1, 3:17 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost w ...
, Tejun Heo
, (Tue Jun 1, 3:56 am)
Re: [PATCH 1/3] vhost: replace vhost_workqueue with per-vh ...
, Paul E. McKenney
, (Tue Jun 1, 7:13 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost w ...
, Sridhar Samudrala
, (Tue Jun 1, 10:19 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost w ...
, Tejun Heo
, (Tue Jun 1, 4:59 pm)
[PATCH UPDATED 1/3] vhost: replace vhost_workqueue with pe ...
, Tejun Heo
, (Wed Jun 2, 11:40 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Sridhar Samudrala
, (Wed Jun 2, 2:34 pm)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost p ...
, Michael S. Tsirkin
, (Thu Jun 24, 1:11 am)
Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost p ...
, Sridhar Samudrala
, (Thu Jun 24, 3:45 pm)
[PATCH] sched: export sched_set/getaffinity (was Re: [PATC ...
, Michael S. Tsirkin
, (Fri Jun 25, 3:10 am)
[PATCH repost] sched: export sched_set/getaffinity to modules
, Michael S. Tsirkin
, (Thu Jul 1, 4:07 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 4:19 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 4:43 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Thu Jul 1, 4:55 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Thu Jul 1, 5:23 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 5:32 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 5:34 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 5:46 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Thu Jul 1, 5:50 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 6:07 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Thu Jul 1, 6:08 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Thu Jul 1, 6:22 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 6:57 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Tejun Heo
, (Thu Jul 1, 7:27 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Oleg Nesterov
, (Thu Jul 1, 7:33 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Oleg Nesterov
, (Thu Jul 1, 7:46 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Thu Jul 1, 7:55 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Sridhar Samudrala
, (Fri Jul 2, 11:01 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Fri Jul 2, 11:11 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Oleg Nesterov
, (Fri Jul 2, 2:06 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Sun Jul 4, 2:00 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Sridhar Samudrala
, (Mon Jul 12, 11:59 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Tue Jul 13, 4:09 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Sridhar Samudrala
, (Wed Jul 14, 4:26 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Oleg Nesterov
, (Wed Jul 14, 5:05 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Thu Jul 22, 8:58 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Thu Jul 22, 2:21 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Sat Jul 24, 12:14 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Sun Jul 25, 12:41 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Sun Jul 25, 3:04 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 8:25 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 8:34 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 8:46 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 8:50 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 8:51 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 9:05 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 9:14 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 9:23 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 9:31 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 9:51 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 9:57 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Mon Jul 26, 10:12 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Sridhar Samudrala
, (Mon Jul 26, 10:51 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Oleg Nesterov
, (Mon Jul 26, 11:08 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 11:51 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 12:04 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 12:14 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Mon Jul 26, 12:31 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Mon Jul 26, 12:55 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 12:57 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 12:59 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Mon Jul 26, 1:19 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Mon Jul 26, 1:27 pm)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Mon Jul 26, 9:55 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Tue Jul 27, 1:18 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Tue Jul 27, 1:21 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Tue Jul 27, 8:41 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Tue Jul 27, 12:19 pm)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Wed Jul 28, 12:48 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Michael S. Tsirkin
, (Wed Jul 28, 3:48 am)
Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue wit ...
, Tejun Heo
, (Wed Jul 28, 5:00 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Oleg Nesterov
, (Fri Jul 30, 7:19 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Tejun Heo
, (Fri Jul 30, 7:31 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Michael S. Tsirkin
, (Sun Aug 1, 1:50 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Oleg Nesterov
, (Mon Aug 2, 8:02 am)
Re: [PATCH repost] sched: export sched_set/getaffinity to ...
, Peter Zijlstra
, (Wed Aug 4, 3:45 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Stephen Smalley
Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Alex Riesen
Re: [PATCH 4/7] lib: Introduce strnstr()
Borislav Petkov
drm_vm.c:drm_mmap: possible circular locking dependency detected (was: Re: Linux 2...
Arnd Bergmann
Re: [PATCH] rcu: remove SPARSE_RCU_POINTER
git
:
Mike Miller
git message
Wincent Colaiuta
Re: [RFC PATCH] Make the rebase edit mode really end up in an edit state
Johannes Schindelin
Re: [PATCH] Fix install-doc-quick target
Scott Chacon
Re: why not TortoiseGit
Kevin Ballard
Re: git check-attr -z and quoting
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Sebastian Andrzej Siewior
[PATCH v2] net/core: use ntohs for skb->protocol
Badalian Vyacheslav
Re: tc filter flow hash question
Parav Pandit
ip6 route output() and ip_route_output_key() by drivers
Jarek Poplawski
Re: tc filter flow hash question
git-commits-head
:
Linux Kernel Mailing List
mm: fix build on non-mmu machines
Linux Kernel Mailing List
i915: Don't whine when pci_enable_msi() fails.
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
Staging: rt2870: Removal of kernel_thread() API
Linux Kernel Mailing List
ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T
openbsd-misc
:
Tony Abernethy
Re: The Atheros story in much fewer words
"RALOVICH, Kristóf"
Re: thinkpad windows refund
Kevin
Re: uvm_mapent_alloc: out of static map entries on 4.3 i386
Nick Holland
Re: Install OpenBSD from USB ?
Daniel Ouellet
sysctl kern.maxproc help needed
Colocation donated by:
Syndicate