diff options
author | Kevin Jin <[email protected]> | 2021-07-20 11:40:24 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-20 09:40:24 -0600 |
commit | a7bd20e309a4b45b18b1da8e379f5826debe4870 (patch) | |
tree | 269f2d997e22982e7399249bfeea88ee90c01d2e /module/zfs/zfs_log.c | |
parent | 8172df643b6cdc7fe233b18c8d8e9b29455ae9f1 (diff) |
Add Module Parameter Regarding Log Size Limit
* Add Module Parameters Regarding Log Size Limit
zfs_wrlog_data_max
The upper limit of TX_WRITE log data. Once it is reached,
write operation is blocked, until log data is cleared out
after txg sync. It only counts TX_WRITE log with WR_COPIED
or WR_NEED_COPY.
Reviewed-by: Prakash Surya <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: jxdking <[email protected]>
Closes #12284
Diffstat (limited to 'module/zfs/zfs_log.c')
-rw-r--r-- | module/zfs/zfs_log.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/module/zfs/zfs_log.c b/module/zfs/zfs_log.c index 30d5c4821..0f330ec93 100644 --- a/module/zfs/zfs_log.c +++ b/module/zfs/zfs_log.c @@ -541,6 +541,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, itx_wr_state_t write_state; uintptr_t fsync_cnt; uint64_t gen = 0; + ssize_t size = resid; if (zil_replaying(zilog, tx) || zp->z_unlinked || zfs_xattr_owner_unlinked(zp)) { @@ -626,6 +627,10 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, off += len; resid -= len; } + + if (write_state == WR_COPIED || write_state == WR_NEED_COPY) { + dsl_pool_wrlog_count(zilog->zl_dmu_pool, size, tx->tx_txg); + } } /* |