From: Steinar H. Gunderson Date: Sat, 24 Nov 2018 10:17:12 +0000 (+0100) Subject: Turn on MADV_RANDOM for Syzygy mmaps, so that the kernel may know it can reduce the... X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=8c0a2733924f59316003c576ee2064ded490678b Turn on MADV_RANDOM for Syzygy mmaps, so that the kernel may know it can reduce the readahead. --- 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) {