public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* second, bigger problem with private futexes
@ 2007-05-21 17:26 Ulrich Drepper
  2007-05-21 18:15 ` Eric Dumazet
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrich Drepper @ 2007-05-21 17:26 UTC (permalink / raw)
  To: Eric Dumazet, Linux Kernel; +Cc: Andrew Morton

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This one is a big problem:

If I understand the code correctly, a FUTEX_CMP_REQUEUE from a private
futex will add the waiters to the other futex as a private futex.  And
similarly for shared.

I.e., it is not possible to have one futex private and the other shared.
 This is a huge problem.  The shared/private status of a conditional
variable and the mutex used with it don't have to match.  But this is
where FUTEX_CMP_REQUEUE is used.

If this is not changed (assuming I'm right with my analysis of the
kernel code) this means mutexes and condvars will not be able to use
private futexes.

What would be needed is an additional parameter for FUTEX_CMP_REQUEUE
and FUTEX_CMP_REQUEUE_PI which specifies the state (shared/private) of
the target futex.  The original futex' state is encoded in the command
(the FUTEX_PRIVATE_FLAG ORed to FUTEX_CMP_REQUEUE*).

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGUdYo2ijCOnn/RHQRArmXAKCdW9a/nuJun/0KjftIcMrsURNnrwCgzCf8
XGi6EzPV88DEIwHfnMfKdNg=
=0hVr
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-05-21 20:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-21 17:26 second, bigger problem with private futexes Ulrich Drepper
2007-05-21 18:15 ` Eric Dumazet
2007-05-21 18:26   ` Ulrich Drepper
2007-05-21 18:48     ` Eric Dumazet
2007-05-21 19:26       ` Eric Dumazet
2007-05-21 19:43         ` Ulrich Drepper
2007-05-21 19:55           ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox