aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/arc.c2
-rw-r--r--module/zfs/dmu.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index b4f0c8a85..9be0a4e8a 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -308,6 +308,7 @@
#include <sys/aggsum.h>
#include <cityhash.h>
#include <sys/vdev_trim.h>
+#include <sys/zfs_racct.h>
#include <sys/zstd/zstd.h>
#ifndef _KERNEL
@@ -6302,6 +6303,7 @@ top:
ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr),
demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data,
metadata, misses);
+ zfs_racct_read(size, 1);
}
/* Check if the spa even has l2 configured */
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index ed345f0b6..b46bf60d1 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -52,6 +52,7 @@
#include <sys/zfeature.h>
#include <sys/abd.h>
#include <sys/trace_zfs.h>
+#include <sys/zfs_racct.h>
#include <sys/zfs_rlock.h>
#ifdef _KERNEL
#include <sys/vmsystm.h>
@@ -551,6 +552,9 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length,
dbp[i] = &db->db;
}
+ if (!read)
+ zfs_racct_write(length, nblks);
+
if ((flags & DMU_READ_NO_PREFETCH) == 0 &&
DNODE_META_IS_CACHEABLE(dn) && length <= zfetch_array_rd_sz) {
dmu_zfetch(&dn->dn_zfetch, blkid, nblks,
@@ -1440,6 +1444,7 @@ dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, arc_buf_t *buf,
* same size as the dbuf.
*/
if (offset == db->db.db_offset && blksz == db->db.db_size) {
+ zfs_racct_write(blksz, 1);
dbuf_assign_arcbuf(db, buf, tx);
dbuf_rele(db, FTAG);
} else {