Notably, CLOCK keeps items that are accessed atleast once during a round while LRU will kick out the least accessed item.
The benefit of using CLOCK is that you don't have to maintain a list but only a ringbuffer. Removing an item for a CLOCK's buffer can be almost free if you use a single bit to indicate presence. A LRU will have to maintain some form of list, array or linked. In practise, LRU is expensive to implement while CLOCK is simple. CAR offers LRU performance with less complexity.
https://en.wikipedia.org/wiki/Cache_replacement_policies#Clo...
https://dbs.uni-leipzig.de/file/ARC.pdf
[p.s. there is also the matter of the (patterns in the) various trace runs. Does anyone know where these traces can be obtained?]
Of course there are more schemes than just LRU and ARC, and one can try to employ lock-free schemes more than I'm willing to do. This is just my experience.
You can mitigate the exclusive lock using a write-ahead log approach [1] [2]. Then you record events into ring buffers, replay in batches, and have an exclusive tryLock. This works really well in practice and lets you do much more complex policy work without much less worry about concurrency.
[1] http://highscalability.com/blog/2016/1/25/design-of-a-modern...
[2] http://web.cse.ohio-state.edu/hpcs/WWW/HTML/publications/pap...
The whole thing is a mess.
I imagine there are quite a couple of variants of ARC you can use without violating the patent.
Hard Drives fail because of vibration, broken motors, and things like that. MTBF is the typical metric for hard drives. There are also errors that pop up if data sits still too long (on the order of years), because the magnetic field loses its charge over time.
TL;DR: there's a lot to it and I'll be going into it in future posts. The full extstore docs explain in a lot of detail too.
Edit: Missed this the first time through:
> Calculating this is done by monitoring an SSD's tolernace of "Drive Writes Per Day". If a 1TB device could survive 5 years with 2TB of writes per 24 hours it has a tolerance of 2 DWPD. Optane has a high tolerance at 30DWPD, while a high end flash drive is 3-6DWPD.