mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Paul E. McKenney" <paulmck@us.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: per-cpu operation madness vs validation
Date: Wed, 27 Jul 2011 18:20:17 +0200	[thread overview]
Message-ID: <1311783617.5890.179.camel@twins> (raw)
In-Reply-To: <alpine.DEB.2.00.1107270916240.9418@router.home>

On Wed, 2011-07-27 at 09:20 -0500, Christoph Lameter wrote:
> On Wed, 27 Jul 2011, Peter Zijlstra wrote:
> 
> > > Possibly we could reduce all this percpu madness back to one form
> > > (__this_cpu_*) and require that when used a lock of the percpu_lock_t is
> > > taken.
> >
> > get_cpu_var()/put_cpu_var() were supposed to provide such delineation as
> > well, but you've been actively destroying things like that with the
> > recent per-cpu work.
> 
> The per cpu work is *not* focused on sections that access per cpu data, so
> how could it destroy that? Nothing is changed there so far. The this_cpu
> ops are introducing per cpu atomic operations that are safe and cheap
> regardless of the execution context. The primary initial motivation was
> incrementing per cpu counters without having to disabling interrupts
> and/or preemption and it grew from there.

I think you need to look at 20b876918c065818b3574a426d418f68b4f8ad19 and
try again. You removed get_cpu_var()/put_cpu_var() and replaced it with
naked preempt_disable()/preempt_enable(). That's loosing information
right there.

Also, I think if you do s/__this_cpu/this_cpu/ on that function you can
simply drop the preempt_enable/disable things.

> The atomic per cpu operations (like the this_cpu_cmpxchg) allow the
> construction of cheap sections that would satisfy your goals too (with
> some work and the use of transaction ids instead of locking). See the slub
> fastpath f.e.

The slub fastpath is a shining example of crap. Its horrid code and
there was nothing wrong with actually disabling preemption over it, even
for -rt. Sure you made it go faster, but thats not the point.

Most of the slub problems with -rt are in the slow path where you still
have per-cpu assumptions and keep preempt/irqs disabled.

I don't think it is possible, nor desirable, to wreck all per-cpu usage
in the kernel that way.

  reply	other threads:[~2011-07-27 16:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 21:06 Peter Zijlstra
2011-07-26 21:32 ` Christoph Lameter
2011-07-27 12:11   ` Peter Zijlstra
2011-07-27 13:01     ` Peter Zijlstra
2011-07-27 14:20       ` Christoph Lameter
2011-07-27 16:20         ` Peter Zijlstra [this message]
2011-07-27 16:29           ` Peter Zijlstra
2011-07-27 17:04             ` Christoph Lameter
2011-07-27 16:53           ` Christoph Lameter
2011-07-27 14:16     ` Christoph Lameter
2011-07-27 16:20       ` Peter Zijlstra
2011-07-27 17:13         ` Christoph Lameter
2011-07-27 17:33           ` Thomas Gleixner
2011-07-27 20:48             ` Christoph Lameter
2011-07-27 22:17               ` Thomas Gleixner
2011-07-28 13:50                 ` 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=1311783617.5890.179.camel@twins \
    --to=peterz@infradead.org \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@us.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.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

all inboxes | Powered by JetHome®