From: Manfred Spraul <manfred@colorfullife.com>
To: paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
akpm@linux-foundation.org, oleg@tv-sign.ru, dipankar@in.ibm.com,
rostedt@goodmis.org, dvhltc@us.ibm.com, niv@us.ibm.com
Subject: Re: [PATCH tip/core/rcu] classic RCU locking and memory-barrier cleanups
Date: Mon, 18 Aug 2008 11:13:45 +0200 [thread overview]
Message-ID: <48A93D49.2000601@colorfullife.com> (raw)
In-Reply-To: <20080807031806.GA6910@linux.vnet.ibm.com>
Paul E. McKenney wrote:
>
>> Right now, I try to understand the current code first - and some of it
>> doesn't make much sense.
>>
>> There are three per-cpu lists:
>> ->nxt
>> ->cur
>> ->done.
>>
>> Obviously, there must be a quiescent state between cur and done.
>> But why does the code require a quiescent state between nxt and cur?
>> I think that's superflous. The only thing that is required is that all cpus
>> have moved their callbacks from nxt to cur. That doesn't need a quiescent
>> state, this operation could be done in hard interrupt as well.
>>
>
> The deal is that we have to put incoming callbacks somewhere while
> the batch in ->cur waits for an RCU grace period. That somewhere is
> ->nxt. So to be painfully pedantic, the callbacks in ->nxt are not
> waiting for an RCU grace period. Instead, they are waiting for the
> callbacks in ->cur to get out of the way.
>
>
Ok, thanks.
If I understand the new code in tip/rcu correctly, you have rewritten
that block anyway.
I'll try to implement my proposal - on paper, it looks far simpler than
the current code.
On the one hand, a state machine that keeps track of a global state:
- collect the callbacks in a nxt list.
- wait for quiecent
- destroy the callbacks in the nxt list.
(actually, there will be 5 states, 2 additional for "start the next rcu
cycle immediately")
On the other hand a cpu bitmap that keeps track of the cpus that have
completed the work that must be done after a state change.
The last cpu advances the global state.
The state machine could be seq_lock protected, the cpu bitmap could be
either hierarchical or flat or for uniprocessor just a nop.
Do you have any statistics about rcu_check_callbacks? On my single-cpu
system, around 2/3 of the calls are from "normal" context, i.e.
rcu_qsctr_inc() is called.
--
Manfred
next prev parent reply other threads:[~2008-08-18 9:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-05 16:21 [PATCH tip/core/rcu] classic RCU locking and memory-barrier cleanups Paul E. McKenney
2008-08-05 16:48 ` Steven Rostedt
2008-08-05 17:40 ` Paul E. McKenney
2008-08-06 5:30 ` Manfred Spraul
2008-08-07 3:18 ` Paul E. McKenney
2008-08-18 9:13 ` Manfred Spraul [this message]
2008-08-18 14:04 ` Paul E. McKenney
2008-08-19 10:48 ` Manfred Spraul
2008-08-19 14:03 ` Paul E. McKenney
2008-08-19 17:16 ` nohz_cpu_mask question (was: Re: [PATCH tip/core/rcu] classic RCU locking and memory-barrier cleanups) Manfred Spraul
2008-08-19 17:41 ` Paul E. McKenney
2008-08-15 14:09 ` [PATCH tip/core/rcu] classic RCU locking and memory-barrier cleanups Ingo Molnar
2008-08-15 14:24 ` Ingo Molnar
2008-08-15 14:56 ` Ingo Molnar
2008-08-15 14:58 ` Paul E. McKenney
2008-08-17 14:37 ` [PATCH tip/core/rcu] classic RCU locking cleanup fix lockdep problem Paul E. McKenney
2008-08-17 15:38 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48A93D49.2000601@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=akpm@linux-foundation.org \
--cc=dipankar@in.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=niv@us.ibm.com \
--cc=oleg@tv-sign.ru \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.