aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2018-02-05 19:57:53 -0500
committerBrian Behlendorf <[email protected]>2018-02-05 16:57:53 -0800
commit2b84817f66468da11d5c4373602a0044af46b572 (patch)
tree92a7a4b2eae1e34b18ebafd15f20b03b79fcc793
parent60b82074968e8503bedf35bf2d3e975a1867177e (diff)
Adjust ARC prefetch tunables to match docs
Currently, the ARC exposes 2 tunables (zfs_arc_min_prefetch_ms and zfs_arc_min_prescient_prefetch_ms) which are documented to be specified in milliseconds. However, the code actually uses the values as though they were in seconds. This patch adjusts the code to match the names and documentation of the tunables. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed by: George Melikov <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #7126
-rw-r--r--man/man5/zfs-module-parameters.54
-rw-r--r--module/zfs/arc.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5
index a5c83b422..77b162a2a 100644
--- a/man/man5/zfs-module-parameters.5
+++ b/man/man5/zfs-module-parameters.5
@@ -620,7 +620,7 @@ Default value: \fB0\fR.
.ad
.RS 12n
Minimum time prefetched blocks are locked in the ARC, specified in ms.
-A value of \fB0\fR will default to 1 second.
+A value of \fB0\fR will default to 1000 ms.
.sp
Default value: \fB0\fR.
.RE
@@ -633,7 +633,7 @@ Default value: \fB0\fR.
.RS 12n
Minimum time "prescient prefetched" blocks are locked in the ARC, specified
in ms. These blocks are meant to be prefetched fairly aggresively ahead of
-the code that may use them. A value of \fB0\fR will default to 6 seconds.
+the code that may use them. A value of \fB0\fR will default to 6000 ms.
.sp
Default value: \fB0\fR.
.RE
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 2f3fe9771..4fffc2380 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -3845,7 +3845,8 @@ arc_evict_hdr(arc_buf_hdr_t *hdr, kmutex_t *hash_lock)
/* prefetch buffers have a minimum lifespan */
if (HDR_IO_IN_PROGRESS(hdr) ||
((hdr->b_flags & (ARC_FLAG_PREFETCH | ARC_FLAG_INDIRECT)) &&
- ddi_get_lbolt() - hdr->b_l1hdr.b_arc_access < min_lifetime * hz)) {
+ ddi_get_lbolt() - hdr->b_l1hdr.b_arc_access <
+ MSEC_TO_TICK(min_lifetime))) {
ARCSTAT_BUMP(arcstat_evict_skip);
return (bytes_evicted);
}
@@ -7470,9 +7471,8 @@ arc_init(void)
cv_init(&arc_reclaim_thread_cv, NULL, CV_DEFAULT, NULL);
cv_init(&arc_reclaim_waiters_cv, NULL, CV_DEFAULT, NULL);
- /* Convert seconds to clock ticks */
- arc_min_prefetch_ms = 1;
- arc_min_prescient_prefetch_ms = 6;
+ arc_min_prefetch_ms = 1000;
+ arc_min_prescient_prefetch_ms = 6000;
#ifdef _KERNEL
/*