Files
mirror_zfs/include/sys
Matthew Ahrens 85ec5cbae2 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<<ashift`) is the same as the page size (or
larger), there won't be any waste.  If the (compressed) block size is
relatively large compared to the page size, the amount of
`scatter_chunk_waste` will be small, so the problematic effects are
minimal.

However, if using 512B sectors (`ashift=9`), and the (compressed) block
size is small (e.g. `compression=on` with the default `volblocksize=8k`
or a decreased `recordsize`), the amount of `scatter_chunk_waste` can be
very large.  On a production system, with `arc_size` at a constant 50%
of memory, `scatter_chunk_waste` has been been observed to be 10-30% of
memory.

This commit adds `scatter_chunk_waste` to `arc_size`, and adds a new
`waste` field to `arcstat`.  As a result, the ARC's memory usage is more
observable, and `arc_c` does not need to be adjusted as frequently.

Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #10701
2020-08-17 20:04:04 -07:00
..
2020-07-29 16:35:33 -07:00
2020-08-17 20:04:04 -07:00
2019-10-09 10:36:03 -07:00
2019-07-26 10:54:14 -07:00
2019-07-26 10:54:14 -07:00
2019-06-19 09:48:12 -07:00
2020-06-09 21:24:09 -07:00
2020-07-29 16:35:33 -07:00
2020-06-13 11:02:00 -07:00
2019-06-19 09:48:12 -07:00
2020-01-10 10:16:58 -08:00
2019-06-19 09:48:12 -07:00
2020-07-29 16:35:33 -07:00
2019-07-25 11:57:58 -07:00
2020-07-29 16:35:33 -07:00
2019-06-24 16:44:01 -07:00
2019-07-26 10:54:14 -07:00
2020-07-29 16:35:33 -07:00
2020-07-03 11:05:50 -07:00
2013-11-04 11:17:48 -08:00
2019-08-30 09:53:15 -07:00
2017-12-07 10:28:50 -08:00
2017-10-11 16:54:48 -04:00
2019-11-01 10:41:03 -07:00
2018-05-29 16:00:33 -07:00
2018-10-03 15:30:55 -07:00
2019-06-19 09:48:12 -07:00
2019-09-12 13:33:44 -07:00
2020-07-29 16:35:33 -07:00
2020-07-29 16:35:33 -07:00
2019-08-30 09:53:15 -07:00
2020-07-29 16:35:33 -07:00
2019-07-16 10:11:49 -07:00
2019-08-30 09:53:15 -07:00
2017-07-13 13:54:00 -04:00
2013-11-04 10:55:25 -08:00
2020-07-03 11:05:50 -07:00
2019-03-29 09:13:20 -07:00
2020-06-18 12:21:32 -07:00
2020-07-03 11:05:50 -07:00
2020-06-09 10:15:08 -07:00
2020-07-03 11:05:50 -07:00
2019-06-12 13:13:09 -07:00
2018-02-08 15:28:18 -08:00
2018-02-08 15:28:18 -08:00
2020-08-17 16:04:28 -07:00
2019-10-25 13:38:37 -07:00
2018-05-29 16:00:33 -07:00
2018-02-13 14:54:54 -08:00
2018-09-06 21:44:52 -07:00
2020-06-09 21:24:09 -07:00
2019-06-10 11:48:42 -07:00
2020-06-18 12:21:32 -07:00
2017-03-29 12:24:51 -07:00
2019-08-30 09:53:15 -07:00
2020-07-03 11:05:50 -07:00
2020-06-06 12:54:04 -07:00
2020-07-29 09:43:33 -07:00
2020-06-05 17:17:02 -07:00