From: Thomas Gleixner <tglx@linutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andi Kleen <andi@firstfloor.org>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Christoph Lameter <cl@linux.com>, Tejun Heo <htejun@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write()
Date: Tue, 20 Sep 2011 10:32:34 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1109200933310.2723@ionos> (raw)
In-Reply-To: <1316488378.29966.35.camel@gandalf.stny.rr.com>
On Mon, 19 Sep 2011, Steven Rostedt wrote:
> On Mon, 2011-09-19 at 19:20 -0700, Andi Kleen wrote:
> > Steven Rostedt <rostedt@goodmis.org> writes:
> >
> > > I just found out that the this_cpu_*() functions do not perform the
> > > test to see if the usage is in atomic or not. Thus, the blind
> > > conversion of the per_cpu(*, smp_processor_id()) and the get_cpu_var()
> > > code to this_cpu_*() introduce the regression to detect the hard
> > > to find case where a per cpu variable is used in preempt code that
> > > migrates and causes bugs.
Just for the record. I added some this_cpu_* debug checks to my
filesystem eating 2.6.38-rt and guess what: They trigger right away in
the FS code and without digging deeper I'm 100% sure, that this is the
root cause of the problems I was hunting for weeks. Thanks for wasting
my time and racking my nerves.
People who remove debugability blindly have earned an one way ticket
to the Oort cloud. There is utter chaos already so they wont be
noticed at all.
> > Didn't preempt-rt recently get changed to not migrate in kernel-preempt
> > regions. How about just fixing the normal preemption to not do this
> > either.
>
> Actually, that's part of the issue. RT has made spin_locks not migrate.
> But this has also increased the overhead of those same spinlocks. I'm
> hoping to do away with the big hammer approach (although Thomas is less
> interested in this). I would like to have areas that require per-cpu
> variables to be annotated,
Yes, annotation is definitely something which is needed badly.
Right now preempt_disable()/local_irq_disable() are used explicit or
implicit (through spin_lock*) to protect per cpu sections, but we have
no clue, where such a section really starts and ends.
In fact preempt_disable/local_irq_disable() have become the new cpu
local BKL and the per cpu stuff just happily (ab)uses that without
documenting the scope of the code sections which rely on that. It's
just nesting inside spinlocked sections at random places without
giving a clue what needs to be kept on a cpu or not.
That's what makes it basically impossible to use anything else than
the big hammer approach in RT. Nobody has the bandwidth to audit all
this stuff and I seriously doubt that we can improve that situation
unless we get proper annotation of the per cpu sections in place.
Can we please put that on the KS agenda? This definitely needs to be
addressed urgently.
> and not have every spinlock disable preemption.
That doesn't work, you're prone to deadlocks then. I guess you meant
not disable migration on RT, right?
Thanks,
tglx
next prev parent reply other threads:[~2011-09-20 8:32 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 21:20 Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 1/5] x86: Remove const_udelay() caring about which cpu var it uses Steven Rostedt
2011-09-19 21:51 ` Christoph Lameter
2011-09-19 23:31 ` Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 2/5] mm: Switch mod_state() to __this_cpu_read() Steven Rostedt
2011-09-19 22:02 ` Christoph Lameter
2011-09-19 23:48 ` Steven Rostedt
2011-09-20 14:46 ` Christoph Lameter
2011-09-20 15:16 ` Steven Rostedt
2011-09-20 15:54 ` Christoph Lameter
2011-09-20 16:07 ` Steven Rostedt
2011-09-20 22:19 ` Valdis.Kletnieks
2011-09-20 13:49 ` Thomas Gleixner
2011-09-20 14:01 ` Steven Rostedt
2011-09-20 14:51 ` Christoph Lameter
2011-09-20 15:11 ` Steven Rostedt
2011-09-20 15:59 ` Christoph Lameter
2011-09-20 16:03 ` Steven Rostedt
2011-09-20 16:07 ` Christoph Lameter
2011-09-20 15:27 ` Thomas Gleixner
2011-09-20 16:02 ` Christoph Lameter
2011-09-20 16:51 ` Thomas Gleixner
2011-09-20 17:08 ` Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 3/5] memcg: Disable preemption in memcg_check_events() Steven Rostedt
2011-09-20 14:20 ` Johannes Weiner
2011-09-20 14:24 ` Johannes Weiner
2011-09-20 14:33 ` Steven Rostedt
2011-09-24 0:46 ` Steven Rostedt
2011-09-19 21:20 ` [RFC][PATCH 4/5] printk: Have wake_up_klogd() use __this_cpu_write() Steven Rostedt
2011-09-19 21:54 ` Christoph Lameter
2011-09-19 23:33 ` Steven Rostedt
2011-09-20 14:54 ` Christoph Lameter
2011-09-20 14:55 ` Peter Zijlstra
2011-09-19 21:20 ` [RFC][PATCH 5/5] percpu: Add preempt checks back into this_cpu_read/write() Steven Rostedt
2011-09-19 21:49 ` [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write() Christoph Lameter
2011-09-20 3:06 ` Steven Rostedt
2011-09-20 12:44 ` Valdis.Kletnieks
2011-09-20 13:51 ` Thomas Gleixner
2011-09-20 14:58 ` Christoph Lameter
2011-09-20 15:17 ` Steven Rostedt
2011-09-20 14:57 ` Christoph Lameter
2011-09-20 15:19 ` Steven Rostedt
2011-09-20 16:08 ` Christoph Lameter
2011-09-20 16:31 ` Steven Rostedt
2011-09-20 16:56 ` Steven Rostedt
2011-09-20 17:09 ` Peter Zijlstra
2011-09-20 17:15 ` Steven Rostedt
2011-09-20 17:25 ` Mathieu Desnoyers
2011-09-20 18:03 ` Steven Rostedt
2011-09-20 18:12 ` Mathieu Desnoyers
2011-09-20 18:27 ` Steven Rostedt
2011-09-20 18:34 ` Mathieu Desnoyers
2011-09-20 22:32 ` Valdis.Kletnieks
2011-09-20 22:17 ` Valdis.Kletnieks
2011-09-21 1:33 ` Steven Rostedt
2011-09-20 15:46 ` Mathieu Desnoyers
2011-09-20 16:00 ` Steven Rostedt
2011-09-20 16:10 ` Christoph Lameter
2011-09-20 16:50 ` Peter Zijlstra
2011-09-20 18:54 ` Steven Rostedt
2011-09-21 15:16 ` Christoph Lameter
2011-09-21 15:31 ` Steven Rostedt
2011-09-21 15:59 ` Christoph Lameter
2011-09-21 16:12 ` Steven Rostedt
2011-09-21 16:32 ` Thomas Gleixner
2011-09-20 2:20 ` Andi Kleen
2011-09-20 3:12 ` Steven Rostedt
2011-09-20 3:17 ` Steven Rostedt
2011-09-20 8:32 ` Thomas Gleixner [this message]
2011-09-20 12:10 ` Steven Rostedt
2011-09-20 15:03 ` Christoph Lameter
2011-09-20 15:07 ` Peter Zijlstra
2011-09-20 16:05 ` Christoph Lameter
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=alpine.LFD.2.02.1109200933310.2723@ionos \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=cl@linux.com \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome