Re: [PATCH RFC tip/core/rcu] rcu: direct algorithmic SRCUimplementation

From: Mathieu Desnoyers
Date: Thu Feb 16 2012 - 06:14:19 EST


* Peter Zijlstra (peterz@xxxxxxxxxxxxx) wrote:
> On Thu, 2012-02-16 at 05:50 -0500, Mathieu Desnoyers wrote:
> > > Ah, so something like this?
> > >
> > > ACCESS_ONCE(this_cpu_ptr(sp->per_cpu_ref)->c[idx]) +=
> > > SRCU_USAGE_COUNT + 1;
> > >
> > > Now that you mention it, this does look nicer, applied here and to
> > > srcu_read_unlock().
> >
> > I think Peter refers to __this_cpu_add().
>
> I'm not sure that implies the ACCESS_ONCE() thing
>

Fair point. The "generic" fallback for this_cpu_add does not imply the
ACCESS_ONCE() semantic AFAIK. I don't know if there would be a clean way
to get both without duplicating these operations needlessly.

Thanks,

Mathieu


--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
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/