Re: [PATCH 2/2] locking/rwsem: Use a return variable in rwsem_spin_on_owner()

Davidlohr Bueso
2015-04-09T19:59:48Z

On Thu, 2015-04-09 at 12:43 -0700, Jason Low wrote:
> So that looks more similar to how the original code was where the
> rcu_read_lock() and rcu_read_unlock() was done inside the owner_running
> helper function (though without the CONFIG_DEBUG_PAGEALLOC), before
> commit 307bf9803f25 ("sched: Simplify mutex_spin_on_owner()") modified
> it to be done outside the loop.

I think this is why Linus was mentioning the CONFIG_PREEMPT_RCU case as
well, so taking and releasing the read lock in those cases in the loop
would actually hurt more.

Thanks,
Davidlohr