[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:

committed by
Tim Shimmin

parent
5e6a07dfe4
commit
7989cb8ef5
@@ -249,7 +249,7 @@ xfs_map_blocks(
|
||||
return -error;
|
||||
}
|
||||
|
||||
STATIC inline int
|
||||
STATIC_INLINE int
|
||||
xfs_iomap_valid(
|
||||
xfs_iomap_t *iomapp,
|
||||
loff_t offset)
|
||||
|
@@ -34,13 +34,13 @@
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/freezer.h>
|
||||
|
||||
STATIC kmem_zone_t *xfs_buf_zone;
|
||||
STATIC kmem_shaker_t xfs_buf_shake;
|
||||
static kmem_zone_t *xfs_buf_zone;
|
||||
static kmem_shaker_t xfs_buf_shake;
|
||||
STATIC int xfsbufd(void *);
|
||||
STATIC int xfsbufd_wakeup(int, gfp_t);
|
||||
STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int);
|
||||
|
||||
STATIC struct workqueue_struct *xfslogd_workqueue;
|
||||
static struct workqueue_struct *xfslogd_workqueue;
|
||||
struct workqueue_struct *xfsdatad_workqueue;
|
||||
|
||||
#ifdef XFS_BUF_TRACE
|
||||
@@ -139,7 +139,7 @@ page_region_mask(
|
||||
return mask;
|
||||
}
|
||||
|
||||
STATIC inline void
|
||||
STATIC_INLINE void
|
||||
set_page_region(
|
||||
struct page *page,
|
||||
size_t offset,
|
||||
@@ -151,7 +151,7 @@ set_page_region(
|
||||
SetPageUptodate(page);
|
||||
}
|
||||
|
||||
STATIC inline int
|
||||
STATIC_INLINE int
|
||||
test_page_region(
|
||||
struct page *page,
|
||||
size_t offset,
|
||||
@@ -171,9 +171,9 @@ typedef struct a_list {
|
||||
struct a_list *next;
|
||||
} a_list_t;
|
||||
|
||||
STATIC a_list_t *as_free_head;
|
||||
STATIC int as_list_len;
|
||||
STATIC DEFINE_SPINLOCK(as_lock);
|
||||
static a_list_t *as_free_head;
|
||||
static int as_list_len;
|
||||
static DEFINE_SPINLOCK(as_lock);
|
||||
|
||||
/*
|
||||
* Try to batch vunmaps because they are costly.
|
||||
@@ -1085,7 +1085,7 @@ xfs_buf_iostart(
|
||||
return status;
|
||||
}
|
||||
|
||||
STATIC __inline__ int
|
||||
STATIC_INLINE int
|
||||
_xfs_buf_iolocked(
|
||||
xfs_buf_t *bp)
|
||||
{
|
||||
@@ -1095,7 +1095,7 @@ _xfs_buf_iolocked(
|
||||
return 0;
|
||||
}
|
||||
|
||||
STATIC __inline__ void
|
||||
STATIC_INLINE void
|
||||
_xfs_buf_ioend(
|
||||
xfs_buf_t *bp,
|
||||
int schedule)
|
||||
@@ -1426,8 +1426,8 @@ xfs_free_bufhash(
|
||||
/*
|
||||
* buftarg list for delwrite queue processing
|
||||
*/
|
||||
STATIC LIST_HEAD(xfs_buftarg_list);
|
||||
STATIC DEFINE_SPINLOCK(xfs_buftarg_lock);
|
||||
LIST_HEAD(xfs_buftarg_list);
|
||||
static DEFINE_SPINLOCK(xfs_buftarg_lock);
|
||||
|
||||
STATIC void
|
||||
xfs_register_buftarg(
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include "xfs_mount.h"
|
||||
#include "xfs_export.h"
|
||||
|
||||
STATIC struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
|
||||
static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
|
||||
|
||||
/*
|
||||
* XFS encodes and decodes the fileid portion of NFS filehandles
|
||||
|
@@ -46,7 +46,7 @@ static struct vm_operations_struct xfs_file_vm_ops;
|
||||
static struct vm_operations_struct xfs_dmapi_file_vm_ops;
|
||||
#endif
|
||||
|
||||
STATIC inline ssize_t
|
||||
STATIC_INLINE ssize_t
|
||||
__xfs_file_read(
|
||||
struct kiocb *iocb,
|
||||
const struct iovec *iov,
|
||||
@@ -84,7 +84,7 @@ xfs_file_aio_read_invis(
|
||||
return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos);
|
||||
}
|
||||
|
||||
STATIC inline ssize_t
|
||||
STATIC_INLINE ssize_t
|
||||
__xfs_file_write(
|
||||
struct kiocb *iocb,
|
||||
const struct iovec *iov,
|
||||
|
@@ -250,13 +250,13 @@ xfs_init_security(
|
||||
*
|
||||
* XXX(hch): nfsd is broken, better fix it instead.
|
||||
*/
|
||||
STATIC inline int
|
||||
STATIC_INLINE int
|
||||
xfs_has_fs_struct(struct task_struct *task)
|
||||
{
|
||||
return (task->fs != init_task.fs);
|
||||
}
|
||||
|
||||
STATIC inline void
|
||||
STATIC void
|
||||
xfs_cleanup_inode(
|
||||
bhv_vnode_t *dvp,
|
||||
bhv_vnode_t *vp,
|
||||
|
@@ -58,10 +58,10 @@
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/freezer.h>
|
||||
|
||||
STATIC struct quotactl_ops xfs_quotactl_operations;
|
||||
STATIC struct super_operations xfs_super_operations;
|
||||
STATIC kmem_zone_t *xfs_vnode_zone;
|
||||
STATIC kmem_zone_t *xfs_ioend_zone;
|
||||
static struct quotactl_ops xfs_quotactl_operations;
|
||||
static struct super_operations xfs_super_operations;
|
||||
static kmem_zone_t *xfs_vnode_zone;
|
||||
static kmem_zone_t *xfs_ioend_zone;
|
||||
mempool_t *xfs_ioend_pool;
|
||||
|
||||
STATIC struct xfs_mount_args *
|
||||
@@ -121,7 +121,7 @@ xfs_max_file_offset(
|
||||
return (((__uint64_t)pagefactor) << bitshift) - 1;
|
||||
}
|
||||
|
||||
STATIC __inline__ void
|
||||
STATIC_INLINE void
|
||||
xfs_set_inodeops(
|
||||
struct inode *inode)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ xfs_set_inodeops(
|
||||
}
|
||||
}
|
||||
|
||||
STATIC __inline__ void
|
||||
STATIC_INLINE void
|
||||
xfs_revalidate_inode(
|
||||
xfs_mount_t *mp,
|
||||
bhv_vnode_t *vp,
|
||||
@@ -873,7 +873,7 @@ xfs_fs_get_sb(
|
||||
mnt);
|
||||
}
|
||||
|
||||
STATIC struct super_operations xfs_super_operations = {
|
||||
static struct super_operations xfs_super_operations = {
|
||||
.alloc_inode = xfs_fs_alloc_inode,
|
||||
.destroy_inode = xfs_fs_destroy_inode,
|
||||
.write_inode = xfs_fs_write_inode,
|
||||
@@ -887,7 +887,7 @@ STATIC struct super_operations xfs_super_operations = {
|
||||
.show_options = xfs_fs_show_options,
|
||||
};
|
||||
|
||||
STATIC struct quotactl_ops xfs_quotactl_operations = {
|
||||
static struct quotactl_ops xfs_quotactl_operations = {
|
||||
.quota_sync = xfs_fs_quotasync,
|
||||
.get_xstate = xfs_fs_getxstate,
|
||||
.set_xstate = xfs_fs_setxstate,
|
||||
|
@@ -54,7 +54,7 @@ xfs_stats_clear_proc_handler(
|
||||
}
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
STATIC ctl_table xfs_table[] = {
|
||||
static ctl_table xfs_table[] = {
|
||||
{XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val,
|
||||
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
|
||||
&sysctl_intvec, NULL,
|
||||
@@ -136,12 +136,12 @@ STATIC ctl_table xfs_table[] = {
|
||||
{0}
|
||||
};
|
||||
|
||||
STATIC ctl_table xfs_dir_table[] = {
|
||||
static ctl_table xfs_dir_table[] = {
|
||||
{FS_XFS, "xfs", NULL, 0, 0555, xfs_table},
|
||||
{0}
|
||||
};
|
||||
|
||||
STATIC ctl_table xfs_root_table[] = {
|
||||
static ctl_table xfs_root_table[] = {
|
||||
{CTL_FS, "fs", NULL, 0, 0555, xfs_dir_table},
|
||||
{0}
|
||||
};
|
||||
|
@@ -26,7 +26,7 @@ DEFINE_SPINLOCK(vnumber_lock);
|
||||
*/
|
||||
#define NVSYNC 37
|
||||
#define vptosync(v) (&vsync[((unsigned long)v) % NVSYNC])
|
||||
STATIC wait_queue_head_t vsync[NVSYNC];
|
||||
static wait_queue_head_t vsync[NVSYNC];
|
||||
|
||||
void
|
||||
vn_init(void)
|
||||
|
@@ -489,14 +489,14 @@ static inline struct bhv_vnode *vn_grab(struct bhv_vnode *vp)
|
||||
#define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock)
|
||||
#define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s)
|
||||
|
||||
static __inline__ void vn_flagset(struct bhv_vnode *vp, uint flag)
|
||||
STATIC_INLINE void vn_flagset(struct bhv_vnode *vp, uint flag)
|
||||
{
|
||||
spin_lock(&vp->v_lock);
|
||||
vp->v_flag |= flag;
|
||||
spin_unlock(&vp->v_lock);
|
||||
}
|
||||
|
||||
static __inline__ uint vn_flagclr(struct bhv_vnode *vp, uint flag)
|
||||
STATIC_INLINE uint vn_flagclr(struct bhv_vnode *vp, uint flag)
|
||||
{
|
||||
uint cleared;
|
||||
|
||||
|
Reference in New Issue
Block a user