* What is the difference between percpu_xxx and this_cpu_xxx?
@ 2011-09-13 4:28 Huang Ying
2011-09-13 6:11 ` Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: Huang Ying @ 2011-09-13 4:28 UTC (permalink / raw)
To: Tejun Heo, Christoph Lameter; +Cc: LKML
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?
Best Regards,
Huang Ying
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What is the difference between percpu_xxx and this_cpu_xxx?
2011-09-13 4:28 What is the difference between percpu_xxx and this_cpu_xxx? Huang Ying
@ 2011-09-13 6:11 ` Eric Dumazet
2011-09-13 6:14 ` Huang Ying
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2011-09-13 6:11 UTC (permalink / raw)
To: Huang Ying; +Cc: Tejun Heo, Christoph Lameter, LKML
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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What is the difference between percpu_xxx and this_cpu_xxx?
2011-09-13 6:11 ` Eric Dumazet
@ 2011-09-13 6:14 ` Huang Ying
2011-09-13 7:40 ` Tejun Heo
0 siblings, 1 reply; 4+ messages in thread
From: Huang Ying @ 2011-09-13 6:14 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Tejun Heo, Christoph Lameter, LKML
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)
Thanks for clarification. Is there someone working on the transition?
Is that possible to translate most percpu_xxx to this_cpu_xxx blindly?
Best Regards,
Huang Ying
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What is the difference between percpu_xxx and this_cpu_xxx?
2011-09-13 6:14 ` Huang Ying
@ 2011-09-13 7:40 ` Tejun Heo
0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2011-09-13 7:40 UTC (permalink / raw)
To: Huang Ying; +Cc: Eric Dumazet, Christoph Lameter, LKML
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-13 7:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-13 4:28 What is the difference between percpu_xxx and this_cpu_xxx? Huang Ying
2011-09-13 6:11 ` Eric Dumazet
2011-09-13 6:14 ` Huang Ying
2011-09-13 7:40 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox