Re: [-rt] Fix race condition and following BUG in PI-futex



On Tue, 2006-08-01 at 13:22 -0700, Darren Hart wrote:


list_del_init(&pi_state->owner->pi_state_list);
list_add(&pi_state->list, &new_owner->pi_state_list);
pi_state->owner = new_owner;
+ atomic_inc(&pi_state->refcount);

There really needs to be a get_pi_state() or some variant. Having to do
a manual atomic_inc is very dangerous.

I understand the need to grab the wait_lock in order to serialize
rt_mutex_next_owner(), but why the addition of of the atomic_inc() and the
free_pi_state() ? And if we do need them, shouldn't we place them around the
use of the pi_state, rather than just before the unlock calls?

Hmm, is the inc really needed? The hb->lock is held through this and
the pi_state can't go away while that lock is held.

-- Steve


-
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/



Relevant Pages

  • Re: 2.6.15-rc3: adduser: unable to lock password file
    ... Either grab 2.6.15-rc5 from kernel.org, ... this patch solved the problem. ... > More majordomo info at http://vger.kernel.org/majordomo-info.html ... > Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: PM/hibernate swapfile regression
    ... but you grab a reference to it. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: uml fails to compile due to missing offsetof
    ... The x86_64 variant looks weird as well, ... included via some other headers. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] TPM: DATA_EXPECT bit check bypass
    ... strcmpvariant of some sort instead? ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [git pull] ieee1394 tree for 2.6.18
    ... work just fine and be much faster than the variant above... ... Still, that looks like excessive from server, if nothing else. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)