From ebdbbfb3b5ee13277e808f4f55672858557ef090 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 12 Oct 2015 14:27:27 +0000 Subject: [PATCH] 6281 prefetching should apply to 1MB reads Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Alexander Motin Reviewed by: Dan McDonald Reviewed by: Justin Gibbs Reviewed by: Xin Li Approved by: Gordon Ross Author: George Wilson illumos/illumos-gate@632802744ef6d17e06d6980a95f631615c3b060f --- uts/common/fs/zfs/dmu.c | 2 +- uts/common/fs/zfs/dmu_zfetch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/uts/common/fs/zfs/dmu.c b/uts/common/fs/zfs/dmu.c index 4b02f75d4f7a..6ebd95cd3ef2 100644 --- a/uts/common/fs/zfs/dmu.c +++ b/uts/common/fs/zfs/dmu.c @@ -442,7 +442,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length, } if ((flags & DMU_READ_NO_PREFETCH) == 0 && read && - length < zfetch_array_rd_sz) { + length <= zfetch_array_rd_sz) { dmu_zfetch(&dn->dn_zfetch, blkid, nblks); } rw_exit(&dn->dn_struct_rwlock); diff --git a/uts/common/fs/zfs/dmu_zfetch.c b/uts/common/fs/zfs/dmu_zfetch.c index b05e8f0cf2e4..f2cdf863d83c 100644 --- a/uts/common/fs/zfs/dmu_zfetch.c +++ b/uts/common/fs/zfs/dmu_zfetch.c @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -49,7 +49,7 @@ uint32_t zfetch_max_streams = 8; uint32_t zfetch_min_sec_reap = 2; /* max bytes to prefetch per stream (default 8MB) */ uint32_t zfetch_max_distance = 8 * 1024 * 1024; -/* number of bytes in a array_read at which we stop prefetching (1MB) */ +/* max number of bytes in an array_read in which we allow prefetching (1MB) */ uint64_t zfetch_array_rd_sz = 1024 * 1024; typedef struct zfetch_stats {