Re: [PATCH v2 0/6] macros for section name cleanup

From: Mike Frysinger
Date: Mon May 04 2009 - 13:42:23 EST


On Mon, May 4, 2009 at 12:32, Tim Abbott wrote:
> On Mon, 4 May 2009, Sam Ravnborg wrote:
>> +#define RW_DATA_SECTION(page_align, readmostly_align, cache_align,
>> inittask_align) \
>> + Â Â . = ALIGN(PAGE_SIZE); Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
>> + Â Â .data : AT(ADDR(.data) - LOAD_OFFSET) { Â Â Â Â Â Â Â Â Â Â Â Â \
>> + Â Â Â Â Â Â DATA_DATA Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
>> + Â Â Â Â Â Â CONSTRUCTORS Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
>> + Â Â Â Â Â Â NOSAVE_DATA Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
>> + Â Â Â Â Â Â PAGE_ALIGNED_DATA(page_align) Â Â Â Â Â Â Â Â Â Â Â Â Â \
>> + Â Â Â Â Â Â READMOSTLY_DATA(readmostly_align) Â Â Â Â Â Â Â Â Â Â Â \
>> + Â Â Â Â Â Â CACHELINE_ALIGNED_DATA(cache_align) Â Â Â Â Â Â Â Â Â Â \
>> + Â Â Â Â Â Â INIT_TASK(inittask_align) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
>> + Â Â }
>
> How did you pick the order of the sections here? ÂI would think that to
> pack the .data section efficiently, you'd want to sort by alignment
> requirements so that e.g. all the at-least-page aligned sections are
> adjacent (INIT_TASK and the page-aligned sections are separated by some
> much smaller aligments here).

if this were actually the case, there should of course be some /*
comments */ above the define explaining that the order wasnt
arbitrarily pulled like a rabbit from an orifice. if you're
scratching your head, then there's going to be plenty more people who
never ask but treat it like untouchable voodoo.
-mike
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i