Re: [PATCH v3] rwsem: Support optimistic spinning

2014-05-01 Thread Jason Low
On Thu, May 1, 2014 at 9:39 AM, Tim Chen wrote: > On Wed, 2014-04-30 at 20:21 -0700, Davidlohr Bueso wrote: > >> + >> +static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem) >> +{ >> + struct task_struct *owner; >> + bool on_cpu = true; >> + >> + if (need_resched()) >> +

Re: [PATCH v3] rwsem: Support optimistic spinning

2014-05-01 Thread Tim Chen
On Wed, 2014-04-30 at 20:21 -0700, Davidlohr Bueso wrote: > + > +static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem) > +{ > + struct task_struct *owner; > + bool on_cpu = true; > + > + if (need_resched()) > + return 0; > + > + rcu_read_lock(); > + o

[PATCH v3] rwsem: Support optimistic spinning

2014-04-30 Thread Davidlohr Bueso
We have reached the point where our mutexes are quite fine tuned for a number of situations. This includes the use of heuristics and optimistic spinning, based on MCS locking techniques. Exclusive ownership of read-write semaphores are, conceptually, just about the same as mutexes, making them clo