aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/support
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2007-02-10 02:34:56 -0500
committerTim Shimmin <tes@sgi.com>2007-02-10 02:34:56 -0500
commit7989cb8ef5dbc1411d3be48218c7b25ef6e71699 (patch)
tree607efa745911951a30712de44a837c1df952bd3a /fs/xfs/support
parent5e6a07dfe404cd4d8494d842b54706cb007fa04b (diff)
[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>
Diffstat (limited to 'fs/xfs/support')
-rw-r--r--fs/xfs/support/debug.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h
index 4f54dca662a8..2a70cc605ae3 100644
--- a/fs/xfs/support/debug.h
+++ b/fs/xfs/support/debug.h
@@ -38,13 +38,37 @@ extern void assfail(char *expr, char *f, int l);
38 38
39#ifndef DEBUG 39#ifndef DEBUG
40# define ASSERT(expr) ((void)0) 40# define ASSERT(expr) ((void)0)
41#else 41
42#ifndef STATIC
43# define STATIC static noinline
44#endif
45
46#ifndef STATIC_INLINE
47# define STATIC_INLINE static inline
48#endif
49
50#else /* DEBUG */
51
42# define ASSERT(expr) ASSERT_ALWAYS(expr) 52# define ASSERT(expr) ASSERT_ALWAYS(expr)
43extern unsigned long random(void); 53extern unsigned long random(void);
44#endif
45 54
46#ifndef STATIC 55#ifndef STATIC
47# define STATIC static 56# define STATIC noinline
48#endif 57#endif
49 58
59/*
60 * We stop inlining of inline functions in debug mode.
61 * Unfortunately, this means static inline in header files
62 * get multiple definitions, so they need to remain static.
63 * This then gives tonnes of warnings about unused but defined
64 * functions, so we need to add the unused attribute to prevent
65 * these spurious warnings.
66 */
67#ifndef STATIC_INLINE
68# define STATIC_INLINE static __attribute__ ((unused)) noinline
69#endif
70
71#endif /* DEBUG */
72
73
50#endif /* __XFS_SUPPORT_DEBUG_H__ */ 74#endif /* __XFS_SUPPORT_DEBUG_H__ */