comparison usr/src/uts/common/fs/zfs/sys/spa_impl.h @ 13971:d1648d817bd6

3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Adam Leventhal <ahl@delphix.com>
date Mon, 25 Feb 2013 21:41:47 -0800
parents 512faafc0eaf
children 6a5a2f4a47db
comparison
equal deleted inserted replaced
13970:c9a5683da38e 13971:d1648d817bd6
78 typedef struct spa_config_dirent { 78 typedef struct spa_config_dirent {
79 list_node_t scd_link; 79 list_node_t scd_link;
80 char *scd_path; 80 char *scd_path;
81 } spa_config_dirent_t; 81 } spa_config_dirent_t;
82 82
83 enum zio_taskq_type { 83 typedef enum zio_taskq_type {
84 ZIO_TASKQ_ISSUE = 0, 84 ZIO_TASKQ_ISSUE = 0,
85 ZIO_TASKQ_ISSUE_HIGH, 85 ZIO_TASKQ_ISSUE_HIGH,
86 ZIO_TASKQ_INTERRUPT, 86 ZIO_TASKQ_INTERRUPT,
87 ZIO_TASKQ_INTERRUPT_HIGH, 87 ZIO_TASKQ_INTERRUPT_HIGH,
88 ZIO_TASKQ_TYPES 88 ZIO_TASKQ_TYPES
89 }; 89 } zio_taskq_type_t;
90 90
91 /* 91 /*
92 * State machine for the zpool-pooname process. The states transitions 92 * State machine for the zpool-poolname process. The states transitions
93 * are done as follows: 93 * are done as follows:
94 * 94 *
95 * From To Routine 95 * From To Routine
96 * PROC_NONE -> PROC_CREATED spa_activate() 96 * PROC_NONE -> PROC_CREATED spa_activate()
97 * PROC_CREATED -> PROC_ACTIVE spa_thread() 97 * PROC_CREATED -> PROC_ACTIVE spa_thread()
104 SPA_PROC_CREATED, /* spa_activate() has proc, is waiting */ 104 SPA_PROC_CREATED, /* spa_activate() has proc, is waiting */
105 SPA_PROC_ACTIVE, /* taskqs created, spa_proc set */ 105 SPA_PROC_ACTIVE, /* taskqs created, spa_proc set */
106 SPA_PROC_DEACTIVATE, /* spa_deactivate() requests process exit */ 106 SPA_PROC_DEACTIVATE, /* spa_deactivate() requests process exit */
107 SPA_PROC_GONE /* spa_thread() is exiting, spa_proc = &p0 */ 107 SPA_PROC_GONE /* spa_thread() is exiting, spa_proc = &p0 */
108 } spa_proc_state_t; 108 } spa_proc_state_t;
109
110 typedef struct spa_taskqs {
111 uint_t stqs_count;
112 taskq_t **stqs_taskq;
113 } spa_taskqs_t;
109 114
110 struct spa { 115 struct spa {
111 /* 116 /*
112 * Fields protected by spa_namespace_lock. 117 * Fields protected by spa_namespace_lock.
113 */ 118 */
123 pool_state_t spa_state; /* pool state */ 128 pool_state_t spa_state; /* pool state */
124 int spa_inject_ref; /* injection references */ 129 int spa_inject_ref; /* injection references */
125 uint8_t spa_sync_on; /* sync threads are running */ 130 uint8_t spa_sync_on; /* sync threads are running */
126 spa_load_state_t spa_load_state; /* current load operation */ 131 spa_load_state_t spa_load_state; /* current load operation */
127 uint64_t spa_import_flags; /* import specific flags */ 132 uint64_t spa_import_flags; /* import specific flags */
128 taskq_t *spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES]; 133 spa_taskqs_t spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
129 dsl_pool_t *spa_dsl_pool; 134 dsl_pool_t *spa_dsl_pool;
130 boolean_t spa_is_initializing; /* true while opening pool */ 135 boolean_t spa_is_initializing; /* true while opening pool */
131 metaslab_class_t *spa_normal_class; /* normal data class */ 136 metaslab_class_t *spa_normal_class; /* normal data class */
132 metaslab_class_t *spa_log_class; /* intent log data class */ 137 metaslab_class_t *spa_log_class; /* intent log data class */
133 uint64_t spa_first_txg; /* first txg after spa_open() */ 138 uint64_t spa_first_txg; /* first txg after spa_open() */
243 refcount_t spa_refcount; /* number of opens */ 248 refcount_t spa_refcount; /* number of opens */
244 }; 249 };
245 250
246 extern const char *spa_config_path; 251 extern const char *spa_config_path;
247 252
253 extern void spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
254 task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent);
255
248 #ifdef __cplusplus 256 #ifdef __cplusplus
249 } 257 }
250 #endif 258 #endif
251 259
252 #endif /* _SYS_SPA_IMPL_H */ 260 #endif /* _SYS_SPA_IMPL_H */