-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
3
-
9223372036854775807
Problem / Motivation
Today, the OSD read cache decides whether to cache read pages using two static, device-wide size thresholds checked on every I/O: readcache_max_io_mb (default 8 MiB on osd-ldiskfs) and readcache_max_filesize (default totalram / 64 on osd-ldiskfs, unlimited on osd-zfs). Because there is no memory of past client access, a large shared file read by hundreds of clients is excluded from the OST page cache/ARC once it exceeds readcache_max_filesize, while a small file read by a single client is cached on the OST even though that client already holds the data in its own page cache under a DLM PR lock.
Furthermore, osd-zfs currently lacks both the read_cache_enable master switch and the readcache_max_io_mb threshold present on osd-ldiskfs, and osd_bufs_get() does not forward enum dt_bufs_type flags to osd_bufs_get_read().
Solution Overview
Add an optional adaptive OST read-cache policy in ofd (obdfilter.*.readcache_adaptive_enable, default 0) that tracks recent distinct-client read fan-in per object using time-decaying Bloom filters and passes the caching verdict to the OSD via dt_bufs_type flags. When enabled, this classification replaces static size thresholds on the read path in both osd-ldiskfs and osd-zfs (while still honoring the read_cache_enable master switch), and brings osd-zfs to tunable parity by adding read_cache_enable and readcache_max_io_mb.