[XFS] Keep stack usage down for 4k stacks by using noinline.

gcc-4.1 and more recent aggressively inline static functions which
increases XFS stack usage by ~15% in critical paths. Prevent this from
occurring by adding noinline to the STATIC definition.

Also uninline some functions that are too large to be inlined and were
causing problems with CONFIG_FORCED_INLINING=y.

Finally, clean up all the different users of inline, __inline and
__inline__ and put them under one STATIC_INLINE macro. For debug kernels
the STATIC_INLINE macro uninlines those functions.

SGI-PV: 957159
SGI-Modid: xfs-linux-melb:xfs-kern:27585a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: David Chatterton <chatz@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
This commit is contained in:
David Chinner
2007-02-10 18:34:56 +11:00
committed by Tim Shimmin
parent 5e6a07dfe4
commit 7989cb8ef5
23 changed files with 89 additions and 65 deletions

View File

@@ -38,13 +38,37 @@ extern void assfail(char *expr, char *f, int l);
#ifndef DEBUG
# define ASSERT(expr) ((void)0)
#else
# define ASSERT(expr) ASSERT_ALWAYS(expr)
extern unsigned long random(void);
#endif
#ifndef STATIC
# define STATIC static
# define STATIC static noinline
#endif
#ifndef STATIC_INLINE
# define STATIC_INLINE static inline
#endif
#else /* DEBUG */
# define ASSERT(expr) ASSERT_ALWAYS(expr)
extern unsigned long random(void);
#ifndef STATIC
# define STATIC noinline
#endif
/*
* We stop inlining of inline functions in debug mode.
* Unfortunately, this means static inline in header files
* get multiple definitions, so they need to remain static.
* This then gives tonnes of warnings about unused but defined
* functions, so we need to add the unused attribute to prevent
* these spurious warnings.
*/
#ifndef STATIC_INLINE
# define STATIC_INLINE static __attribute__ ((unused)) noinline
#endif
#endif /* DEBUG */
#endif /* __XFS_SUPPORT_DEBUG_H__ */