Re: [PATCH v2] futex: fix a race condition between REQUEUE_PI and task death

2014-10-26 Thread Thomas Gleixner
On Sat, 25 Oct 2014, Brian Silverman wrote: > @@ -64,6 +64,7 @@ > #include > #include > #include > +#include Already included. > * PI futexes can not be requeued and must remove themself from the > * hash bucket. The hash bucket lock (i.e. lock_ptr) is held on entry > * and dropped

Re: [PATCH v2] futex: fix a race condition between REQUEUE_PI and task death

2014-10-26 Thread Thomas Gleixner
On Sat, 25 Oct 2014, Brian Silverman wrote: > @@ -1558,6 +1558,12 @@ retry_private: > ret = get_futex_value_locked(&curval, uaddr1); > > if (unlikely(ret)) { > + /* > + * We will have to lookup the pi_state again, so > +

Re: [PATCH v2] futex: fix a race condition between REQUEUE_PI and task death

2014-10-25 Thread Mike Galbraith
3.12.30-rt40 + patch has been running your testcase, futextests and stockfish concurrently (on a 28 core +ht box) for over an hour now. On Sat, 2014-10-25 at 20:20 -0400, Brian Silverman wrote: > free_pi_state and exit_pi_state_list both clean up futex_pi_state's. > exit_pi_state_list takes the h

[PATCH v2] futex: fix a race condition between REQUEUE_PI and task death

2014-10-25 Thread Brian Silverman
free_pi_state and exit_pi_state_list both clean up futex_pi_state's. exit_pi_state_list takes the hb lock first, and most callers of free_pi_state do too. requeue_pi didn't, which means free_pi_state can free the pi_state out from under exit_pi_state_list. For example: task A