From: Thomas Gleixner <tglx@linutronix.de>
To: Christoph Lameter <cl@gentwo.org>
Cc: Steven Rostedt <rostedt@goodmis.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>
Subject: Re: [RFC][PATCH 2/5] mm: Switch mod_state() to __this_cpu_read()
Date: Tue, 20 Sep 2011 18:51:38 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1109201806220.2723@ionos> (raw)
In-Reply-To: <alpine.DEB.2.00.1109201059590.8056@router.home>
On Tue, 20 Sep 2011, Christoph Lameter wrote:
> On Tue, 20 Sep 2011, Thomas Gleixner wrote:
> > I want to get rid of them alltogether. They are crap by design and
> > prone to be used wrong without a sensible way to detect that.
>
> Counter increments have been done this way for a very long time. This is
> a pretty well established way of doing things in the kernel that was
> expanded and made better by avoid preempt disable/enable around these per
> cpu pointer increments.
This still can be done, when the functions are actually having
sensible names and annotations.
> > Right, and that's the main problem. We have no fricking way to debug
> > this, so they should have never been there in the first place. And you
> > simply CANNOT prevent people from getting this wrong w/o proper
> > debugging and annotation. Even YOU and Tejun made bogus conversion w/o
> > noticing, but you expect that others get it right?
>
> Bogus conversions?
Is the list I posted not enough?
The usage of this_cpu_read() in functions which require to be called
with preemption or interrupts disabled is pointless and worse it
actually removed debug functionality in some places which used
smp_processor_id() before.
I do not care at all whether this_cpu_read() on x86 does not have the
preempt_enable/disable() pair, but I care a lot about the correctness
of the code and debugability.
> > So stop defending that trainwreck and help out with fixing the mess
> > you created in a proper and debugable way!
>
> You want debugging to ensure that this_cpu ops always access the intended
> per cpu area? But the point of these operations is to be used in kernel
> locations where the use of any per cpu area is satisfactory.
The point is that the whole design assumes that people get it correct
and you spent not a split second to provide any means of debugability
for this. Now you argue in circles about your performance numbers and
let others deal with the fallout and refuse to think about a sensible
solution to the problem.
It does not matter at all what you intended and what people should do,
but it does matter very much what unintentional and undebugable
wreckage can be caused by it.
We spent huge efforts to make locks debugable and we still have people
getting it wrong and you expect that something as complex as the per
cpu stuff is just correct by definition.
And the problem of this_cpu & co starts with the naming convention.
this_cpu_*() is patently wrong. It should be: random_cpu_*() or
any_cpu_*(). This way you could have avoided confusion in the first
place and made it entirely clear what the interfaces are about.
Thanks,
tglx
next prev parent reply other threads:[~2011-09-20 16:51 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 21:20 [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write() 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 [this message]
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
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.1109201806220.2723@ionos \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.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 \
/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