Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7989cb8e authored by David Chinner's avatar David Chinner Committed by Tim Shimmin
Browse files

[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: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarDavid Chatterton <chatz@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent 5e6a07df
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -249,7 +249,7 @@ xfs_map_blocks(
	return -error;
	return -error;
}
}


STATIC inline int
STATIC_INLINE int
xfs_iomap_valid(
xfs_iomap_valid(
	xfs_iomap_t		*iomapp,
	xfs_iomap_t		*iomapp,
	loff_t			offset)
	loff_t			offset)
+12 −12
Original line number Original line Diff line number Diff line
@@ -34,13 +34,13 @@
#include <linux/backing-dev.h>
#include <linux/backing-dev.h>
#include <linux/freezer.h>
#include <linux/freezer.h>


STATIC kmem_zone_t *xfs_buf_zone;
static kmem_zone_t *xfs_buf_zone;
STATIC kmem_shaker_t xfs_buf_shake;
static kmem_shaker_t xfs_buf_shake;
STATIC int xfsbufd(void *);
STATIC int xfsbufd(void *);
STATIC int xfsbufd_wakeup(int, gfp_t);
STATIC int xfsbufd_wakeup(int, gfp_t);
STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int);
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;
struct workqueue_struct *xfsdatad_workqueue;


#ifdef XFS_BUF_TRACE
#ifdef XFS_BUF_TRACE
@@ -139,7 +139,7 @@ page_region_mask(
	return mask;
	return mask;
}
}


STATIC inline void
STATIC_INLINE void
set_page_region(
set_page_region(
	struct page	*page,
	struct page	*page,
	size_t		offset,
	size_t		offset,
@@ -151,7 +151,7 @@ set_page_region(
		SetPageUptodate(page);
		SetPageUptodate(page);
}
}


STATIC inline int
STATIC_INLINE int
test_page_region(
test_page_region(
	struct page	*page,
	struct page	*page,
	size_t		offset,
	size_t		offset,
@@ -171,9 +171,9 @@ typedef struct a_list {
	struct a_list	*next;
	struct a_list	*next;
} a_list_t;
} a_list_t;


STATIC a_list_t		*as_free_head;
static a_list_t		*as_free_head;
STATIC int		as_list_len;
static int		as_list_len;
STATIC DEFINE_SPINLOCK(as_lock);
static DEFINE_SPINLOCK(as_lock);


/*
/*
 *	Try to batch vunmaps because they are costly.
 *	Try to batch vunmaps because they are costly.
@@ -1085,7 +1085,7 @@ xfs_buf_iostart(
	return status;
	return status;
}
}


STATIC __inline__ int
STATIC_INLINE int
_xfs_buf_iolocked(
_xfs_buf_iolocked(
	xfs_buf_t		*bp)
	xfs_buf_t		*bp)
{
{
@@ -1095,7 +1095,7 @@ _xfs_buf_iolocked(
	return 0;
	return 0;
}
}


STATIC __inline__ void
STATIC_INLINE void
_xfs_buf_ioend(
_xfs_buf_ioend(
	xfs_buf_t		*bp,
	xfs_buf_t		*bp,
	int			schedule)
	int			schedule)
@@ -1426,8 +1426,8 @@ xfs_free_bufhash(
/*
/*
 *	buftarg list for delwrite queue processing
 *	buftarg list for delwrite queue processing
 */
 */
STATIC LIST_HEAD(xfs_buftarg_list);
LIST_HEAD(xfs_buftarg_list);
STATIC DEFINE_SPINLOCK(xfs_buftarg_lock);
static DEFINE_SPINLOCK(xfs_buftarg_lock);


STATIC void
STATIC void
xfs_register_buftarg(
xfs_register_buftarg(
+1 −1
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@
#include "xfs_mount.h"
#include "xfs_mount.h"
#include "xfs_export.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
 * XFS encodes and decodes the fileid portion of NFS filehandles
+2 −2
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ static struct vm_operations_struct xfs_file_vm_ops;
static struct vm_operations_struct xfs_dmapi_file_vm_ops;
static struct vm_operations_struct xfs_dmapi_file_vm_ops;
#endif
#endif


STATIC inline ssize_t
STATIC_INLINE ssize_t
__xfs_file_read(
__xfs_file_read(
	struct kiocb		*iocb,
	struct kiocb		*iocb,
	const struct iovec	*iov,
	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);
	return __xfs_file_read(iocb, iov, nr_segs, IO_ISAIO|IO_INVIS, pos);
}
}


STATIC inline ssize_t
STATIC_INLINE ssize_t
__xfs_file_write(
__xfs_file_write(
	struct kiocb		*iocb,
	struct kiocb		*iocb,
	const struct iovec	*iov,
	const struct iovec	*iov,
+2 −2
Original line number Original line Diff line number Diff line
@@ -250,13 +250,13 @@ xfs_init_security(
 *
 *
 * XXX(hch):  nfsd is broken, better fix it instead.
 * XXX(hch):  nfsd is broken, better fix it instead.
 */
 */
STATIC inline int
STATIC_INLINE int
xfs_has_fs_struct(struct task_struct *task)
xfs_has_fs_struct(struct task_struct *task)
{
{
	return (task->fs != init_task.fs);
	return (task->fs != init_task.fs);
}
}


STATIC inline void
STATIC void
xfs_cleanup_inode(
xfs_cleanup_inode(
	bhv_vnode_t	*dvp,
	bhv_vnode_t	*dvp,
	bhv_vnode_t	*vp,
	bhv_vnode_t	*vp,
Loading