Re: [PATCH 04/40] sched: implement __set_cpus_allowed()

From: Tejun Heo
Date: Sun Jan 24 2010 - 03:14:42 EST


On 01/20/2010 05:35 PM, Tejun Heo wrote:
> Wouldn't it make more sense to share the backend implementation
> between kthread_bind() and set_cpus_allowed_ptr() instead of making
> kthread_bind() a special case? The goals of the two functions are
> basically identical. Why have two separate implementations?
> kthread_bind() implementation as it currently stands is pretty fragile
> too. Making kthread_bind() backed by set_cpus_allowed_ptr() will make
> it more robust and less error-prone and all that's necessary to
> achieve that is modifying sanity checks.

I gave it shot. The interface is cleaner this way but I couldn't
figure out where to set PF_THREAD_BOUND as actual migration may happen
in different places and p->flags can only be set while it's known the
process is not running. At this point, I can't think of a better way
to do this than the current patch. :-(


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at