Fix stack inline
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Aug 2010 17:58:00 +0000 (10:58 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 Aug 2010 15:38:48 +0000 (08:38 -0700)
Decrease stack usage for various call paths by forcing certain
functions to be inlined.  By inlining the functions the overhead
of a new stack frame is removed at the cost of increased code size.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/zfs/dbuf.c
module/zfs/spa.c
module/zfs/zio.c

index ccab0bc..add2bc3 100644 (file)
@@ -1607,7 +1607,8 @@ dbuf_clear(dmu_buf_impl_t *db)
                dbuf_rele(parent, db);
 }
 
                dbuf_rele(parent, db);
 }
 
-static int
+__attribute__((always_inline))
+static inline int
 dbuf_findbp(dnode_t *dn, int level, uint64_t blkid, int fail_sparse,
     dmu_buf_impl_t **parentp, blkptr_t **bpp, struct dbuf_hold_impl_data *dh)
 {
 dbuf_findbp(dnode_t *dn, int level, uint64_t blkid, int fail_sparse,
     dmu_buf_impl_t **parentp, blkptr_t **bpp, struct dbuf_hold_impl_data *dh)
 {
index d11f93d..606138a 100644 (file)
@@ -113,7 +113,7 @@ const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = {
 
 static dsl_syncfunc_t spa_sync_props;
 static boolean_t spa_has_active_shared_spare(spa_t *spa);
 
 static dsl_syncfunc_t spa_sync_props;
 static boolean_t spa_has_active_shared_spare(spa_t *spa);
-static int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
+static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
     spa_load_state_t state, spa_import_type_t type, boolean_t mosconfig,
     char **ereport);
 static void spa_vdev_resilver_done(spa_t *spa);
     spa_load_state_t state, spa_import_type_t type, boolean_t mosconfig,
     char **ereport);
 static void spa_vdev_resilver_done(spa_t *spa);
@@ -1790,7 +1790,8 @@ spa_load(spa_t *spa, spa_load_state_t state, spa_import_type_t type,
  * Load an existing storage pool, using the pool's builtin spa_config as a
  * source of configuration information.
  */
  * Load an existing storage pool, using the pool's builtin spa_config as a
  * source of configuration information.
  */
-static int
+__attribute__((always_inline))
+static inline int
 spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
     spa_load_state_t state, spa_import_type_t type, boolean_t mosconfig,
     char **ereport)
 spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
     spa_load_state_t state, spa_import_type_t type, boolean_t mosconfig,
     char **ereport)
index e434cf0..f0f0cff 100644 (file)
@@ -436,7 +436,8 @@ zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait)
        return (waiting);
 }
 
        return (waiting);
 }
 
-static void
+__attribute__((always_inline))
+static inline void
 zio_notify_parent(zio_t *pio, zio_t *zio, enum zio_wait_type wait)
 {
        uint64_t *countp = &pio->io_children[zio->io_child_type][wait];
 zio_notify_parent(zio_t *pio, zio_t *zio, enum zio_wait_type wait)
 {
        uint64_t *countp = &pio->io_children[zio->io_child_type][wait];