Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2dafe1c4d69345539735cca64250f2d4657bd057
Commit:     2dafe1c4d69345539735cca64250f2d4657bd057
Parent:     ac2a659968f5318a180213f0409c2ea21f072820
Author:     Eric Sandeen <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:22:12 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:44 2008 -0800

    reduce large do_mount stack usage with noinlines
    
    do_mount() uses a whopping 616 bytes of stack on x86_64 in 2.6.24-mm1,
    largely thanks to gcc inlining the various helper functions.
    
    noinlining these can slim it down a lot; on my box this patch gets it down
    to 168, which is mostly the struct nameidata nd; left on the stack.
    
    These functions are called only as do_mount() helpers; none of them should
    be in any path that would see a performance benefit from inlining...
    
    Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]>
    Cc: Arjan van de Ven <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/namespace.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index db51ddc..63ced21 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -936,8 +936,9 @@ out_unlock:
 
 /*
  * recursively change the type of the mountpoint.
+ * noinline this do_mount helper to save do_mount stack space.
  */
-static int do_change_type(struct nameidata *nd, int flag)
+static noinline int do_change_type(struct nameidata *nd, int flag)
 {
        struct vfsmount *m, *mnt = nd->mnt;
        int recurse = flag & MS_REC;
@@ -960,8 +961,10 @@ static int do_change_type(struct nameidata *nd, int flag)
 
 /*
  * do loopback mount.
+ * noinline this do_mount helper to save do_mount stack space.
  */
-static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
+static noinline int do_loopback(struct nameidata *nd, char *old_name,
+                               int recurse)
 {
        struct nameidata old_nd;
        struct vfsmount *mnt = NULL;
@@ -1010,8 +1013,9 @@ out:
  * change filesystem flags. dir should be a physical root of filesystem.
  * If you've mounted a non-root directory somewhere and want to do remount
  * on it - tough luck.
+ * noinline this do_mount helper to save do_mount stack space.
  */
-static int do_remount(struct nameidata *nd, int flags, int mnt_flags,
+static noinline int do_remount(struct nameidata *nd, int flags, int mnt_flags,
                      void *data)
 {
        int err;
@@ -1046,7 +1050,10 @@ static inline int tree_contains_unbindable(struct 
vfsmount *mnt)
        return 0;
 }
 
-static int do_move_mount(struct nameidata *nd, char *old_name)
+/*
+ * noinline this do_mount helper to save do_mount stack space.
+ */
+static noinline int do_move_mount(struct nameidata *nd, char *old_name)
 {
        struct nameidata old_nd, parent_nd;
        struct vfsmount *p;
@@ -1121,8 +1128,9 @@ out:
 /*
  * create a new mount for userspace and request it to be added into the
  * namespace's tree
+ * noinline this do_mount helper to save do_mount stack space.
  */
-static int do_new_mount(struct nameidata *nd, char *type, int flags,
+static noinline int do_new_mount(struct nameidata *nd, char *type, int flags,
                        int mnt_flags, char *name, void *data)
 {
        struct vfsmount *mnt;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to