Re: [PATCH repost] sched: export sched_set/getaffinity to modules
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2010-07-01 12:30:12
Also in:
kvm, lkml
On Thu, Jul 01, 2010 at 02:55:07PM +0300, Michael S. Tsirkin wrote:
On Thu, Jul 01, 2010 at 01:43:23PM +0200, Peter Zijlstra wrote:quoted
On Thu, 2010-07-01 at 13:19 +0200, Peter Zijlstra wrote:quoted
On Thu, 2010-07-01 at 14:07 +0300, Michael S. Tsirkin wrote:quoted
Author: Sridhar Samudrala [off-list ref] sched: export sched_set/getaffinity to modules vhost-net driver wants to copy the affinity from the owner thread to thread it creates. Export sched_set/get affinity to modules to make this possible when vhost is built as a module.quoted
Urgh,.. so why again is that a good idea?In particular: - who sets the affinity of the task?management tools do this when they start qemu.quoted
- why can't it set the kernel thread's affinity too?It can. However: the threads are started internally by the driver when qemu does an ioctl. What we want to do is give it a sensible default affinity. management tool can later tweak it if it wants to.quoted
- what happens if someone changes the tasks' affinity?We would normally create a cgroup including all internal tasks, making it easy to find and change affinity for them all if necessary.quoted
So no, I don't think this is a sensible thing to do at all.
The patch using this is here: http://www.mail-archive.com/kvm@vger.kernel.org/msg35411.html It simply copies the affinity from the parent when thread is created. -- MST