Messages in this thread | | | From | Linus Torvalds <> | Date | Sat, 28 Jan 2012 13:12:02 -0800 | Subject | Re: [tip:sched/core] sched: Fix ancient race in do_exit() |
| |
On Sat, Jan 28, 2012 at 4:03 AM, tip-bot for Yasunori Goto <y-goto@jp.fujitsu.com> wrote: > > sched: Fix ancient race in do_exit()
Ugh.
It would be much nicer to just clear the rwsem waiter->task thing *after* waking the task up, which would avoid this race entirely, afaik.
Tell me, why wouldn't that work? rwsem_down_failed_common() does
/* wait to be given the lock */ for (;;) { if (!waiter.task) break; ...
so then we wouldn't need the task refcount crap in rwsem either etc, and we'd get rid of all races with wakeup.
I wonder why we're clearing that whole waiter->task so early.
Linus
| |