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>

@@ -18,11 +18,11 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
 #ifndef _SYS_DSL_POOL_H
 #define _SYS_DSL_POOL_H
 

@@ -47,10 +47,17 @@
 struct dsl_dataset;
 struct dsl_pool;
 struct dmu_tx;
 struct dsl_scan;
 
+extern uint64_t zfs_dirty_data_max;
+extern uint64_t zfs_dirty_data_max_max;
+extern uint64_t zfs_dirty_data_sync;
+extern int zfs_dirty_data_max_percent;
+extern int zfs_delay_min_dirty_percent;
+extern uint64_t zfs_delay_scale;
+
 /* These macros are for indexing into the zfs_all_blkstats_t. */
 #define DMU_OT_DEFERRED DMU_OT_NONE
 #define DMU_OT_OTHER    DMU_OT_NUMTYPES /* place holder for DMU_OT() types */
 #define DMU_OT_TOTAL    (DMU_OT_NUMTYPES + 1)
 

@@ -81,28 +88,32 @@
         uint64_t dp_root_dir_obj;
         struct taskq *dp_vnrele_taskq;
 
         /* No lock needed - sync context only */
         blkptr_t dp_meta_rootbp;
-        hrtime_t dp_read_overhead;
-        uint64_t dp_throughput; /* bytes per millisec */
-        uint64_t dp_write_limit;
         uint64_t dp_tmp_userrefs_obj;
         bpobj_t dp_free_bpobj;
         uint64_t dp_bptree_obj;
         uint64_t dp_empty_bpobj;
 
         struct dsl_scan *dp_scan;
 
         /* Uses dp_lock */
         kmutex_t dp_lock;
-        uint64_t dp_space_towrite[TXG_SIZE];
-        uint64_t dp_tempreserved[TXG_SIZE];
+        kcondvar_t dp_spaceavail_cv;
+        uint64_t dp_dirty_pertxg[TXG_SIZE];
+        uint64_t dp_dirty_total;
         uint64_t dp_mos_used_delta;
         uint64_t dp_mos_compressed_delta;
         uint64_t dp_mos_uncompressed_delta;
 
+        /*
+         * Time of most recently scheduled (furthest in the future)
+         * wakeup for delayed transactions.
+         */
+        hrtime_t dp_last_wakeup;
+
         /* Has its own locking */
         tx_state_t dp_tx;
         txg_list_t dp_dirty_datasets;
         txg_list_t dp_dirty_zilogs;
         txg_list_t dp_dirty_dirs;

@@ -127,14 +138,12 @@
 void dsl_pool_sync(dsl_pool_t *dp, uint64_t txg);
 void dsl_pool_sync_done(dsl_pool_t *dp, uint64_t txg);
 int dsl_pool_sync_context(dsl_pool_t *dp);
 uint64_t dsl_pool_adjustedsize(dsl_pool_t *dp, boolean_t netfree);
 uint64_t dsl_pool_adjustedfree(dsl_pool_t *dp, boolean_t netfree);
-int dsl_pool_tempreserve_space(dsl_pool_t *dp, uint64_t space, dmu_tx_t *tx);
-void dsl_pool_tempreserve_clear(dsl_pool_t *dp, int64_t space, dmu_tx_t *tx);
-void dsl_pool_memory_pressure(dsl_pool_t *dp);
-void dsl_pool_willuse_space(dsl_pool_t *dp, int64_t space, dmu_tx_t *tx);
+void dsl_pool_dirty_space(dsl_pool_t *dp, int64_t space, dmu_tx_t *tx);
+void dsl_pool_undirty_space(dsl_pool_t *dp, int64_t space, uint64_t txg);
 void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp);
 void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg,
     const blkptr_t *bpp);
 void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx);
 void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx);

@@ -142,10 +151,11 @@
 void dsl_pool_mos_diduse_space(dsl_pool_t *dp,
     int64_t used, int64_t comp, int64_t uncomp);
 void dsl_pool_config_enter(dsl_pool_t *dp, void *tag);
 void dsl_pool_config_exit(dsl_pool_t *dp, void *tag);
 boolean_t dsl_pool_config_held(dsl_pool_t *dp);
+boolean_t dsl_pool_need_dirty_delay(dsl_pool_t *dp);
 
 taskq_t *dsl_pool_vnrele_taskq(dsl_pool_t *dp);
 
 int dsl_pool_user_hold(dsl_pool_t *dp, uint64_t dsobj,
     const char *tag, uint64_t now, dmu_tx_t *tx);