Use reduced precision for scan times

Scan time limits do not need precision beyond 1ms.  Switching
scn_sync_start_time and spa_sync_starttime from gethrtime() to
getlrtime() saves ~3% of CPU time during resilver scan stage.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #18061
This commit is contained in:
Alexander Motin
2025-12-18 13:22:11 -05:00
committed by Tony Hutter
parent 35ee242abc
commit 09587c7385
3 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -720,7 +720,7 @@ spa_deadman(void *arg)
return;
zfs_dbgmsg("slow spa_sync: started %llu seconds ago, calls %llu",
(gethrtime() - spa->spa_sync_starttime) / NANOSEC,
(getlrtime() - spa->spa_sync_starttime) / NANOSEC,
(u_longlong_t)++spa->spa_deadman_calls);
if (zfs_deadman_enabled)
vdev_deadman(spa->spa_root_vdev, FTAG);