Re: binary format loader cache?

tytso@mit.edu
Mon, 7 Apr 1997 15:00:32 -0500


Date: Fri, 4 Apr 1997 15:11:59 +0200 (MET DST)
From: Ingo Molnar <mingo@pc5829.hil.siemens.at>

is anyone working on the above thing? It looks like an overkill to look up
the very same ~3 binary loaders for every do_exec() in a typical Linux
system, and wasting some ~300 usecs (or more) per lookup.

We should very clearly change the binfmt interfaces so that open_inode()
is called by do_execve(), instead of opening the file each time for
binary format. Aaron Tiensivu's patch to speed up get_empty_filp() is
important too, but there's a much more direct way to speed up
do_execve(), which we should do right away. We should change the order
of binfmt_setup() so that the most common binfmts are checked first, not
last. i.e.,

void binfmt_setup(void)
{
/* This cannot be configured out of the kernel */
init_script_binfmt();
#ifdef CONFIG_BINFMT_JAVA
init_java_binfmt();
#endif
#ifdef CONFIG_BINFMT_AOUT
init_aout_binfmt();
#endif
#ifdef CONFIG_BINFMT_ELF
init_elf_binfmt();
#endif
}

(the way register_binfmt() works, the last binfmt is searched first).

This will optimize for the common case, where I'm assuming that ELF
binaries are most common, A.out binaries are next most common, and JAVA
and shell script executables are least common.

- Ted