-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
turn off the cache for a directory #28
Comments
A more generic solution would be to introduce a method to either include (“whitelist”) or exclude (“blacklist”) certain glob patterns. The problem here is that the only way you can configure nocache’s behavior is by specifying environment variables, so this approach would mean you have to: think of two good variable names, parse their contents into an array or a list and then match every open() call against each expression. Feel free to implement this if you need it; I’ll take a look at it, but I currently don’t have the time to do it myself. |
Why so? There are commands which accept options and a command, for example, "nice", "sudo", "env", "time", "xargs". |
True; but the functionality of |
A wildcard never matches the pathname separator, so how do I specify all descendants of a directory by a glob pattern? |
Use
|
Well, I implemented this feature request in my fork. I decided to use POSIX Extended Regular Expressions because they are more straightforward and more powerful than glob patterns. What do you think? |
I don't understand this. Do you think that OS uses the last suggestion instead of joining suggestions from all processes? |
I’ve added some comments to your commit beroal@c3956d3
The reality is a bit more complicated, but in principle, yes. If process A reads file X completely it’s in the FS cache; if B now maps X and does an fadvise with “don’t need” on the file descriptor, the contents are evicted from the cache; subsequent reads of A from X will require going back to the storage medium to retrieve data. In other words: Without this mechanism, you might evict files that are in active use, thereby impacting other processes. |
Then the Linux kernel is kind of stupid. |
Regarding |
Documentation. The cache is disabled for a file iff (I and not E) where I iff the file name satisfies the environment variable NOCACHE_PATTERN_INCLUDE (default: true), E iff the file name satisfies the environment variable NOCACHE_PATTERN_EXCLUDE (default: false). Both variables are treated as POSIX Extended Regular Expressions. |
I left some comments on beroal@1e6061c again.
Yes, and you’re welcome to improve it. The code is in
Can you please add command line options to the |
Look at the type of |
Sorry, I don't know the Bash programming language and I'm happy with that. ;-) |
This rather is a support request. Can I disable the cache for a specific directories? Benefit is as follows. A program transmits big files over a network and stores hosts' metadata in the metadata file. It's better not to disable cache for the metadata file.
The text was updated successfully, but these errors were encountered: