Print this page
4045 zfs write throttle & i/o scheduler performance work
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dmu_zfetch.c
          +++ new/usr/src/uts/common/fs/zfs/dmu_zfetch.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright (c) 2013 by Delphix. All rights reserved.
       28 + */
       29 +
  26   30  #include <sys/zfs_context.h>
  27   31  #include <sys/dnode.h>
  28   32  #include <sys/dmu_objset.h>
  29   33  #include <sys/dmu_zfetch.h>
  30   34  #include <sys/dmu.h>
  31   35  #include <sys/dbuf.h>
  32   36  #include <sys/kstat.h>
  33   37  
  34   38  /*
  35   39   * I'm against tune-ables, but these should probably exist as tweakable globals
↓ open down ↓ 244 lines elided ↑ open up ↑
 280  284   */
 281  285  static uint64_t
 282  286  dmu_zfetch_fetch(dnode_t *dn, uint64_t blkid, uint64_t nblks)
 283  287  {
 284  288          uint64_t        fetchsz;
 285  289          uint64_t        i;
 286  290  
 287  291          fetchsz = dmu_zfetch_fetchsz(dn, blkid, nblks);
 288  292  
 289  293          for (i = 0; i < fetchsz; i++) {
 290      -                dbuf_prefetch(dn, blkid + i);
      294 +                dbuf_prefetch(dn, blkid + i, ZIO_PRIORITY_ASYNC_READ);
 291  295          }
 292  296  
 293  297          return (fetchsz);
 294  298  }
 295  299  
 296  300  /*
 297  301   * this function returns the number of blocks that would be prefetched, based
 298  302   * upon the supplied dnode, blockid, and nblks.  This is used so that we can
 299  303   * update streams in place, and then prefetch with their old value after the
 300  304   * fact.  This way, we can delay the prefetch, but subsequent accesses to the
↓ open down ↓ 425 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX