lkml.org 
[lkml]   [2019]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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.

    \
     
     \ /
      Last update: 2019-12-17 11:37    [W:3.308 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site