mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zstd: track allocator statistics
Note that this only tracks sizes as requested by the caller. Actual allocated space will almost always be bigger (e.g., rounded up to the next power of 2 or page size). Additionally the allocated buffer may be holding other areas hostage. Nonetheless, this is a starting point for tracking memory usage in zstd. Reviewed-by: Allan Jude <allan@klarasystems.com> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Closes #11129
This commit is contained in:
committed by
Brian Behlendorf
parent
c6b0680d9b
commit
52f1ef3b2d
@@ -75,9 +75,11 @@ typedef struct zfs_zstd_header {
|
||||
* kstat helper macros
|
||||
*/
|
||||
#define ZSTDSTAT(stat) (zstd_stats.stat.value.ui64)
|
||||
#define ZSTDSTAT_INCR(stat, val) \
|
||||
#define ZSTDSTAT_ADD(stat, val) \
|
||||
atomic_add_64(&zstd_stats.stat.value.ui64, (val))
|
||||
#define ZSTDSTAT_BUMP(stat) ZSTDSTAT_INCR(stat, 1)
|
||||
#define ZSTDSTAT_SUB(stat, val) \
|
||||
atomic_sub_64(&zstd_stats.stat.value.ui64, (val))
|
||||
#define ZSTDSTAT_BUMP(stat) ZSTDSTAT_ADD(stat, 1)
|
||||
|
||||
/* (de)init for user space / kernel emulation */
|
||||
int zstd_init(void);
|
||||
|
||||
Reference in New Issue
Block a user