diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-25 10:30:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 12:10:56 -0500 |
commit | 4bdc3b7f1b730c07f5a6ccca77ee68e044036ffc (patch) | |
tree | 58e79b7865d4d4660711f7f8a2a3cc2ec91e65ec /arch/x86_64/kernel/vmlinux.lds.S | |
parent | 9b2a13b963dece8d45e07692b7872ae5a075ca2a (diff) |
[PATCH] x86_64: Basic reorder infrastructure
This patch puts the infrastructure in place to allow for a reordering of
functions based inside the vmlinux. The general idea is that it is possible
to put all "common" functions into the first 2Mb of the code, so that they
are covered by one TLB entry. This as opposed to the current situation where
a typical vmlinux covers about 3.5Mb (on x86-64) and thus 2 TLB entries.
This is done by enabling the -ffunction-sections flag in gcc, which puts
each function in its own ELF section, so that the linker can then order them
in a way defined by the linker script.
As per previous discussions, Linus said he wanted a "static" list for this,
eg a list provided by the kernel tarbal, so that most people have the same
ordering at least. A script is provided to create this list based on
readprofile(1) output. The included list is provisional, and entirely biased
on my own testbox and me running a few kernel compiles and some other
things.
I think that to get to a better list we need to invite people to submit
their own profiles, and somehow add those all up and base the final list on
that. I'm willing to do that effort if this is ends up being the prefered
approach. Such an effort probably needs to be repeated like once a year or
so to adopt to the changing nature of the kernel.
Made it a CONFIG with default n because it increases link times
dramatically.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/x86_64/kernel/vmlinux.lds.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index 029be20accef..39ff0708f803 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S | |||
@@ -20,7 +20,12 @@ SECTIONS | |||
20 | phys_startup_64 = startup_64 - LOAD_OFFSET; | 20 | phys_startup_64 = startup_64 - LOAD_OFFSET; |
21 | _text = .; /* Text and read-only data */ | 21 | _text = .; /* Text and read-only data */ |
22 | .text : AT(ADDR(.text) - LOAD_OFFSET) { | 22 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
23 | /* First the code that has to be first for bootstrapping */ | ||
23 | *(.bootstrap.text) | 24 | *(.bootstrap.text) |
25 | /* Then all the functions that are "hot" in profiles, to group them | ||
26 | onto the same hugetlb entry */ | ||
27 | #include "functionlist" | ||
28 | /* Then the rest */ | ||
24 | *(.text) | 29 | *(.text) |
25 | SCHED_TEXT | 30 | SCHED_TEXT |
26 | LOCK_TEXT | 31 | LOCK_TEXT |