From ca5262f03091d6359ebdd4b985d169c208053a70 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 30 Jul 2010 13:34:50 -0700 Subject: [PATCH] Reduce stack by inlining spa_impl_load The spa_load function may call itself recursively through the spa_load_impl function. This call path of spa_load-> spa_load_impl->spa_load->spa_load_impl takes 640 bytes of stack. By forcing spa_load_impl to be inlined as part of spa_load the can be reduced to 448 bytes, for a savings of 192 bytes, --- module/zfs/spa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index d7c5de0d35..9a8503e303 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -1652,7 +1652,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. */ -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)