On Mon, 22 Aug 2005, Matthew Wilcox wrote:

> > Changing the bias value reduces the maximum number of waiting 
> > processes as you noted. Note "processes" not processors. One processor can 
> > have multiple processes waiting on semaphores. These are not spinlocks.
> 
> No, but you didn't look at the implementation in lib/rwsem.c.
> 
> static inline struct rw_semaphore *
> rwsem_down_failed_common(struct rw_semaphore *sem,
>                         struct rwsem_waiter *waiter, signed long adjustment)
> ...
>         /* we're now waiting on the lock, but no longer actively read-locking 
> */
>         count = rwsem_atomic_update(adjustment, sem);

The adjustment is RWSEM_WAITING_BIAS - RWSEM_ACTIVE bias. This eliminates
the RWSEM_ACTIVE_BIAS but adds RWSEM_WAITING_BIAS for each waiter.

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to