Re: [PATCH 6/6] percpu: Add preemption checks to __this_cpu ops
From: Peter Zijlstra
Date: Wed Oct 16 2013 - 13:12:14 EST
On Wed, Oct 16, 2013 at 12:52:38PM -0400, Steven Rostedt wrote:
> On Wed, 16 Oct 2013 18:25:37 +0200
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> > But yes, the way its set-up an arch could indeed provide __this_cup_$op
> > itself -- without providing the _$n variants; in which case the
> > raw_cpu_$op provided by you is broken.
> >
> > Can't we have a 'simple' coccinelle script rename the entire __this_cpu*
> > implementation over to raw_cpu* and then provide generic __this_cpu* ->
> > raw_cpu maps?
> >
>
> Perhaps we should match the way spinlocks are.
>
>
> this_cpu*() be the normal use.
>
> raw_this_cpu() could perhaps not do the checks?
>
> arch_this_cpu() be the architecture specific version of this_cpu*
In that case we'd need to do something like:
this_cpu_$op -> this_cpu_$op_irq (disables irqs itself)
__this_cpu_$op -> this_cpu_$op (with check)
-> raw_cpu_$op (without the check)
I don't think the arch bits feature heavily for percpu; normally an arch
provides __this_cpu_$op_$n; raw_cpu_$op_$n in my latest proposal.
Anyway; I don't think the spinlock pattern matches too good and I don't
mind the proposed:
this_cpu_$op (disables IRQs itself)
__this_cpu_$op (with preemption check)
raw_cpu_$op (without preemption check)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/