OpenZFS: Reducing ARC Lock Contention
blog.delphix.com
blog.delphix.com
If this is actually symptom of the patch, would it be possible to toggle lock behavior depending on available cores?
While it'd be fairly trivial to extend the code to make it easy for an admin to define the number of sublists, I don't have any reason to believe that'd be a useful knob to export.
It's got a maximum latency problem though.
If for some reason the unlucky thread that acquires the lock cannot process the batch faster than other threads are adding.... well that ends poorly
The bigger issue is how to lock the sublists. It seems heavy handed to lock all sublists, find the oldest buffer, evict it, and then unlock all sublists. But if each is locked, checked, then unlocked; each sublists' oldest buffer can change while the eviction thread is still iterating the sublists to find the oldest buffer.
So, while the current solution is not very elegant, it is simple, requires minimal locking, and appears to work well enough.