[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1011291009470.3923@router.home>
Date: Mon, 29 Nov 2010 10:11:38 -0600 (CST)
From: Christoph Lameter <cl@...ux.com>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
cc: akpm@...ux-foundation.org, Pekka Enberg <penberg@...helsinki.fi>,
linux-kernel@...r.kernel.org,
Eric Dumazet <eric.dumazet@...il.com>,
Tejun Heo <tj@...nel.org>
Subject: Re: [thisops uV2 09/10] x86: this_cpu_cmpxchg and this_cpu_cmpxchg_double
operations
On Sat, 27 Nov 2010, Mathieu Desnoyers wrote:
> > + */
> > +#define percpu_cmpxchg16b(pcp, o1, o2, n1, n2) \
> > +({ \
> > + char __ret; \
> > + typeof(o1) __o1 = o1; \
> > + typeof(o1) __n1 = n1; \
> > + typeof(o2) __o2 = o2; \
> > + typeof(o2) __n2 = n2; \
> > + typeof(o2) __dummy; \
> > + VM_BUG_ON(((unsigned long)pcp) % 16); \
>
> Restricting typing on "pcp" at build time might be more appropriate. E.g.
> creating a "struct doublecas" that would be forcefully aligned on 16 bytes. We
> could check that with __builtin_types_compatible_p and generate a build failure
> if necessary.
That would in turn restrict the types which can be used with
cmpxchg_double. The existing slub implementation already uses a mixture of
pointer and unsigned long. And there are 32 bit and 64 bit variants
already.
--
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