public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Pierre.Peiffer@bull.net
Cc: akpm@linux-foundation.org, mingo@elte.hu, drepper@redhat.com,
	linux-kernel@vger.kernel.org, jean-pierre.dion@bull.net
Subject: Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization
Date: Fri, 16 Mar 2007 11:14:06 +0100	[thread overview]
Message-ID: <1174040046.7124.27.camel@twins> (raw)
In-Reply-To: <20070313095548.003786249@bull.net>

On Tue, 2007-03-13 at 10:52 +0100, Pierre.Peiffer@bull.net wrote:
> plain text document attachment (futex-requeue-pi.diff)
> This patch provides the futex_requeue_pi functionality.
> 
> This provides an optimization, already used for (normal) futexes, to be used for
> PI-futexes.
> 
> This optimization is currently used by the glibc in pthread_broadcast, when
> using "normal" mutexes. With futex_requeue_pi, it can be used with PRIO_INHERIT
> mutexes too.
> 
> Signed-off-by: Pierre Peiffer <pierre.peiffer@bull.net>
> 
> ---

>  /*
> + * Retrieve the original address used to compute this key
> + */
> +static void *get_futex_address(union futex_key *key)
> +{
> +	void *uaddr;
> +
> +	if (key->both.offset & 1) {
> +		/* shared mapping */
> +		uaddr = (void*)((key->shared.pgoff << PAGE_SHIFT)
> +				+ key->shared.offset - 1);
> +	} else {
> +		/* private mapping */
> +		uaddr = (void*)(key->private.address + key->private.offset);
> +	}
> +
> +	return uaddr;
> +}

This will not work for nonlinear vmas, granted, not a lot of ppl stick
futexes in nonlinear vmas, but the futex_key stuff handles it, this
doesn't.



  reply	other threads:[~2007-03-16 10:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-13  9:52 [PATCH 2.6.21-rc3-mm2 0/4] Futexes functionalities and improvements Pierre.Peiffer
2007-03-13  9:52 ` [PATCH 2.6.21-rc3-mm2 1/4] futex priority based wakeup Pierre.Peiffer
2007-03-13  9:52 ` [PATCH 2.6.21-rc3-mm2 2/4] Make futex_wait() use an hrtimer for timeout Pierre.Peiffer
2007-03-13  9:52 ` [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization Pierre.Peiffer
2007-03-16 10:14   ` Peter Zijlstra [this message]
2007-03-20 15:32     ` Pierre Peiffer
2007-03-20 15:55       ` Peter Zijlstra
2007-03-20 16:32         ` Pierre Peiffer
2007-03-13  9:52 ` [PATCH 2.6.21-rc3-mm2 4/4] sys_futex64 : allows 64bit futexes Pierre.Peiffer
2007-03-15 19:07   ` Andrew Morton
2007-03-15 19:12     ` Ulrich Drepper
2007-03-15 19:31       ` Andrew Morton
2007-03-15 19:37         ` Ulrich Drepper

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=1174040046.7124.27.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=Pierre.Peiffer@bull.net \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=jean-pierre.dion@bull.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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