Feh / nocache

minimize caching effects
BSD 2-Clause "Simplified" License
554 stars 53 forks source link

Doesn't work for pv in conjunction with physical partitions/disks? #40

Closed birdie-github closed 4 years ago

birdie-github commented 4 years ago

There's this utility pv which allows to see a nice progress of files being read/written and it looks like nocache has no effect on it.

Steps to reproduce:

nocache pv /dev/sda > /dev/null

Buffers/cache still grow.

noushi commented 4 years ago

@pavlinux There is no need to be disrespectful to @birdie-github . Please apologize and edit your comment.

Feh commented 4 years ago

Nocache works by intercepting library bindings for syscalls; if pv (which I’ve never used) is using a syscall that’s not intercepted by nocache, then it will have no effect.

I’d refer you to the README file for an alternative approach to limiting buffer cache size, specifically https://github.com/Feh/nocache/blob/master/README#L141-L158; the phrase “fairly recent Linux kernel” was written about 6 years ago, so this should not be a concern any more.

If you can provide specific ideas which syscall (wrappers) to intercept in addition to the ones already intercepted, please reopen the issue! (You can get these traces e.g. via strace.)

birdie-github commented 4 years ago

pv is a standard utility which is available in pretty much all Linux distros.

Its source code is published here: http://www.ivarch.com/programs/pv.shtml