Re: [PATCH 2/2] rwsem: do optimistic spinning for writer lock acquisition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2013-06-24 at 16:48 -0400, Peter Hurley wrote:

> 
> Also, I haven't given a lot of thought to if preemption must be disabled
> before calling rwsem_can_spin_on_owner(). If so, wouldn't you just drop
> rwsem_can_spin_on_owner() (because the conditions tested in the loop are
> equivalent)?
> 

Not totally equivalent.  If we drop the call to rwsem_can_spin_on_owner,
we will spin when readers are holding the lock (owner is null).  
Right now we only allow writers to spin when other writers are 
holding the lock by adding the rwsem_can_spin_on_owner check.  
Letting spinning on readers held lock is tricky as
we could have a reader that sleeps and if we don't detect the case.  We
could spin for too long.

Thanks.

Tim


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]