Commit e1060eda authored by Artur Bergman's avatar Artur Bergman

Tell the kernel that we expect to use this memory randomly -- affects how it...

Tell the kernel that we expect to use this memory randomly -- affects how it reads up to page cache. On linux I saw a 10-20x decrease in IO from reading the disk

git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4032 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 34a47937
......@@ -417,6 +417,7 @@ smf_open_chunk(struct smf_sc *sc, off_t sz, off_t off, off_t *fail, off_t *sum)
p = mmap(NULL, sz, PROT_READ|PROT_WRITE,
MAP_NOCORE | MAP_NOSYNC | MAP_SHARED, sc->fd, off);
if (p != MAP_FAILED) {
(void) madvise(p, sz, MADV_RANDOM);
(*sum) += sz;
new_smf(sc, p, off, sz);
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment