Messages in this thread | | | Date | Tue, 17 Dec 2019 11:35:47 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH 5/5] locking/percpu-rwsem: Remove the embedded rwsem |
| |
On Mon, Nov 18, 2019 at 11:53:04AM -0800, Davidlohr Bueso wrote: > On Wed, 13 Nov 2019, Peter Zijlstra wrote: > > @@ -54,23 +52,23 @@ static bool __percpu_down_read_trylock(s > > * the same CPU as the increment, avoiding the > > * increment-on-one-CPU-and-decrement-on-another problem. > > Nit: Now that you've made read_count more symmetric, maybe this first > paragraph can be moved down to __percpu_rwsem_trylock() reader side, > as such: > > /* > * Due to having preemption disabled the decrement happens on > * the same CPU as the increment, avoiding the > * increment-on-one-CPU-and-decrement-on-another problem. > */ > preempt_disable(); > ret = __percpu_down_read_trylock(sem); > preempt_enable();
There's another callsite for that function too, so I think the current place still works best.
| |