Re: 2.4 vm, program load, page faulting, ...

Andrew Morton
2003-03-17T22:05:09Z

Alex Tomas <bzzz@tmi.comex.ru> wrote:
>
> w> You should ask Andrew about his patch to do exactly that: he
> w> forced all PROC_EXEC mmaps to be nonlinear-mapped and this forced
> w> all programs to suck entire binaries into memory... I recall he
> w> saw at least 25% improvement at launching gnome.
>
> they talked about pages _already present_ in pagecache.

2.5.64-mm8 does that too. At mmap-time it will, for a PROT_EXEC mapping,
pull every affected page off disk and it will instantiate pte's against
them all via install_page().

So there should be zero major and minor faults against that mmap region
during application startup.

The improved IO layout appears to halve startup time for big things. I
haven't attempted to instrument the effects of the reduced minor fault rate.
If indeed the rate _has_ decreased. If it hasn't, it's a bug...

This is all a bit dubious for several reasons. Most particularly, the
up-front instantiation of the pages in pagetables makes unneeded pages harder
to reclaim. It would be really neat if someone could try putting the
madvise(MADV_WILLNEED) into glibc and test that. Maybe on a 2.4 kernel.