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

wind
2003-03-18T00:00:04Z

On Mon, Mar 17, 2003 at 03:28:55PM -0800, Andrew Morton wrote:
> wind@cocodriloo.com wrote:
> >
> > > 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.
> >
> >
> > something like this one?
> >
>
> No, not at all. I meant a patch against glibc, not against the kernel!
>
> Like this:
>
> map = mmap(..., PROT_EXEC, ...);
> + if (getenv("MAP_PREFAULT"))
> + madvise(map, length, MADV_WILLNEED);

I know what you mean, but right now it's far easier hacking the
kernel than libc, at least if running a uml-kernel ;)

Anyways, I booted my patch but I don't know if it's working, because
I've got no test machine to try it on... but, it didn't freak out
so I think it works :)))

As for the libc patch, I think it can be easier to make an
exec-prefault.so library and LD_PRELOAD it, at least for testing
purposes.

If you could tell me the locking is right, I might try patching my
physical machine 2.4.19-ck4 with the kernel patch just to see if it
works.