From: Dipankar Sarma <dipankar@in.ibm.com>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>,
rusty@au1.ibm.com, ak@suse.de, gareth@valinux.com,
davidm@hpl.hp.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC] Strange code in cpu_idle()
Date: Mon, 6 Dec 2004 16:32:46 +0530 [thread overview]
Message-ID: <20041206110246.GA5303@in.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0412060244350.1036@montezuma.fsmlabs.com>
Hello Zwane,
On Mon, Dec 06, 2004 at 02:47:11AM -0700, Zwane Mwaikambo wrote:
> Hello Paul,
>
> On Sat, 4 Dec 2004, Paul E. McKenney wrote:
>
> > Unless idle_cpu() is busted, it seems like the above is, given the code in
> > rcu_check_callbacks():
> >
> > void rcu_check_callbacks(int cpu, int user)
> > {
> > if (user ||
> > (idle_cpu(cpu) && !in_softirq() &&
> > hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
> > rcu_qsctr_inc(cpu);
> > rcu_bh_qsctr_inc(cpu);
> > } else if (!in_softirq())
> > rcu_bh_qsctr_inc(cpu);
> > tasklet_schedule(&per_cpu(rcu_tasklet, cpu));
> > }
> >
> > So I would say that the rcu_read_lock() in cpu_idle() is having no
> > effect, because any timer interrupt from cpu_idle() will mark a
> > quiescent state notwithstanding. What am I missing here?
>
> What about the hardirq_count check since we're coming in from the timer
> interrupt?
Look at the hardirq_count check closely - it only checks for reentrant
hardirqs. If the idle task gets interrupted by a timer interrupt,
the RCU quiscent state counter for the cpu will get incremented.
So, rcu_read_lock() in cpu_idle() is bogus.
Thanks
Dipankar
next prev parent reply other threads:[~2004-12-06 11:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-04 23:11 [RFC] Strange code in cpu_idle() Paul E. McKenney
2004-12-06 0:32 ` Michael Buesch
2004-12-06 9:54 ` Zwane Mwaikambo
2004-12-06 10:01 ` Michael Buesch
2004-12-06 9:47 ` Zwane Mwaikambo
2004-12-06 11:02 ` Dipankar Sarma [this message]
2004-12-06 14:33 ` Zwane Mwaikambo
-- strict thread matches above, loose matches on Subject: below --
2004-12-06 9:13 Li, Shaohua
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=20041206110246.GA5303@in.ibm.com \
--to=dipankar@in.ibm.com \
--cc=ak@suse.de \
--cc=davidm@hpl.hp.com \
--cc=gareth@valinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@us.ibm.com \
--cc=rusty@au1.ibm.com \
--cc=zwane@arm.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox