d9e84fb1a3
For now, vmlinux relocation functions for relocatable kernel are implemented as an array of handlers of a particular type. Convert that array into a single switch-case function to: - remove unused arguments; - change the return type of simple handlers to void; - remove the array and don't use any data at all; - avoid using indirect calls; - allow the compiler to inline and greatly optimize the relocation function[s]; and also mark do_relocations() and show_kernel_relocation() static as they aren't used anywhere else. The result on MIPS32 R2 with GCC 10.2 -O2 is: scripts/bloat-o-meter -c arch/mips/kernel/__relocate.o arch/mips/kernel/relocate.o add/remove: 0/6 grow/shrink: 1/0 up/down: 356/-640 (-284) Function old new delta relocate_kernel 852 1208 +356 apply_r_mips_32_rel 20 - -20 apply_r_mips_hi16_rel 40 - -40 apply_r_mips_64_rel 44 - -44 apply_r_mips_26_rel 144 - -144 show_kernel_relocation 164 - -164 do_relocations 228 - -228 Total: Before=1780, After=1496, chg -15.96% add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-76 (-76) Data old new delta reloc_handlers_rel 76 - -76 Total: Before=92, After=16, chg -82.61% add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) RO Data old new delta Total: Before=0, After=0, chg +0.00% All functions were collapsed into the main one, relocate_kernel(). Signed-off-by: Alexander Lobakin <alobakin@pm.me> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> |
||
---|---|---|
Documentation | ||
LICENSES | ||
arch | ||
block | ||
certs | ||
crypto | ||
drivers | ||
fs | ||
include | ||
init | ||
ipc | ||
kernel | ||
lib | ||
mm | ||
net | ||
samples | ||
scripts | ||
security | ||
sound | ||
tools | ||
usr | ||
virt | ||
.clang-format | ||
.cocciconfig | ||
.get_maintainer.ignore | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
COPYING | ||
CREDITS | ||
Kbuild | ||
Kconfig | ||
MAINTAINERS | ||
Makefile | ||
README |
README
Linux kernel ============ There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first. In order to build the documentation, use ``make htmldocs`` or ``make pdfdocs``. The formatted documentation can also be read online at: https://www.kernel.org/doc/html/latest/ There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation. Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.