From: Tejun Heo <tj@kernel.org>
To: Huang Ying <ying.huang@intel.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Christoph Lameter <cl@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: What is the difference between percpu_xxx and this_cpu_xxx?
Date: Tue, 13 Sep 2011 16:40:04 +0900 [thread overview]
Message-ID: <20110913074004.GA11397@mtj.dyndns.org> (raw)
In-Reply-To: <4E6EF4AE.4030503@intel.com>
On Tue, Sep 13, 2011 at 02:14:06PM +0800, Huang Ying wrote:
> Hi, Eric,
>
> On 09/13/2011 02:11 PM, Eric Dumazet wrote:
> > Le mardi 13 septembre 2011 à 12:28 +0800, Huang Ying a écrit :
> >> Hi,
> >>
> >> If my understanding was correct, from the kernel source code, it appears
> >> that percpu_xxx and this_cpu_xxx have the same semantics and
> >> implementation in effect, haven’t them?
> >>
> >> If so, why do we need two API for the same thing?
> >
> > History mostly, and transition.
> >
> > percpu_inc() was an x86 only thing
> >
> > __get_cpu_var(var)++ -> percpu_inc(var) -> this_cpu_inc(var)
Also, we used to need separate accessors for static and dynamic percpu
variables, so we have quite a few duplications in the interface.
> Thanks for clarification. Is there someone working on the transition?
> Is that possible to translate most percpu_xxx to this_cpu_xxx blindly?
It's on my todo list but AFAIK nobody is actually working on it yet.
Thanks.
--
tejun
prev parent reply other threads:[~2011-09-13 7:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-13 4:28 Huang Ying
2011-09-13 6:11 ` Eric Dumazet
2011-09-13 6:14 ` Huang Ying
2011-09-13 7:40 ` Tejun Heo [this message]
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=20110913074004.GA11397@mtj.dyndns.org \
--to=tj@kernel.org \
--cc=cl@linux-foundation.org \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ying.huang@intel.com \
/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®