From: Jakub Jelinek <jakub@redhat.com>
To: Arjan van de Ven <arjan@infradead.org>, Ingo Molnar <mingo@redhat.com>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-kernel@vger.kernel.org
Subject: Re: NPTL mutex and the scheduling priority
Date: Mon, 12 Jun 2006 08:44:06 -0400 [thread overview]
Message-ID: <20060612124406.GZ3115@devserv.devel.redhat.com> (raw)
In-Reply-To: <1150115008.3131.106.camel@laptopd505.fenrus.org>
On Mon, Jun 12, 2006 at 02:23:28PM +0200, Arjan van de Ven wrote:
> On Mon, 2006-06-12 at 17:10 +0900, Atsushi Nemoto wrote:
> > # This is a copy of message posted libc-alpha ML. I want to hear from
> > # kernel people too ...
> >
> > Hi. I found that it seems NPTL's mutex does not follow the scheduling
> > parameter. If some threads were blocked by getting a single
> > mutex_lock, I expect that a thread with highest priority got the lock
> > first, but current NPTL's behaviour is different.
> \
>
> you want to use the PI futexes that are in 2.6.17-rc5-mm tree
Even for normal mutices pthread_mutex_unlock and
pthread_cond_{signal,broadcast} is supposed to honor the RT priority and
scheduling policy when waking up:
http://www.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_trylock.html
"If there are threads blocked on the mutex object referenced by mutex when
pthread_mutex_unlock() is called, resulting in the mutex becoming available,
the scheduling policy shall determine which thread shall acquire the mutex."
and similarly for condvars.
"Use PI" is not a valid answer for this.
Really FUTEX_WAKE/FUTEX_REQUEUE can't use a FIFO. I think there was a patch
floating around to use a plist there instead, which is one possibility,
another one is to keep the queue sorted by priority (and adjust whenever
priority changes - one thread can be waiting on at most one futex at a
time).
Jakub
next prev parent reply other threads:[~2006-06-12 12:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-12 8:10 NPTL mutex and the scheduling priority Atsushi Nemoto
2006-06-12 12:23 ` Arjan van de Ven
2006-06-12 12:44 ` Jakub Jelinek [this message]
2006-06-12 15:24 ` Sébastien Dugué
2006-06-12 16:06 ` Atsushi Nemoto
2006-09-07 8:11 ` Atsushi Nemoto
2006-09-07 8:32 ` Jakub Jelinek
2006-09-07 9:30 ` Atsushi Nemoto
2006-09-07 9:37 ` Andreas Schwab
2006-09-07 9:42 ` Atsushi Nemoto
2006-06-13 8:39 ` Pierre Peiffer
2006-06-13 8:48 ` Jakub Jelinek
2006-06-13 12:04 ` Sébastien Dugué
2006-06-13 12:56 ` Jakub Jelinek
2006-06-14 13:19 ` Sébastien Dugué
2006-06-14 13:28 ` Jakub Jelinek
2006-06-14 13:38 ` Pierre Peiffer
2006-06-15 9:28 ` Pierre Peiffer
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=20060612124406.GZ3115@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=anemo@mba.ocn.ne.jp \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/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