From 8c0a2733924f59316003c576ee2064ded490678b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 24 Nov 2018 11:17:12 +0100 Subject: [PATCH 1/1] Turn on MADV_RANDOM for Syzygy mmaps, so that the kernel may know it can reduce the readahead. --- src/syzygy/tbprobe.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 8194f4b4..03cffca1 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -216,6 +216,7 @@ public: fstat(fd, &statbuf); *mapping = statbuf.st_size; *baseAddress = mmap(nullptr, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0); + madvise(*baseAddress, statbuf.st_size, MADV_RANDOM); ::close(fd); if (*baseAddress == MAP_FAILED) { -- 2.39.2