Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1524717

Re: [PATCH RFC tip/core/rcu] SRCU rewrite

From Lai Jiangshan <jiangshanlai@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH RFC tip/core/rcu] SRCU rewrite
Date 2016-11-17 19:50 +0100
Message-ID <sEw15-1T0-59@gated-at.bofh.it> (permalink)
References <sDukH-2cH-83@gated-at.bofh.it> <sDB2N-6Ik-19@gated-at.bofh.it> <sDN3X-69H-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 15, 2016 at 10:37 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
> On Tue, Nov 15, 2016 at 09:44:45AM +0800, Boqun Feng wrote:

>>
>> __srcu_read_lock() used to be called with preemption disabled. I guess
>> the reason was because we have two percpu variables to increase. So with
>> only one percpu right, could we remove the preempt_{dis,en}able() in
>> srcu_read_lock() and use this_cpu_inc() here?
>
> Quite possibly...
>

it will be nicer if it is removed.

The reason for the preemption-disabled was also because we
have to disallow any preemption between the fetching of the idx
and the increasement. so that we have at most NR_CPUS worth
of readers using the old index that haven't incremented the counters.

if we remove the preempt_{dis,en}able(). we must change the
"NR_CPUS" in the comment into ULONG_MAX/4. (I assume
one on-going reader needs at least need 4bytes at the stack). it is still safe.

but we still need to think more if we want to remove the preempt_{dis,en}able().

Thanks
Lai

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-14 19:40 +0100
  Re: [PATCH RFC tip/core/rcu] SRCU rewrite Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-11-14 20:10 +0100
  Re: [PATCH RFC tip/core/rcu] SRCU rewrite Boqun Feng <boqun.feng@gmail.com> - 2016-11-15 02:50 +0100
    Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-15 15:40 +0100
      Re: [PATCH RFC tip/core/rcu] SRCU rewrite Boqun Feng <boqun.feng@gmail.com> - 2016-11-17 15:40 +0100
        Re: [PATCH RFC tip/core/rcu] SRCU rewrite Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-11-17 18:10 +0100
        Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-17 18:20 +0100
        Re: [PATCH RFC tip/core/rcu] SRCU rewrite Lai Jiangshan <jiangshanlai@gmail.com> - 2016-11-17 18:30 +0100
          Re: [PATCH RFC tip/core/rcu] SRCU rewrite Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-11-17 19:00 +0100
            Re: [PATCH RFC tip/core/rcu] SRCU rewrite Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-11-17 19:10 +0100
              Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-17 22:30 +0100
          Re: [PATCH RFC tip/core/rcu] SRCU rewrite Lance Roy <ldr709@gmail.com> - 2016-11-17 21:40 +0100
      Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-17 18:20 +0100
        Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-17 18:50 +0100
        Re: [PATCH RFC tip/core/rcu] SRCU rewrite Lai Jiangshan <jiangshanlai@gmail.com> - 2016-11-17 19:20 +0100
        Re: [PATCH RFC tip/core/rcu] SRCU rewrite Boqun Feng <boqun.feng@gmail.com> - 2016-11-17 19:40 +0100
          Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-17 20:20 +0100
      Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-17 19:50 +0100
      Re: [PATCH RFC tip/core/rcu] SRCU rewrite Lai Jiangshan <jiangshanlai@gmail.com> - 2016-11-17 19:50 +0100
  Re: [PATCH RFC tip/core/rcu] SRCU rewrite Peter Zijlstra <peterz@infradead.org> - 2016-11-15 09:00 +0100
    Re: [PATCH RFC tip/core/rcu] SRCU rewrite Peter Zijlstra <peterz@infradead.org> - 2016-11-15 15:00 +0100
      Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-15 15:30 +0100
        Re: [PATCH RFC tip/core/rcu] SRCU rewrite Peter Zijlstra <peterz@infradead.org> - 2016-11-15 16:00 +0100
          Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-15 16:50 +0100
    Re: [PATCH RFC tip/core/rcu] SRCU rewrite Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-11-15 15:00 +0100
  Re: [PATCH RFC tip/core/rcu] SRCU rewrite Lai Jiangshan <jiangshanlai@gmail.com> - 2016-11-17 19:00 +0100
    Re: [PATCH RFC tip/core/rcu] SRCU rewrite Lance Roy <ldr709@gmail.com> - 2016-11-17 21:00 +0100
      Re: [PATCH RFC tip/core/rcu] SRCU rewrite "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-11-18 14:40 +0100

csiph-web