Behavior of madvise(MADV_FREE)
Poul-Henning Kamp
phk at phk.freebsd.dk
Fri Oct 12 18:46:46 UTC 2012
--------
In message <50786023.1000206 at rice.edu>, Alan Cox writes:
>Given the way that madvise(MADV_FREE) is still used by malloc()/free(),
>any additional overhead would still be a pessimization most of the
>time.
That would be my fear too.
>Over the years, I think you and I have both said that what we
>really need is the ability for the kernel to deliver an event to
>malloc()/free() when memory is trending toward scarcity.
I still think this would be a good idea, and I can only assume that
the absense of this feature is due to Jason Evans failing in his
malloc-maintainers duty of bugging the VM people for this feature
at every conceiveable opportunity :-)
That being said, my experience with Varnish does indicate that intelligent
use of VM from userland is close to a lost case, in no small part because
of the lack of a good API.
If you can spare a student of sufficient quality, it might be a good assignment
to design a new VM-API, relative to the current reality of things like
malware attacks, "no-execute" bits etc.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the freebsd-arch
mailing list