Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-20 Thread Pierre Peiffer
Peter Zijlstra a écrit : Unfortunately not, nonlinear vmas don't have a linear relation between address and offset. What you would need to do is do a linear walk of the page tables. But even that might not suffice if nonlinear vmas may form a non-injective, surjective mapping. /me checks..

Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-20 Thread Peter Zijlstra
On Tue, 2007-03-20 at 16:32 +0100, Pierre Peiffer wrote: > Peter Zijlstra a écrit : > >> +static void *get_futex_address(union futex_key *key) > >> +{ > >> + void *uaddr; > >> + > >> + if (key->both.offset & 1) { > >> + /* shared mapping */ > >> + uaddr =

Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-20 Thread Pierre Peiffer
Peter Zijlstra a écrit : +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

Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-20 Thread Pierre Peiffer
Peter Zijlstra a écrit : +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);

Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-20 Thread Peter Zijlstra
On Tue, 2007-03-20 at 16:32 +0100, Pierre Peiffer wrote: Peter Zijlstra a écrit : +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) +

Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-20 Thread Pierre Peiffer
Peter Zijlstra a écrit : Unfortunately not, nonlinear vmas don't have a linear relation between address and offset. What you would need to do is do a linear walk of the page tables. But even that might not suffice if nonlinear vmas may form a non-injective, surjective mapping. /me checks..

Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-16 Thread Peter Zijlstra
On Tue, 2007-03-13 at 10:52 +0100, [EMAIL PROTECTED] 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

Re: [PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-16 Thread Peter Zijlstra
On Tue, 2007-03-13 at 10:52 +0100, [EMAIL PROTECTED] 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

[PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-13 Thread Pierre . Peiffer
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

[PATCH 2.6.21-rc3-mm2 3/4] futex_requeue_pi optimization

2007-03-13 Thread Pierre . Peiffer
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