Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nocache
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Danil Mikhailov
nocache
Commits
097ecc4b
Commit
097ecc4b
authored
Apr 24, 2013
by
Julius Plenz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explanation of -n flag / NOCACHE_NR_FADVISE env variable
parent
9461083e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
README
README
+12
-2
No files found.
README
View file @
097ecc4b
...
@@ -34,6 +34,8 @@ For testing purposes, I included two small tools:
...
@@ -34,6 +34,8 @@ For testing purposes, I included two small tools:
* `cachedel` calls `posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED)` on
* `cachedel` calls `posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED)` on
the file argument. Thus, if the file is not accessed by any other
the file argument. Thus, if the file is not accessed by any other
application, the pages will be eradicated from the fs cache.
application, the pages will be eradicated from the fs cache.
Specifying -n <number> will repeat the syscall the given number of
times which can be useful in some circumstances (see below).
* `cachestats` has three modes: In quiet mode (`-q`), the exit status
* `cachestats` has three modes: In quiet mode (`-q`), the exit status
is 0 (success) if the file is fully cached. In normal mode,
is 0 (success) if the file is fully cached. In normal mode,
the number of cached vs. not-cached pages is printed. In verbose
the number of cached vs. not-cached pages is printed. In verbose
...
@@ -94,9 +96,17 @@ There are timing issues to consider, as well. If you consider `nocache
...
@@ -94,9 +96,17 @@ There are timing issues to consider, as well. If you consider `nocache
cat <file>`, in most (all?) cases the cache will not be restored. For
cat <file>`, in most (all?) cases the cache will not be restored. For
discussion and possible solutions see <http://lwn.net/Articles/480930/>.
discussion and possible solutions see <http://lwn.net/Articles/480930/>.
My experience showed that in many cases you could "fix" this by doing
My experience showed that in many cases you could "fix" this by doing
the `posix_fadvise` call *twice*.
If you want this behaviour, compile
the `posix_fadvise` call *twice*.
For both tools `nocache` and
the library using `make CFLAGS=-DDOUBLEFADVISE`.
`cachedel` you can specify the number using `-n`, like so:
$ nocache -n 2 cat ~/file.mp3
This actually only sets the environment variable `NOCACHE_NR_FADVISE`
to the specified value, and the shared library reads out this value.
If test number 3 in `t/basic.t` fails, then try increasing this number
until it works, e.g.:
$ env NOCACHE_NR_FADVISE=2 make test
Acknowledgements
Acknowledgements
----------------
----------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment