[lkml]   [2012]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch 5/8] x86: use this_cpu_xxx to replace percpu_xxx funcs

* <> wrote:

> From: Alex Shi <>
> 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?



 \ /
  Last update: 2012-03-06 08:49    [W:0.040 / U:1.196 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site