Optimize the ordering of sections in RW_DATA_SECTION.
authorTim Abbott <tabbott@ksplice.com>
Thu, 24 Sep 2009 14:36:16 +0000 (10:36 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Sep 2009 00:16:21 +0000 (17:16 -0700)
The old RW_DATA_SECTION had INIT_TASK_DATA (which was
more-than-PAGE_SIZE-aligned), followed by a bunch of small alignment
stuff, followed by more PAGE_SIZE-aligned stuff, so you wasted memory
in the middle of .data re-aligning back up to PAGE_SIZE.

This patch sorts the sections by alignment requirements, which should
pack them essentially optimally.

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/asm-generic/vmlinux.lds.h

index 29ca8f53ffbe203fc00960e495fb39c3f959fc51..b6e818f4b24756a4a7eeb570260a9894490acb4c 100644 (file)
        . = ALIGN(PAGE_SIZE);                                           \
        .data : AT(ADDR(.data) - LOAD_OFFSET) {                         \
                INIT_TASK_DATA(inittask)                                \
+               NOSAVE_DATA                                             \
+               PAGE_ALIGNED_DATA(pagealigned)                          \
                CACHELINE_ALIGNED_DATA(cacheline)                       \
                READ_MOSTLY_DATA(cacheline)                             \
                DATA_DATA                                               \
                CONSTRUCTORS                                            \
-               NOSAVE_DATA                                             \
-               PAGE_ALIGNED_DATA(pagealigned)                          \
        }
 
 #define INIT_TEXT_SECTION(inittext_align)                              \