Print this page
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>
5987 zfs prefetch code needs work
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Gordon Ross <gordon.ross@nexenta.com>
NEX-4582 update wrc test cases for allow to use write back cache per tree of datasets
Reviewed by: Steve Peng <steve.peng@nexenta.com>
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
5960 zfs recv should prefetch indirect blocks
5925 zfs receive -o origin=
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

@@ -209,63 +209,38 @@
         zstream_t *zs;
         int64_t pf_start, ipf_start, ipf_istart, ipf_iend;
         int64_t pf_ahead_blks, max_blks;
         int epbs, max_dist_blks, pf_nblks, ipf_nblks;
         uint64_t end_of_access_blkid = blkid + nblks;
-        spa_t *spa = zf->zf_dnode->dn_objset->os_spa;
 
         if (zfs_prefetch_disable)
                 return;
 
         /*
-         * If we haven't yet loaded the indirect vdevs' mappings, we
-         * can only read from blocks that we carefully ensure are on
-         * concrete vdevs (or previously-loaded indirect vdevs).  So we
-         * can't allow the predictive prefetcher to attempt reads of other
-         * blocks (e.g. of the MOS's dnode obejct).
-         */
-        if (!spa_indirect_vdevs_loaded(spa))
-                return;
-
-        /*
          * As a fast path for small (single-block) files, ignore access
          * to the first block.
          */
         if (blkid == 0)
                 return;
 
         rw_enter(&zf->zf_rwlock, RW_READER);
 
-        /*
-         * Find matching prefetch stream.  Depending on whether the accesses
-         * are block-aligned, first block of the new access may either follow
-         * the last block of the previous access, or be equal to it.
-         */
         for (zs = list_head(&zf->zf_stream); zs != NULL;
             zs = list_next(&zf->zf_stream, zs)) {
-                if (blkid == zs->zs_blkid || blkid + 1 == zs->zs_blkid) {
+                if (blkid == zs->zs_blkid) {
                         mutex_enter(&zs->zs_lock);
                         /*
                          * zs_blkid could have changed before we
                          * acquired zs_lock; re-check them here.
                          */
-                        if (blkid == zs->zs_blkid) {
-                                break;
-                        } else if (blkid + 1 == zs->zs_blkid) {
-                                blkid++;
-                                nblks--;
-                                if (nblks == 0) {
-                                        /* Already prefetched this before. */
+                        if (blkid != zs->zs_blkid) {
                                         mutex_exit(&zs->zs_lock);
-                                        rw_exit(&zf->zf_rwlock);
-                                        return;
+                                continue;
                                 }
                                 break;
                         }
-                        mutex_exit(&zs->zs_lock);
                 }
-        }
 
         if (zs == NULL) {
                 /*
                  * This access is not part of any existing stream.  Create
                  * a new stream for it.