[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1203200919520.19333@router.home>
Date: Tue, 20 Mar 2012 09:21:24 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Lai Jiangshan <laijs@...fujitsu.com>
cc: Pekka Enberg <penberg@...nel.org>, Matt Mackall <mpm@...enic.com>,
Tejun Heo <tj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [RFC PATCH 2/6] slub: add kmalloc_align()
On Tue, 20 Mar 2012, Christoph Lameter wrote:
> > diff --git a/mm/slub.c b/mm/slub.c
> > index 4907563..01cf99d 100644
> > --- a/mm/slub.c
> > +++ b/mm/slub.c
> > @@ -3238,7 +3238,7 @@ static struct kmem_cache *__init create_kmalloc_cache(const char *name,
> > * This function is called with IRQs disabled during early-boot on
> > * single CPU so there's no need to take slub_lock here.
> > */
> > - if (!kmem_cache_open(s, name, size, ARCH_KMALLOC_MINALIGN,
> > + if (!kmem_cache_open(s, name, size, ALIGN_OF_LAST_BIT(size),
> > flags, NULL))
> > goto panic;
>
> Why does the alignment of struct kmem_cache change? I'd rather have a
> __alignof__(struct kmem_cache) here with alignment specified with the
> struct definition.
Ok this aligns the data not the cache . Ok I see what is going on here.
So the kmalloc array now has a higher alignment. That means you can align
up to that limit within the structure.
--
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