mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 19:28:53 +03:00
Use wmsum for arc, abd, dbuf and zfetch statistics. (#12172)
wmsum was designed exactly for cases like these with many updates and rare reads. It allows to completely avoid atomic operations on congested global variables. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Mark Maybee <mark.maybee@delphix.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored-By: iXsystems, Inc. Closes #12172
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#define _ABD_IMPL_H
|
||||
|
||||
#include <sys/abd.h>
|
||||
#include <sys/wmsum.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -82,9 +83,8 @@ void abd_iter_unmap(struct abd_iter *);
|
||||
/*
|
||||
* Helper macros
|
||||
*/
|
||||
#define ABDSTAT(stat) (abd_stats.stat.value.ui64)
|
||||
#define ABDSTAT_INCR(stat, val) \
|
||||
atomic_add_64(&abd_stats.stat.value.ui64, (val))
|
||||
wmsum_add(&abd_sums.stat, (val))
|
||||
#define ABDSTAT_BUMP(stat) ABDSTAT_INCR(stat, 1)
|
||||
#define ABDSTAT_BUMPDOWN(stat) ABDSTAT_INCR(stat, -1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user