23.09.2014, 19:06, "Peter Zijlstra" <pet...@infradead.org>: > On Mon, Sep 22, 2014 at 10:36:18PM +0400, Kirill Tkhai wrote: >> From: Kirill Tkhai <ktk...@parallels.com> >> >> Architectures, which define __ARCH_WANT_UNLOCKED_CTXSW, >> may pull a task when it's in the middle of schedule(). >> >> CPU1(task1 calls schedule) CPU2 >> ... schedule() >> ... idle_balance() >> ... load_balance() >> ... ... >> schedule() ... >> prepare_lock_switch() ... >> raw_spin_unlock(&rq1->lock) ... >> ... raw_spin_lock(&rq1->lock) >> ... detach_tasks(); >> ... can_migrate_task(task1) >> ... attach_tasks(); <--- move >> task1 to rq2 >> ... raw_spin_unlock(&rq1->lock) >> ... context_switch() <--- switch to >> task1's stack >> ... ... >> (using task1's stack) (using task1's stack) >> ... ... >> context_switch() ... >> >> Parallel use of a single stack is not a good idea. > > Indeed it is, but how about we do this instead?
Completely agree, looks good for me. > --- > Subject: sched,mips,ia64: Remove __ARCH_WANT_UNLOCKED_CTXSW > > Kirill found that there's a subtle race in the > __ARCH_WANT_UNLOCKED_CTXSW code, and instead of fixing it, remove the > entire exception because neither arch that uses it seems to actually > still require it. > > Boot tested on mips64el (qemu) only. > > Cc: Oleg Nesterov <o...@redhat.com> > Cc: Guenter Roeck <li...@roeck-us.net> > Cc: Ralf Baechle <r...@linux-mips.org> > Cc: Tony Luck <tony.l...@intel.com> > Signed-off-by: Peter Zijlstra (Intel) <pet...@infradead.org> Reviewed-by: Kirill Tkhai <ktk...@parallels.com> (one more review of ia64 part) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/