Re: [PATCH] MN10300: Fix the PERCPU() alignment to allow for workqueues

From: Tejun Heo
Date: Tue Oct 26 2010 - 10:57:21 EST


Hello, David.

On 10/26/2010 04:50 PM, David Howells wrote:
>>> FRV's page size is 16KB, so on that we really don't want it to be
>>> PAGE_SIZE.
>>
>> Why not? It's in the init section which will be freed anyway and with
>> the kernel image compression it's not even gonna add any noticeable
>> amount to the kernel image size. There isn't any benefit in using
>> anything smaller than PAGE_SIZE for alignment. Also, percpu allocator
>> guarantees alignment requirement upto PAGE_SIZE is honored. If the
>> output section uses smaller alignment, the percpu AS will end up being
>> misaligned.
>
> The bootloader we have doesn't do decompression.

I see. :-(

> On the other hand, does the PERCPU stuff need to be allocated space
> in the image by the linker? Can it be initialised to anything other
> than zeros?

Sure, for example, in kernel/timer.c.

static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases;

It doesn't seem too popular at this point tho.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/