On Thu, Nov 19, 2026, Mikulas Patocka wrote:
> Is the kernel dropping dm-bufio buffers too aggressively? Or is it not
> dropping them so that they consume too much memory?

Both, and the tension is why one global value cannot work. Our hash
areas run from 0.x MB to 40+ MB: the 256 KiB default makes large devices
re-read evicted hash blocks, while a uniformly large value makes every
cold, idle device hold memory forever -- and most verity devices are
cold most of the time, which is what small-memory systems complain about.

> Could it be fixed through other means that are more general? (for
> example, having a global dm-bufio shrinker and dropping buffers from
> the client that has the longest unused buffer)

A global LRU shrinker would tell hot from cold given time, but:

- Our userspace already knows which device will be used and when, so
  it does not need the heuristic, it can drop exactly that device's
  hash blocks, precisely and immediately.
- On low-memory devices we need the memory back quickly, not when
  pressure finally ages the buffers out.
- Verity, thin and cache clients share one pool with very different
  access patterns; a single LRU lets them fight for it, while
  per-client floors keep the shares apart.

Thanks for the review,
Yongpeng

Reply via email to