Subject: Re: [PATCH] powerpc: force 4k update_flash block and list sizes

From: Michael Ellerman <[email-masked]>
Date: Thu, 09 Nov 2006 09:40:18 +1100

On Wed, 2006-11-08 at 10:28 +0100, Arnd Bergmann wrote:
> On Wednesday 08 November 2006 05:41, Michael Ellerman wrote:
> > Just being picky .. but why did you decide to use the slab cache? Does
> > it make the code neater? I would have thought you could guarantee 4k
> > alignment some other way, and it seems slightly odd to use the slab
> > cache for something you only do once ..
> 
> There are not so many allocators available. kmalloc does not guarantee
> alignment beyond a few bytes and the buddy allocator and vmalloc don't
> give you allocations smaller than PAGE_SIZE.

Yeah, I assumed kmalloc aligned on the size of the allocation, but it
doesn't looking at the code. We could set ARCH_KMALLOC_MINALIGN to 4k,
but that aligns all caches which is probably not what we want.

> The ehca people had the same problem, and I could imagine there are
> others with similar issues. How about adding a special slab allocator
> architecture-wide that gives out aligned 4k chunks independent of
> page size?

Yeah that sounds like a plan, I'm sure there's other code around that
could use it.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person