[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1107121057550.2931@router.home>
Date: Tue, 12 Jul 2011 10:59:36 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Pekka Enberg <penberg@...helsinki.fi>,
David Rientjes <rientjes@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [slubllv7 06/17] slub: Add cmpxchg_double_slab()
On Mon, 11 Jul 2011, Eric Dumazet wrote:
> > @@ -338,6 +342,37 @@ static inline int oo_objects(struct kmem
> > return x.x & OO_MASK;
> > }
> >
> > +static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page,
> > + void *freelist_old, unsigned long counters_old,
> > + void *freelist_new, unsigned long counters_new,
> > + const char *n)
> > +{
> > +#ifdef CONFIG_CMPXCHG_DOUBLE
> > + if (s->flags & __CMPXCHG_DOUBLE) {
> > + if (cmpxchg_double(&page->freelist,
> > + freelist_old, counters_old,
> > + freelist_new, counters_new))
> > + return 1;
> > + } else
> > +#endif
> > + {
> > + if (page->freelist == freelist_old && page->counters == counters_old) {
> > + page->freelist = freelist_new;
> > + page->counters = counters_new;
> > + return 1;
> > + }
> > + }
>
> This works only on 64bit arches, where page->counters get all following
> fields combined : inuse, objects, frozen, _count
>
> On 32bit arch, I am afraid you have to disable the cmpxchg_double()
> thing ?
We do not need to have _count included. This is just there because the
field is in the way on 64 bit and we can only do 2x 64 bit cmpxchges. On
32 bi we can drop _count from "counters".
--
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