Re: [PATCH 4/7] sched: implement force_cpus_allowed()

From: Peter Zijlstra
Date: Tue Dec 08 2009 - 05:35:27 EST


On Tue, 2009-12-08 at 18:12 +0900, Tejun Heo wrote:
> > So its only needed in order to flush a workqueue from CPU_DOWN_PREPARE?
> > And all you need it to place a new kthread on a !active cpu?
>
> Yes, that's all I need.

Then you don't need most of that patch, you don't need to touch the
migration stuff since a new kthread isn't running.

All you need to do is make a kthread_bind/set_cpus_allowed variant that
checks against cpu_online_mask instead of cpu_active_mask.

It might even make sense to have kthread_bind() always check with
cpu_online_mask as the kernel really ought to know what its doing
anyway.

You also don't need to play trickery with PF_THREAD_BOUND, since a new
kthread will not have that set.

In fact, your patch is against a tree that still has cpu_online_mask in
all those places, so you wouldn't have needed any of that, confused.. ?!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/