mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
ARC: Notify dbuf cache about target size reduction
ARC target size might drop significantly under memory pressure, especially if current ARC size was much smaller than the target. Since dbuf cache size is a fraction of the target ARC size, it might need eviction too. Aside of memory from the dbuf eviction itself, it might help ARC by making more buffers evictable. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Ameer Hamza <ahamza@ixsystems.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #17314
This commit is contained in:
@@ -872,6 +872,19 @@ dbuf_evict_notify(uint64_t size)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Since dbuf cache size is a fraction of target ARC size, ARC calls this when
|
||||
* its target size is reduced due to memory pressure.
|
||||
*/
|
||||
void
|
||||
dbuf_cache_reduce_target_size(void)
|
||||
{
|
||||
uint64_t size = zfs_refcount_count(&dbuf_caches[DB_DBUF_CACHE].size);
|
||||
|
||||
if (size > dbuf_cache_target_bytes())
|
||||
cv_signal(&dbuf_evict_cv);
|
||||
}
|
||||
|
||||
static int
|
||||
dbuf_kstat_update(kstat_t *ksp, int rw)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user