]> git.sesse.net Git - stockfish/blobdiff - src/syzygy/tbprobe.cpp
Turn on MADV_RANDOM for Syzygy mmaps, so that the kernel may know it can reduce the...
[stockfish] / src / syzygy / tbprobe.cpp
index 8194f4b4b401077669a1dd5f34087ba8edb97eb6..03cffca17bc4756839443559ea4247bb13c05d6d 100644 (file)
@@ -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) {