The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Daniel Walker <dwalker@mvista.com>
Cc: Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] futex: fix miss ordered wakeups
Date: Sat, 24 May 2008 13:34:25 -0700	[thread overview]
Message-ID: <20080524133425.543694ab@infradead.org> (raw)
In-Reply-To: <1211656774.18130.198.camel@localhost.localdomain>

On Sat, 24 May 2008 12:19:34 -0700
Daniel Walker <dwalker@mvista.com> wrote:

> > There is no kernel side controlled handover of a normal futex. The
> > woken up waiters race for it and a low prio thread on another CPU
> > can steal it even if there is a high prio waiter woken up.
> 
> After reading futex_wake, Doesn't it depend how many waiters are
> woken? Given that comes from userspace, glibc could wake a single
> waiter and obtain a priority ordering, couldn't it?

nope. Don't look at the release path... look at the acquire path.
If a thread sees the futex is free, it'll take it, without even going
to the kernel at all. So you have the situation where the kernel spends
a lot of time finding the "perfect" candidate to wake up, but kaboom
some other thread just happens to try to get the mutex between the
wakeup and the acquire of the wakee.. and just "steal" the lock.



      reply	other threads:[~2008-05-24 20:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22  7:00 [PATCH 1/3] mutex debug: add generic blocked_on usage Daniel Walker
2008-05-22  7:00 ` [PATCH 2/3] rtmutex: " Daniel Walker
2008-05-22  7:00 ` [PATCH 3/3] futex: fix miss ordered wakeups Daniel Walker
2008-05-23  5:02   ` Ulrich Drepper
2008-05-23  5:15     ` Daniel Walker
2008-05-23  5:24       ` Ulrich Drepper
2008-05-23  5:36         ` Daniel Walker
2008-05-24  3:38           ` Ulrich Drepper
2008-05-24  8:55   ` Thomas Gleixner
2008-05-24 15:32     ` Daniel Walker
2008-05-24 17:03       ` Thomas Gleixner
2008-05-24 17:24         ` Daniel Walker
2008-05-24 18:35           ` Thomas Gleixner
2008-05-24 19:19             ` Daniel Walker
2008-05-24 20:34               ` Arjan van de Ven [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080524133425.543694ab@infradead.org \
    --to=arjan@infradead.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox