diff options
author | David Chinner <dgc@sgi.com> | 2007-02-10 02:34:56 -0500 |
---|---|---|
committer | Tim Shimmin <tes@sgi.com> | 2007-02-10 02:34:56 -0500 |
commit | 7989cb8ef5dbc1411d3be48218c7b25ef6e71699 (patch) | |
tree | 607efa745911951a30712de44a837c1df952bd3a /fs/xfs/linux-2.6 | |
parent | 5e6a07dfe404cd4d8494d842b54706cb007fa04b (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/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 24 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_export.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 16 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sysctl.c | 6 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 4 |
9 files changed, 32 insertions, 32 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 7b54461695e2..9761a5befef0 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -249,7 +249,7 @@ xfs_map_blocks( | |||
249 | return -error; | 249 | return -error; |
250 | } | 250 | } |
251 | 251 | ||
252 | STATIC inline int | 252 | STATIC_INLINE int |
253 | xfs_iomap_valid( | 253 | xfs_iomap_valid( |
254 | xfs_iomap_t *iomapp, | 254 | xfs_iomap_t *iomapp, |
255 | loff_t offset) | 255 | loff_t offset) |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 168eecd8127e..e2bea6a661f0 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -34,13 +34,13 @@ | |||
34 | #include <linux/backing-dev.h> | 34 | #include <linux/backing-dev.h> |
35 | #include <linux/freezer.h> | 35 | #include <linux/freezer.h> |
36 | 36 | ||
37 | STATIC kmem_zone_t *xfs_buf_zone; | 37 | static kmem_zone_t *xfs_buf_zone; |
38 | STATIC kmem_shaker_t xfs_buf_shake; | 38 | static kmem_shaker_t xfs_buf_shake; |
39 | STATIC int xfsbufd(void *); | 39 | STATIC int xfsbufd(void *); |
40 | STATIC int xfsbufd_wakeup(int, gfp_t); | 40 | STATIC int xfsbufd_wakeup(int, gfp_t); |
41 | STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int); | 41 | STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int); |
42 | 42 | ||
43 | STATIC struct workqueue_struct *xfslogd_workqueue; | 43 | static struct workqueue_struct *xfslogd_workqueue; |
44 | struct workqueue_struct *xfsdatad_workqueue; | 44 | struct workqueue_struct *xfsdatad_workqueue; |
45 | 45 | ||
46 | #ifdef XFS_BUF_TRACE | 46 | #ifdef XFS_BUF_TRACE |
@@ -139,7 +139,7 @@ page_region_mask( | |||
139 | return mask; | 139 | return mask; |
140 | } | 140 | } |
141 | 141 | ||
142 | STATIC inline void | 142 | STATIC_INLINE void |
143 | set_page_region( | 143 | set_page_region( |
144 | struct page *page, | 144 | struct page *page, |
145 | size_t offset, | 145 | size_t offset, |
@@ -151,7 +151,7 @@ set_page_region( | |||
151 | SetPageUptodate(page); | 151 | SetPageUptodate(page); |
152 | } | 152 | } |
153 | 153 | ||
154 | STATIC inline int | 154 | STATIC_INLINE int |
155 | test_page_region( | 155 | test_page_region( |
156 | struct page *page, | 156 | struct page *page, |
157 | size_t offset, | 157 | size_t offset, |
@@ -171,9 +171,9 @@ typedef struct a_list { | |||
171 | struct a_list *next; | 171 | struct a_list *next; |
172 | } a_list_t; | 172 | } a_list_t; |
173 | 173 | ||
174 | STATIC a_list_t *as_free_head; | 174 | static a_list_t *as_free_head; |
175 | STATIC int as_list_len; | 175 | static int as_list_len; |
176 | STATIC DEFINE_SPINLOCK(as_lock); | 176 | static DEFINE_SPINLOCK(as_lock); |
177 | 177 | ||
178 | /* | 178 | /* |
179 | * Try to batch vunmaps because they are costly. | 179 | * Try to batch vunmaps because they are costly. |
@@ -1085,7 +1085,7 @@ xfs_buf_iostart( | |||
1085 | return status; | 1085 | return status; |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | STATIC __inline__ int | 1088 | STATIC_INLINE int |
1089 | _xfs_buf_iolocked( | 1089 | _xfs_buf_iolocked( |
1090 | xfs_buf_t *bp) | 1090 | xfs_buf_t *bp) |
1091 | { | 1091 | { |
@@ -1095,7 +1095,7 @@ _xfs_buf_iolocked( | |||
1095 | return 0; | 1095 | return 0; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | STATIC __inline__ void | 1098 | STATIC_INLINE void |
1099 | _xfs_buf_ioend( | 1099 | _xfs_buf_ioend( |
1100 | xfs_buf_t *bp, | 1100 | xfs_buf_t *bp, |
1101 | int schedule) | 1101 | int schedule) |
@@ -1426,8 +1426,8 @@ xfs_free_bufhash( | |||
1426 | /* | 1426 | /* |
1427 | * buftarg list for delwrite queue processing | 1427 | * buftarg list for delwrite queue processing |
1428 | */ | 1428 | */ |
1429 | STATIC LIST_HEAD(xfs_buftarg_list); | 1429 | LIST_HEAD(xfs_buftarg_list); |
1430 | STATIC DEFINE_SPINLOCK(xfs_buftarg_lock); | 1430 | static DEFINE_SPINLOCK(xfs_buftarg_lock); |
1431 | 1431 | ||
1432 | STATIC void | 1432 | STATIC void |
1433 | xfs_register_buftarg( | 1433 | xfs_register_buftarg( |
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 5fb75d9151f2..e3a5fedac1ba 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "xfs_mount.h" | 24 | #include "xfs_mount.h" |
25 | #include "xfs_export.h" | 25 | #include "xfs_export.h" |
26 | 26 | ||
27 | STATIC struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, }; | 27 | static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, }; |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * XFS encodes and decodes the fileid portion of NFS filehandles | 30 | * XFS encodes and decodes the fileid portion of NFS filehandles |
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index d26f5cd2ba70..cb51dc961355 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -46,7 +46,7 @@ static struct vm_operations_struct xfs_file_vm_ops; | |||
46 | static struct vm_operations_struct xfs_dmapi_file_vm_ops; | 46 | static struct vm_operations_struct xfs_dmapi_file_vm_ops; |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | STATIC inline ssize_t | 49 | STATIC_INLINE ssize_t |
50 | __xfs_file_read( | 50 | __xfs_file_read( |
51 | struct kiocb *iocb, | 51 | struct kiocb *iocb, |
52 | const struct iovec *iov, | 52 | const struct iovec *iov, |
@@ -84,7 +84,7 @@ xfs_file_aio_read_invis( | |||
84 | return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos); | 84 | return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos); |
85 | } | 85 | } |
86 | 86 | ||
87 | STATIC inline ssize_t | 87 | STATIC_INLINE ssize_t |
88 | __xfs_file_write( | 88 | __xfs_file_write( |
89 | struct kiocb *iocb, | 89 | struct kiocb *iocb, |
90 | const struct iovec *iov, | 90 | const struct iovec *iov, |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 3ba814ae3bba..4dd6cb56c2d5 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -250,13 +250,13 @@ xfs_init_security( | |||
250 | * | 250 | * |
251 | * XXX(hch): nfsd is broken, better fix it instead. | 251 | * XXX(hch): nfsd is broken, better fix it instead. |
252 | */ | 252 | */ |
253 | STATIC inline int | 253 | STATIC_INLINE int |
254 | xfs_has_fs_struct(struct task_struct *task) | 254 | xfs_has_fs_struct(struct task_struct *task) |
255 | { | 255 | { |
256 | return (task->fs != init_task.fs); | 256 | return (task->fs != init_task.fs); |
257 | } | 257 | } |
258 | 258 | ||
259 | STATIC inline void | 259 | STATIC void |
260 | xfs_cleanup_inode( | 260 | xfs_cleanup_inode( |
261 | bhv_vnode_t *dvp, | 261 | bhv_vnode_t *dvp, |
262 | bhv_vnode_t *vp, | 262 | bhv_vnode_t *vp, |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index b93265b7c79c..dab5d3802374 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -58,10 +58,10 @@ | |||
58 | #include <linux/kthread.h> | 58 | #include <linux/kthread.h> |
59 | #include <linux/freezer.h> | 59 | #include <linux/freezer.h> |
60 | 60 | ||
61 | STATIC struct quotactl_ops xfs_quotactl_operations; | 61 | static struct quotactl_ops xfs_quotactl_operations; |
62 | STATIC struct super_operations xfs_super_operations; | 62 | static struct super_operations xfs_super_operations; |
63 | STATIC kmem_zone_t *xfs_vnode_zone; | 63 | static kmem_zone_t *xfs_vnode_zone; |
64 | STATIC kmem_zone_t *xfs_ioend_zone; | 64 | static kmem_zone_t *xfs_ioend_zone; |
65 | mempool_t *xfs_ioend_pool; | 65 | mempool_t *xfs_ioend_pool; |
66 | 66 | ||
67 | STATIC struct xfs_mount_args * | 67 | STATIC struct xfs_mount_args * |
@@ -121,7 +121,7 @@ xfs_max_file_offset( | |||
121 | return (((__uint64_t)pagefactor) << bitshift) - 1; | 121 | return (((__uint64_t)pagefactor) << bitshift) - 1; |
122 | } | 122 | } |
123 | 123 | ||
124 | STATIC __inline__ void | 124 | STATIC_INLINE void |
125 | xfs_set_inodeops( | 125 | xfs_set_inodeops( |
126 | struct inode *inode) | 126 | struct inode *inode) |
127 | { | 127 | { |
@@ -147,7 +147,7 @@ xfs_set_inodeops( | |||
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | STATIC __inline__ void | 150 | STATIC_INLINE void |
151 | xfs_revalidate_inode( | 151 | xfs_revalidate_inode( |
152 | xfs_mount_t *mp, | 152 | xfs_mount_t *mp, |
153 | bhv_vnode_t *vp, | 153 | bhv_vnode_t *vp, |
@@ -873,7 +873,7 @@ xfs_fs_get_sb( | |||
873 | mnt); | 873 | mnt); |
874 | } | 874 | } |
875 | 875 | ||
876 | STATIC struct super_operations xfs_super_operations = { | 876 | static struct super_operations xfs_super_operations = { |
877 | .alloc_inode = xfs_fs_alloc_inode, | 877 | .alloc_inode = xfs_fs_alloc_inode, |
878 | .destroy_inode = xfs_fs_destroy_inode, | 878 | .destroy_inode = xfs_fs_destroy_inode, |
879 | .write_inode = xfs_fs_write_inode, | 879 | .write_inode = xfs_fs_write_inode, |
@@ -887,7 +887,7 @@ STATIC struct super_operations xfs_super_operations = { | |||
887 | .show_options = xfs_fs_show_options, | 887 | .show_options = xfs_fs_show_options, |
888 | }; | 888 | }; |
889 | 889 | ||
890 | STATIC struct quotactl_ops xfs_quotactl_operations = { | 890 | static struct quotactl_ops xfs_quotactl_operations = { |
891 | .quota_sync = xfs_fs_quotasync, | 891 | .quota_sync = xfs_fs_quotasync, |
892 | .get_xstate = xfs_fs_getxstate, | 892 | .get_xstate = xfs_fs_getxstate, |
893 | .set_xstate = xfs_fs_setxstate, | 893 | .set_xstate = xfs_fs_setxstate, |
diff --git a/fs/xfs/linux-2.6/xfs_sysctl.c b/fs/xfs/linux-2.6/xfs_sysctl.c index af246532fbfb..b1036dd5012d 100644 --- a/fs/xfs/linux-2.6/xfs_sysctl.c +++ b/fs/xfs/linux-2.6/xfs_sysctl.c | |||
@@ -54,7 +54,7 @@ xfs_stats_clear_proc_handler( | |||
54 | } | 54 | } |
55 | #endif /* CONFIG_PROC_FS */ | 55 | #endif /* CONFIG_PROC_FS */ |
56 | 56 | ||
57 | STATIC ctl_table xfs_table[] = { | 57 | static ctl_table xfs_table[] = { |
58 | {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val, | 58 | {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val, |
59 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | 59 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, |
60 | &sysctl_intvec, NULL, | 60 | &sysctl_intvec, NULL, |
@@ -136,12 +136,12 @@ STATIC ctl_table xfs_table[] = { | |||
136 | {0} | 136 | {0} |
137 | }; | 137 | }; |
138 | 138 | ||
139 | STATIC ctl_table xfs_dir_table[] = { | 139 | static ctl_table xfs_dir_table[] = { |
140 | {FS_XFS, "xfs", NULL, 0, 0555, xfs_table}, | 140 | {FS_XFS, "xfs", NULL, 0, 0555, xfs_table}, |
141 | {0} | 141 | {0} |
142 | }; | 142 | }; |
143 | 143 | ||
144 | STATIC ctl_table xfs_root_table[] = { | 144 | static ctl_table xfs_root_table[] = { |
145 | {CTL_FS, "fs", NULL, 0, 0555, xfs_dir_table}, | 145 | {CTL_FS, "fs", NULL, 0, 0555, xfs_dir_table}, |
146 | {0} | 146 | {0} |
147 | }; | 147 | }; |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index 553fa731ade5..ada24baf88de 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c | |||
@@ -26,7 +26,7 @@ DEFINE_SPINLOCK(vnumber_lock); | |||
26 | */ | 26 | */ |
27 | #define NVSYNC 37 | 27 | #define NVSYNC 37 |
28 | #define vptosync(v) (&vsync[((unsigned long)v) % NVSYNC]) | 28 | #define vptosync(v) (&vsync[((unsigned long)v) % NVSYNC]) |
29 | STATIC wait_queue_head_t vsync[NVSYNC]; | 29 | static wait_queue_head_t vsync[NVSYNC]; |
30 | 30 | ||
31 | void | 31 | void |
32 | vn_init(void) | 32 | vn_init(void) |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 515f5fdea57a..b76118cf4897 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -489,14 +489,14 @@ static inline struct bhv_vnode *vn_grab(struct bhv_vnode *vp) | |||
489 | #define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock) | 489 | #define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock) |
490 | #define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s) | 490 | #define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s) |
491 | 491 | ||
492 | static __inline__ void vn_flagset(struct bhv_vnode *vp, uint flag) | 492 | STATIC_INLINE void vn_flagset(struct bhv_vnode *vp, uint flag) |
493 | { | 493 | { |
494 | spin_lock(&vp->v_lock); | 494 | spin_lock(&vp->v_lock); |
495 | vp->v_flag |= flag; | 495 | vp->v_flag |= flag; |
496 | spin_unlock(&vp->v_lock); | 496 | spin_unlock(&vp->v_lock); |
497 | } | 497 | } |
498 | 498 | ||
499 | static __inline__ uint vn_flagclr(struct bhv_vnode *vp, uint flag) | 499 | STATIC_INLINE uint vn_flagclr(struct bhv_vnode *vp, uint flag) |
500 | { | 500 | { |
501 | uint cleared; | 501 | uint cleared; |
502 | 502 | ||