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

Sebastian Siewior cbe-oss-dev at ml.breakpoint.cc
Sat Aug 11 06:50:05 EST 2007


* Arnd Bergmann | 2007-08-10 19:39:04 [+0200]:

>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?
alloc_pages expects 2^order so I guess vmalloc is the easy way :)

>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.
vmalloc guarantees page alignment? That is good to know.

>
>	Arnd <><

Sebastian



More information about the cbe-oss-dev mailing list