[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1290790887.2855.260.camel@edumazet-laptop>
Date: Fri, 26 Nov 2010 18:01:27 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Tejun Heo <tj@...nel.org>
Cc: Christoph Lameter <cl@...ux.com>, akpm@...ux-foundation.org,
Pekka Enberg <penberg@...helsinki.fi>,
linux-kernel@...r.kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [thiscpuops upgrade 08/10] percpu: generic this_cpu_cmpxchg()
and this_cpu_cmpxchg_double support
Le vendredi 26 novembre 2010 à 17:58 +0100, Tejun Heo a écrit :
> On 11/26/2010 05:56 PM, Eric Dumazet wrote:
> > Le vendredi 26 novembre 2010 à 17:51 +0100, Tejun Heo a écrit :
> >> On 11/24/2010 12:51 AM, Christoph Lameter wrote:
> >>> +/*
> >>> + * cmpxchg_double replaces two adjacent scalars at once. The first parameter
> >>> + * passed is a percpu pointer, not a scalar like the other this_cpu
> >>> + * operations. This is so because the function operates on two scalars
> >>> + * (must be of same size). A truth value is returned to indicate success or
> >>> + * failure (since a double register result is difficult to handle).
> >>> + * There is very limited hardware support for these operations. So only certain
> >>> + * sizes may work.
> >>> + */
> >>> +#define __this_cpu_generic_cmpxchg_double(pcp, oval1, oval2, nval1, nval2) \
> >>
> >> Ah... this is scary. If it proves to be useful enough, sure, but
> >> otherwise I'd like to avoid it.
> >
> > This is mandatory for several lockless algos, dont be afraid, its a
> > single instruction ;)
>
> Thanks for holding my hands. :-)
>
> What I'm afraid of is generic code switching to use it in very hot
> paths when a lot of archs can't actually do it leading to performance
> regressions. Is this something which is available on most archs?
>
I would say cmpxchg() has the same problem, some arches dont have a
native instruction, yet we use it in some paths.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists