Re: [cpuops cmpxchg double V2 1/4] Generic support forthis_cpu_cmpxchg_double

From: Tejun Heo
Date: Sat Jan 08 2011 - 12:25:02 EST


Hello,

On Fri, Jan 07, 2011 at 12:41:58PM -0600, Christoph Lameter wrote:
> On Fri, 7 Jan 2011, Mathieu Desnoyers wrote:
>
> > I have to admit that I also hate the current interface for two reasons:

Call me weird but I like this one than others. It sure is ugly but
the operation itself isn't a particularly pretty so it kinda matches.
Also, this one is the least error prone and more consistent with other
cpu ops.

> > b) the loss of the value read (the fact that the only current user of this API
> > does not need the value returned seems like a very weak argument to define an
> > API).
>
> The other user of cmpxchg_double that I have in my tree also does not have
> the need. Repeatability is not as simple to implement as with a single
> word cmpxchg.

Yeah, even in regular cmpxchg, the read value on failure isn't of very
high value. The cpu usually has to go retry anyway && likely to have
the cacheline already, so it's not gonna cost much.

So, yeah, of the proposed ones, this is my favorite. Peter and
Mathieu don't like it. What do others think? Pekka, Eric, Andrew,
what do you guys think?

Thanks.

--
tejun
--
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/