[Cbe-oss-dev] spufs: make isolated loader properly aligned

Arnd Bergmann arnd at arndb.de
Sat Aug 11 03:39:04 EST 2007


On Friday 10 August 2007, Sebastian Siewior wrote:
> 
> -       /* kmalloc should align on a 16 byte boundary..* */
> -       isolated_loader = kmalloc(size, GFP_KERNEL);
> -       if (!isolated_loader)
> +       /* loader requires mem that is align on a 16 byte boundary */
> +       isolated_loader_mem = kmalloc(size + 15, GFP_KERNEL);
> +       if (!isolated_loader_mem)
>                 return;
>  

How about just using vmalloc or alloc_pages instead of kmalloc?
That would guarantee page alignment without making the code
more complicated. It would waste a little more memory though,
but there is only one allocation at most, so it shouldn't hurt
much.

	Arnd <><



More information about the cbe-oss-dev mailing list