Re: [patch] 2.4.4 alpha semaphores optimization

Ivan Kokshaysky
2001-05-04T09:16:49Z

On Thu, May 03, 2001 at 07:28:48PM +0200, Andrea Arcangeli wrote:
> I'd love if you could port it on top of this one and to fix it so that
> it can handle up to 2^32 sleepers and not only 2^16 like we have to do
> on the 32bit archs to get good performance:
>
> ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.4aa3/00_rwsem-11

It could be done without much pain for both "official" and your rwsem
implementations.
However, there are 3 reasons why I prefer 16-bit counters:
a. "max user processes" ulimit is much lower than 64K anyway;
b. "long" count would cost extra 8 bytes in the struct rw_semaphore;
c. I can use existing atomic routines which deal with ints.

Actually I'm more anxious about a __builtin_expect() problem,
and I'd like to hear Richard's comment on this...

Ivan.