From: Ingo Molnar <mingo@elte.hu>
To: akpm@linux-foundation.org
Cc: tglx@linutronix.de, hpa@zytor.com, alex.shi@intel.com,
cl@gentwo.org, sfr@canb.auug.org.au, tj@kernel.org,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [patch 5/8] x86: use this_cpu_xxx to replace percpu_xxx funcs
Date: Tue, 6 Mar 2012 08:46:01 +0100 [thread overview]
Message-ID: <20120306074601.GD23669@elte.hu> (raw)
In-Reply-To: <20120305230515.A9238A02AE@akpm.mtv.corp.google.com>
* akpm@linux-foundation.org <akpm@linux-foundation.org> wrote:
> From: Alex Shi <alex.shi@intel.com>
> Subject: x86: use this_cpu_xxx to replace percpu_xxx funcs
>
> Since percpu_xxx() serial functions are duplicate with this_cpu_xxx().
> Removing percpu_xxx() definition and replacing them by this_cpu_xxx() in
> code.
>
> And further more, as Christoph Lameter's requirement, I try to use
> __this_cpu_xx to replace this_cpu_xxx if it is in preempt safe scenario.
> The preempt safe scenarios include:
> 1, in irq/softirq/nmi handler
> 2, protected by preempt_disable
> 3, protected by spin_lock
> 4, if the code context imply that it is preempt safe, like the code is
> follows or be followed a preempt safe code.
>
> BTW, In fact, this_cpu_xxx are same as __this_cpu_xxx since all funcs
> implement in a single instruction for x86 machine. But it maybe other
> platforms' performance.
but this is an x86 only patch.
> - percpu_write(irq_regs, new_regs);
> + __this_cpu_write(irq_regs, new_regs);
So what's the point of all this ugly churn?
Will percpu_write() be removed altogether? If so then the
changelog should say *that*, and explain that on x86 this is a
simple renaming of the API, not a long explanation about
scenarios that don't actually matter.
If percpu_write() is not being removed then I don't see how this
patch is an improvement: it's supposed to result in the same
instructions being emitted, and __this_cpu_write() et al are
distinctly longer to write ...
So what's the plan here?
Thanks,
Ingo
next parent reply other threads:[~2012-03-06 7:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120305230515.A9238A02AE@akpm.mtv.corp.google.com>
2012-03-06 7:46 ` Ingo Molnar [this message]
2012-03-06 7:55 ` [patch 5/8] x86: use this_cpu_xxx to replace percpu_xxx funcs Andrew Morton
2012-03-06 7:57 ` Ingo Molnar
2012-03-06 16:33 ` 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=20120306074601.GD23669@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@intel.com \
--cc=cl@gentwo.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--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 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.