All of lore.kernel.org
 help / color / mirror / Atom feed
* futex: priority wakeup miss ordering
@ 2008-05-07 21:22 Daniel Walker
  2008-05-08  8:25 ` Andrew Morton
  2008-05-08 10:06 ` Thomas Gleixner
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Walker @ 2008-05-07 21:22 UTC (permalink / raw)
  To: Pierre Peiffer; +Cc: linux-kernel



from commit ec92d08292d3e9b0823eba138a4564d2d39f25c7

The wakeup ordering should be in priority order. However if the priority
of a task is modified while it's waiting on the futex you will get an
out of order wakeup.

If you use a priority inheriting mutex this is correct. It's because the
rtmutex hooks into sched_setscheduler to catch any priority changes,
then re-queues with the new priority.. But the futex doesn't have this
hook.

Was this intentionally left out of this priority wake up patch? I
thought I would let you know in case you had a specific reason for not
handling this.. 

Daniel


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

* Re: futex: priority wakeup miss ordering
  2008-05-07 21:22 futex: priority wakeup miss ordering Daniel Walker
@ 2008-05-08  8:25 ` Andrew Morton
  2008-05-08 10:06 ` Thomas Gleixner
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2008-05-08  8:25 UTC (permalink / raw)
  To: Daniel Walker; +Cc: linux-kernel, Pierre Peiffer

On Wed, 07 May 2008 14:22:58 -0700 Daniel Walker <dwalker@mvista.com> wrote:

> 
> 
> from commit ec92d08292d3e9b0823eba138a4564d2d39f25c7
> 
> The wakeup ordering should be in priority order. However if the priority
> of a task is modified while it's waiting on the futex you will get an
> out of order wakeup.
> 
> If you use a priority inheriting mutex this is correct. It's because the
> rtmutex hooks into sched_setscheduler to catch any priority changes,
> then re-queues with the new priority.. But the futex doesn't have this
> hook.
> 
> Was this intentionally left out of this priority wake up patch? I
> thought I would let you know in case you had a specific reason for not
> handling this.. 
> 

Pierre is no longer @bull.net.

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

* Re: futex: priority wakeup miss ordering
  2008-05-07 21:22 futex: priority wakeup miss ordering Daniel Walker
  2008-05-08  8:25 ` Andrew Morton
@ 2008-05-08 10:06 ` Thomas Gleixner
  2008-05-08 16:28   ` Daniel Walker
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2008-05-08 10:06 UTC (permalink / raw)
  To: Daniel Walker; +Cc: Pierre Peiffer, LKML

On Wed, 7 May 2008, Daniel Walker wrote:
> 
> from commit ec92d08292d3e9b0823eba138a4564d2d39f25c7
> 
> The wakeup ordering should be in priority order. However if the priority
> of a task is modified while it's waiting on the futex you will get an
> out of order wakeup.
> 
> If you use a priority inheriting mutex this is correct. It's because the
> rtmutex hooks into sched_setscheduler to catch any priority changes,
> then re-queues with the new priority.. But the futex doesn't have this
> hook.
> 
> Was this intentionally left out of this priority wake up patch? I
> thought I would let you know in case you had a specific reason for not
> handling this.. 

IIRC this has been discussed before. The priority ordering of the
plain mutex waiters is an optimization without guarantees of
correctness across a priority change. It's simply not worth the
additional complexity and overhead for that corner case.

Thanks,

	tglx

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

* Re: futex: priority wakeup miss ordering
  2008-05-08 10:06 ` Thomas Gleixner
@ 2008-05-08 16:28   ` Daniel Walker
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Walker @ 2008-05-08 16:28 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Pierre Peiffer, LKML


On Thu, 2008-05-08 at 12:06 +0200, Thomas Gleixner wrote:

> IIRC this has been discussed before. The priority ordering of the
> plain mutex waiters is an optimization without guarantees of
> correctness across a priority change. It's simply not worth the
> additional complexity and overhead for that corner case.

I've gotten a number of complains about this .. I think it's assumed
that this feature was implementing posix priority queuing for the
standard futex, but it can't be if there are any miss ordered wakeups.

Daniel


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

end of thread, other threads:[~2008-05-08 16:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-07 21:22 futex: priority wakeup miss ordering Daniel Walker
2008-05-08  8:25 ` Andrew Morton
2008-05-08 10:06 ` Thomas Gleixner
2008-05-08 16:28   ` Daniel Walker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.