Skip to content

Commit 6328027

Browse files
grwilsonahrens
authored andcommitted
6281 prefetching should apply to 1MB reads
Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Alexander Motin <mav@freebsd.org> Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Justin Gibbs <gibbs@scsiguy.com> Reviewed by: Xin Li <delphij@freebsd.org> Approved by: Gordon Ross <gordon.ross@nexenta.com>
1 parent 7205e71 commit 6328027

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

usr/src/uts/common/fs/zfs/dmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length,
442442
}
443443

444444
if ((flags & DMU_READ_NO_PREFETCH) == 0 && read &&
445-
length < zfetch_array_rd_sz) {
445+
length <= zfetch_array_rd_sz) {
446446
dmu_zfetch(&dn->dn_zfetch, blkid, nblks);
447447
}
448448
rw_exit(&dn->dn_struct_rwlock);

usr/src/uts/common/fs/zfs/dmu_zfetch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
/*
27-
* Copyright (c) 2013, 2014 by Delphix. All rights reserved.
27+
* Copyright (c) 2013, 2015 by Delphix. All rights reserved.
2828
*/
2929

3030
#include <sys/zfs_context.h>
@@ -49,7 +49,7 @@ uint32_t zfetch_max_streams = 8;
4949
uint32_t zfetch_min_sec_reap = 2;
5050
/* max bytes to prefetch per stream (default 8MB) */
5151
uint32_t zfetch_max_distance = 8 * 1024 * 1024;
52-
/* number of bytes in a array_read at which we stop prefetching (1MB) */
52+
/* max number of bytes in an array_read in which we allow prefetching (1MB) */
5353
uint64_t zfetch_array_rd_sz = 1024 * 1024;
5454

5555
typedef struct zfetch_stats {

0 commit comments

Comments
 (0)