int zio_buf_debug_limit = 0;
#endif
+static inline void __zio_execute(zio_t *zio);
+
void
zio_init(void)
{
if (--*countp == 0 && pio->io_stall == countp) {
pio->io_stall = NULL;
mutex_exit(&pio->io_lock);
- zio_execute(pio);
+ __zio_execute(pio);
} else {
mutex_exit(&pio->io_lock);
}
*/
static zio_pipe_stage_t *zio_pipeline[];
+/*
+ * zio_execute() is a wrapper around the static function
+ * __zio_execute() so that we can force __zio_execute() to be
+ * inlined. This reduces stack overhead which is important
+ * because __zio_execute() is called recursively in several zio
+ * code paths. zio_execute() itself cannot be inlined because
+ * it is externally visible.
+ */
void
zio_execute(zio_t *zio)
+{
+ __zio_execute(zio);
+}
+
+__attribute__((always_inline))
+static inline void
+__zio_execute(zio_t *zio)
{
zio->io_executor = curthread;
}
}
+
/*
* ==========================================================================
* Initiate I/O, either sync or async
zio->io_waiter = curthread;
- zio_execute(zio);
+ __zio_execute(zio);
mutex_enter(&zio->io_lock);
while (zio->io_executor != NULL)
zio_add_child(spa->spa_async_zio_root, zio);
}
- zio_execute(zio);
+ __zio_execute(zio);
}
/*
* responsibility of the caller to wait on him.
*/
if (!(pio->io_flags & ZIO_FLAG_GODFATHER))
- zio_execute(pio);
+ __zio_execute(pio);
}
void