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>


 293                         VDCSTAT_BUMP(vdc_stat_delegations);
 294                         return (0);
 295                 }
 296 
 297                 vdev_cache_hit(vc, ve, zio);
 298                 zio_vdev_io_bypass(zio);
 299 
 300                 mutex_exit(&vc->vc_lock);
 301                 VDCSTAT_BUMP(vdc_stat_hits);
 302                 return (0);
 303         }
 304 
 305         ve = vdev_cache_allocate(zio);
 306 
 307         if (ve == NULL) {
 308                 mutex_exit(&vc->vc_lock);
 309                 return (SET_ERROR(ENOMEM));
 310         }
 311 
 312         fio = zio_vdev_delegated_io(zio->io_vd, cache_offset,
 313             ve->ve_data, VCBS, ZIO_TYPE_READ, ZIO_PRIORITY_CACHE_FILL,
 314             ZIO_FLAG_DONT_CACHE, vdev_cache_fill, ve);
 315 
 316         ve->ve_fill_io = fio;
 317         zio_vdev_io_bypass(zio);
 318         zio_add_child(zio, fio);
 319 
 320         mutex_exit(&vc->vc_lock);
 321         zio_nowait(fio);
 322         VDCSTAT_BUMP(vdc_stat_misses);
 323 
 324         return (0);
 325 }
 326 
 327 /*
 328  * Update cache contents upon write completion.
 329  */
 330 void
 331 vdev_cache_write(zio_t *zio)
 332 {
 333         vdev_cache_t *vc = &zio->io_vd->vdev_cache;




 293                         VDCSTAT_BUMP(vdc_stat_delegations);
 294                         return (0);
 295                 }
 296 
 297                 vdev_cache_hit(vc, ve, zio);
 298                 zio_vdev_io_bypass(zio);
 299 
 300                 mutex_exit(&vc->vc_lock);
 301                 VDCSTAT_BUMP(vdc_stat_hits);
 302                 return (0);
 303         }
 304 
 305         ve = vdev_cache_allocate(zio);
 306 
 307         if (ve == NULL) {
 308                 mutex_exit(&vc->vc_lock);
 309                 return (SET_ERROR(ENOMEM));
 310         }
 311 
 312         fio = zio_vdev_delegated_io(zio->io_vd, cache_offset,
 313             ve->ve_data, VCBS, ZIO_TYPE_READ, ZIO_PRIORITY_NOW,
 314             ZIO_FLAG_DONT_CACHE, vdev_cache_fill, ve);
 315 
 316         ve->ve_fill_io = fio;
 317         zio_vdev_io_bypass(zio);
 318         zio_add_child(zio, fio);
 319 
 320         mutex_exit(&vc->vc_lock);
 321         zio_nowait(fio);
 322         VDCSTAT_BUMP(vdc_stat_misses);
 323 
 324         return (0);
 325 }
 326 
 327 /*
 328  * Update cache contents upon write completion.
 329  */
 330 void
 331 vdev_cache_write(zio_t *zio)
 332 {
 333         vdev_cache_t *vc = &zio->io_vd->vdev_cache;