Difference between revisions of "Hardcode kernel module info"

From eLinux.org
Jump to: navigation, search
(Patch for 2.4.17 kernel)
(Patch for 2.4.17 kernel: switch from Image link to Media link)
Line 33: Line 33:
  
 
== Patch for 2.4.17 kernel ==
 
== Patch for 2.4.17 kernel ==
Download the patch at: [[Image:Elf plt info.patch]]
+
Download the patch at: [[Media:Elf plt info.patch|Elf_plt_info.patch]]
  
 
This patch makes it possible to specify the core size and init size, avoiding the call to module_frob_arch_sections()
 
This patch makes it possible to specify the core size and init size, avoiding the call to module_frob_arch_sections()

Revision as of 23:31, 18 September 2007

Sony found that with the 2.4 kernel, and an extremely large kernel loadable module, it could take the kernel module loader up to 3 seconds just to scan the relocation table for the module in order to load it.

The following patch allows one to pass some arguments to the kernel command line to hardcode some of the information that is detected at module load time. This reduced the module load time significantly for this situation.

This is a very specialized problem, but in case some one finds this useful, here's a more detailed description of the problem, and a patch:

Detailed problem description

We've found that module_frob_arch_sections(ppc) takes a long time to find unique symbols in the relocation sections of the kernel module's elf header.

Our particular kernel module had a relocation section with 13757 entries(2749 unique ones) in it, and for this module, we measured 3 seconds to process this section by count_reloc function.

(There may be a way to not generate all this many entries, or not do the relocations in insmod etc... but we don't know about it at this time.)

We made a patch to just work around this problem by just passing the size info by the argument when insmod happens, and not do actual counting.

-Whether we should think of fixing the count algorithm or other proper way of fixing this. -Whether we should think of an option not to do any relocations at all

Patch for 2.4.17 kernel

Download the patch at: Elf_plt_info.patch

This patch makes it possible to specify the core size and init size, avoiding the call to module_frob_arch_sections()