From 85ec5cbae228defb4332da4cf0ebb64d53aea157 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Mon, 17 Aug 2020 20:04:04 -0700 Subject: Include scatter_chunk_waste in arc_size The ARC caches data in scatter ABD's, which are collections of pages, which are typically 4K. Therefore, the space used to cache each block is rounded up to a multiple of 4K. The ABD subsystem tracks this wasted memory in the `scatter_chunk_waste` kstat. However, the ARC's `size` is not aware of the memory used by this round-up, it only accounts for the size that it requested from the ABD subsystem. Therefore, the ARC is effectively using more memory than it is aware of, due to the `scatter_chunk_waste`. This impacts observability, e.g. `arcstat` will show that the ARC is using less memory than it effectively is. It also impacts how the ARC responds to memory pressure. As the amount of `scatter_chunk_waste` changes, it appears to the ARC as memory pressure, so it needs to resize `arc_c`. If the sector size (`1< Reviewed-by: Brian Behlendorf Reviewed-by: George Wilson Reviewed-by: Ryan Moeller Signed-off-by: Matthew Ahrens Closes #10701 --- include/sys/arc.h | 1 + include/sys/arc_impl.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/sys/arc.h b/include/sys/arc.h index f322d6328..3fdf36e2a 100644 --- a/include/sys/arc.h +++ b/include/sys/arc.h @@ -203,6 +203,7 @@ typedef enum arc_space_type { ARC_SPACE_DBUF, ARC_SPACE_DNODE, ARC_SPACE_BONUS, + ARC_SPACE_ABD_CHUNK_WASTE, ARC_SPACE_NUMTYPES } arc_space_type_t; diff --git a/include/sys/arc_impl.h b/include/sys/arc_impl.h index bb9163ba7..d07791d07 100644 --- a/include/sys/arc_impl.h +++ b/include/sys/arc_impl.h @@ -844,6 +844,7 @@ typedef struct arc_stats { kstat_named_t arcstat_sys_free; kstat_named_t arcstat_raw_size; kstat_named_t arcstat_cached_only_in_progress; + kstat_named_t arcstat_abd_chunk_waste_size; } arc_stats_t; typedef struct arc_evict_waiter { -- cgit v1.2.3