diff options
author | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2015-04-06 01:19:07 +0200 |
---|---|---|
committer | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2015-04-06 01:19:07 +0200 |
commit | b1b5793d26195689a29ade3f8bd9903cc046fd84 (patch) | |
tree | f42e0a74eac33abe37bb85ee8a4efaac7c4ea91a | |
parent | d803582a32ed50400c57c75764300a7ab6b192e9 (diff) | |
download | fmlock-b1b5793d26195689a29ade3f8bd9903cc046fd84.tar.gz fmlock-b1b5793d26195689a29ade3f8bd9903cc046fd84.tar.bz2 |
info message, README updated
-rw-r--r-- | README | 27 | ||||
-rw-r--r-- | fmlock.c | 2 |
2 files changed, 18 insertions, 11 deletions
@@ -1,12 +1,17 @@ -== fmlock -- map a file into memory and lock it to RAM == +== fmlock -- map files into memory and lock them to RAM == -fmlock is a small tool intended to load a file into the -block I/O cache and lock it there. This is done by mmap-ing -the whole file and calling mlock on the address space -occupied by the file. Then the program puts itself to sleep -until a signal arrives. The purpose of this is that (large) -files can be preloaded into RAM, specifically the block I/O -cache for other processes to read from. This is for example -required to measure the RAM bandwidth and CPU limited -throughput of data processing code, working on real data -without getting effected by I/O bottlenecks. +fmlock is a small tool intended to load file into the block I/O cache and lock +them there. This is done by mmap-ing the whole file and calling mlock on the +address space occupied by the file. In addition the whole file is read to heat +the cache; this should not be necessary, but some systems may require this, for +this tool to be effective.o + +Once the files are locked into memory and the cache is hot the program puts +itself to sleep until a signal arrives. Once the program is sleeping that's it. +Any changes to the files that'd require to remap the files are not caught by +fmlock and the cache on any changed or grown pages may become cold over time. + +The purpose of this is that (large) files can be preloaded into RAM, namely the +block I/O cache for other processes to read from. This is for example required +to measure the RAM bandwidth and CPU limited throughput of data processing code, +working on real data without getting effected by I/O bottlenecks. @@ -103,6 +103,8 @@ int main(int argc, char *argv[]) return 1; } + fprintf(stderr, "Files locked and cache heated up. Going to sleep, .zZ...\n"); + /* At this point the program shall sleep until a terminating * signal arrives. To do so a nice side effect of the definition * of /dev/null behavior is used: read on a /dev/null fd always |