Re: clearing the disk cache

2018-07-04 Thread Maximilian Pichler
Thanks. :) But isn't "bufcachepercent < 5" there for a reason? Will my machine now catch fire? On Wed, Jul 4, 2018 at 10:23 AM, Boudewijn Dijkstra wrote: > Op Tue, 03 Jul 2018 16:06:37 +0200 schreef Maximilian Pichler > : >> >> Now I'm resorting to "sysctl kern.bufcachepercent=5; sysctl >>

Re: clearing the disk cache

2018-07-04 Thread Boudewijn Dijkstra
Op Tue, 03 Jul 2018 16:06:37 +0200 schreef Maximilian Pichler : Now I'm resorting to "sysctl kern.bufcachepercent=5; sysctl kern.bufcachepercent=90" to "almost" clear the cache. If only setting it to 0 were allowed... --- sys/kern/kern_sysctl.c.orig Mon Feb 19 09:59:52 2018 +++

Re: clearing the disk cache

2018-07-03 Thread Maximilian Pichler
Thanks for explaining! Looks like this is too complex to be reliably tricked by a few dd commands. Now I'm resorting to "sysctl kern.bufcachepercent=5; sysctl kern.bufcachepercent=90" to "almost" clear the cache. If only setting it to 0 were allowed... On Tue, Jul 3, 2018 at 3:06 PM, Claudio

Re: clearing the disk cache

2018-07-03 Thread Claudio Jeker
On Tue, Jul 03, 2018 at 01:30:20PM +0200, Maximilian Pichler wrote: > On Tue, Jul 3, 2018 at 11:47 AM, Janne Johansson wrote: > > https://www.tedunangst.com/flak/post/2Q-buffer-cache-algorithm > > Thanks. If I'm reading this correctly upon access (read or write), an > action is performed

Re: clearing the disk cache

2018-07-03 Thread Maximilian Pichler
On Tue, Jul 3, 2018 at 11:47 AM, Janne Johansson wrote: > https://www.tedunangst.com/flak/post/2Q-buffer-cache-algorithm Thanks. If I'm reading this correctly upon access (read or write), an action is performed depending on what queue a buffer is in: - none: Take a buffer from the tail of the

Re: clearing the disk cache

2018-07-03 Thread Janne Johansson
Den tis 3 juli 2018 kl 10:59 skrev Maximilian Pichler < maxim.pich...@gmail.com>: > > > The buffer cache is implemented as two 2-queue and therefor a simple cat > > bigfile will not fill the cache. > > What sort of data structure or algorithm is this? Any reference would > be much appreciated. >

Re: clearing the disk cache

2018-07-03 Thread Maximilian Pichler
On Tue, Jul 3, 2018 at 9:48 AM, Claudio Jeker wrote: > or reboot the system after every run. Would unmounting and remounting not be good enough? (At least for a FAT-formatted SD card this appears to work, though it could be caused by something else). In fact, at what level does caching happen?

Re: clearing the disk cache

2018-07-03 Thread Benjamin Baier
On Tue, 3 Jul 2018 09:42:46 +0200 Maximilian Pichler wrote: > I'm doing some performance tests that include reading files from disk > and want to make sure that each test takes place under similar > conditions. > > In particular, how can one clear the disk cache? (I want to make sure > that the

Re: clearing the disk cache

2018-07-03 Thread Claudio Jeker
On Tue, Jul 03, 2018 at 09:42:46AM +0200, Maximilian Pichler wrote: > I'm doing some performance tests that include reading files from disk > and want to make sure that each test takes place under similar > conditions. > > In particular, how can one clear the disk cache? (I want to make sure >

clearing the disk cache

2018-07-03 Thread Maximilian Pichler
I'm doing some performance tests that include reading files from disk and want to make sure that each test takes place under similar conditions. In particular, how can one clear the disk cache? (I want to make sure that the second test isn't faster than the first one, just because some files they