public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] mark various functions as noinline_for_stack
@ 2008-04-22 15:39 Eric Sandeen
  2008-04-22 15:51 ` [PATCH 1/4] mark sys_mount helper " Eric Sandeen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eric Sandeen @ 2008-04-22 15:39 UTC (permalink / raw)
  To: linux-kernel Mailing List; +Cc: Andrew Morton, Peter Zijlstra

After I noinlined a few sys_mount helpers for stack reasons, there was
discussion of a special self-documenting noinline.  I said I'd send a
patch to do that, but shirked my duty.  I see that Andrew has put
"noinline_for_stack" into place already.... as penance, I've gone
through a few subsystems using "noinline" and where specific
stack-related comments existed, I replaced noinline with
noinline_for_stack and removed the comments.

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] mark sys_mount helper functions as noinline_for_stack
  2008-04-22 15:39 [PATCH 0/4] mark various functions as noinline_for_stack Eric Sandeen
@ 2008-04-22 15:51 ` Eric Sandeen
  2008-04-22 15:54 ` [PATCH 2/4] mark lockdep " Eric Sandeen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2008-04-22 15:51 UTC (permalink / raw)
  To: linux-kernel Mailing List; +Cc: Andrew Morton

Use the self-documenting noinline_for_stack attribute
in sys_mount helper functions.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6.25/fs/namespace.c
===================================================================
--- linux-2.6.25.orig/fs/namespace.c	2008-04-20 22:32:50.000000000 -0500
+++ linux-2.6.25/fs/namespace.c	2008-04-22 09:56:59.824406548 -0500
@@ -946,9 +946,8 @@ out_unlock:
 
 /*
  * recursively change the type of the mountpoint.
- * noinline this do_mount helper to save do_mount stack space.
  */
-static noinline int do_change_type(struct nameidata *nd, int flag)
+static noinline_for_stack int do_change_type(struct nameidata *nd, int flag)
 {
 	struct vfsmount *m, *mnt = nd->path.mnt;
 	int recurse = flag & MS_REC;
@@ -971,9 +970,8 @@ static noinline int do_change_type(struc
 
 /*
  * do loopback mount.
- * noinline this do_mount helper to save do_mount stack space.
  */
-static noinline int do_loopback(struct nameidata *nd, char *old_name,
+static noinline_for_stack int do_loopback(struct nameidata *nd, char *old_name,
 				int recurse)
 {
 	struct nameidata old_nd;
@@ -1023,10 +1021,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 noinline int do_remount(struct nameidata *nd, int flags, int mnt_flags,
-		      void *data)
+static noinline_for_stack int do_remount(struct nameidata *nd, int flags,
+		      int mnt_flags, void *data)
 {
 	int err;
 	struct super_block *sb = nd->path.mnt->mnt_sb;
@@ -1060,10 +1057,8 @@ static inline int tree_contains_unbindab
 	return 0;
 }
 
-/*
- * noinline this do_mount helper to save do_mount stack space.
- */
-static noinline int do_move_mount(struct nameidata *nd, char *old_name)
+static noinline_for_stack int do_move_mount(struct nameidata *nd,
+		char *old_name)
 {
 	struct nameidata old_nd;
 	struct path parent_path;
@@ -1141,10 +1136,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 noinline int do_new_mount(struct nameidata *nd, char *type, int flags,
-			int mnt_flags, char *name, void *data)
+static noinline_for_stack int do_new_mount(struct nameidata *nd, char *type,
+			int flags, int mnt_flags, char *name, void *data)
 {
 	struct vfsmount *mnt;
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/4] mark lockdep functions as noinline_for_stack
  2008-04-22 15:39 [PATCH 0/4] mark various functions as noinline_for_stack Eric Sandeen
  2008-04-22 15:51 ` [PATCH 1/4] mark sys_mount helper " Eric Sandeen
@ 2008-04-22 15:54 ` Eric Sandeen
  2008-04-22 15:55 ` [PATCH 3/4] mark loop " Eric Sandeen
  2008-04-22 15:57 ` [PATCH 4/4] mark inflate " Eric Sandeen
  3 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2008-04-22 15:54 UTC (permalink / raw)
  To: linux-kernel Mailing List; +Cc: Andrew Morton, Peter Zijlstra

Use the self-documenting noinline_for_stack attribute
in lockdep functions.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6.25/kernel/lockdep.c
===================================================================
--- linux-2.6.25.orig/kernel/lockdep.c	2008-04-22 10:31:08.158469196 -0500
+++ linux-2.6.25/kernel/lockdep.c	2008-04-22 10:51:17.107410380 -0500
@@ -878,7 +878,7 @@ static struct held_lock *check_source, *
  * Print a dependency chain entry (this is only done when a deadlock
  * has been detected):
  */
-static noinline int
+static noinline_for_stack int
 print_circular_bug_entry(struct lock_list *target, unsigned int depth)
 {
 	if (debug_locks_silent)
@@ -895,7 +895,7 @@ print_circular_bug_entry(struct lock_lis
  * When a circular dependency is detected, print the
  * header first:
  */
-static noinline int
+static noinline_for_stack int
 print_circular_bug_header(struct lock_list *entry, unsigned int depth)
 {
 	struct task_struct *curr = current;
@@ -920,7 +920,7 @@ print_circular_bug_header(struct lock_li
 	return 0;
 }
 
-static noinline int print_circular_bug_tail(void)
+static noinline_for_stack int print_circular_bug_tail(void)
 {
 	struct task_struct *curr = current;
 	struct lock_list this;
@@ -945,7 +945,7 @@ static noinline int print_circular_bug_t
 
 #define RECURSION_LIMIT 40
 
-static int noinline print_infinite_recursion_bug(void)
+static int noinline_for_stack print_infinite_recursion_bug(void)
 {
 	if (!debug_locks_off_graph_unlock())
 		return 0;
@@ -959,7 +959,7 @@ static int noinline print_infinite_recur
  * Prove that the dependency graph starting at <entry> can not
  * lead to <target>. Print an error and return 0 if it does.
  */
-static noinline int
+static noinline_for_stack int
 check_noncircular(struct lock_class *source, unsigned int depth)
 {
 	struct lock_list *entry;
@@ -1001,7 +1001,7 @@ static struct lock_class *forwards_match
  * Return 1 otherwise and keep <forwards_match> unchanged.
  * Return 0 on error.
  */
-static noinline int
+static noinline_for_stack int
 find_usage_forwards(struct lock_class *source, unsigned int depth)
 {
 	struct lock_list *entry;
@@ -1040,7 +1040,7 @@ find_usage_forwards(struct lock_class *s
  * Return 1 otherwise and keep <backwards_match> unchanged.
  * Return 0 on error.
  */
-static noinline int
+static noinline_for_stack int
 find_usage_backwards(struct lock_class *source, unsigned int depth)
 {
 	struct lock_list *entry;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/4] mark loop functions as noinline_for_stack
  2008-04-22 15:39 [PATCH 0/4] mark various functions as noinline_for_stack Eric Sandeen
  2008-04-22 15:51 ` [PATCH 1/4] mark sys_mount helper " Eric Sandeen
  2008-04-22 15:54 ` [PATCH 2/4] mark lockdep " Eric Sandeen
@ 2008-04-22 15:55 ` Eric Sandeen
  2008-04-22 15:57 ` [PATCH 4/4] mark inflate " Eric Sandeen
  3 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2008-04-22 15:55 UTC (permalink / raw)
  To: linux-kernel Mailing List; +Cc: Andrew Morton

Use the self-documenting noinline_for_stack attribute
in loop functions.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6.25/drivers/block/loop.c
===================================================================
--- linux-2.6.25.orig/drivers/block/loop.c	2008-04-22 10:31:05.015471118 -0500
+++ linux-2.6.25/drivers/block/loop.c	2008-04-22 10:51:18.070407735 -0500
@@ -1182,9 +1182,8 @@ struct compat_loop_info {
 
 /*
  * Transfer 32-bit compatibility structure in userspace to 64-bit loop info
- * - noinlined to reduce stack space usage in main part of driver
  */
-static noinline int
+static noinline_for_stack int
 loop_info64_from_compat(const struct compat_loop_info __user *arg,
 			struct loop_info64 *info64)
 {
@@ -1215,9 +1214,8 @@ loop_info64_from_compat(const struct com
 
 /*
  * Transfer 64-bit loop info to 32-bit compatibility structure in userspace
- * - noinlined to reduce stack space usage in main part of driver
  */
-static noinline int
+static noinline_for_stack int
 loop_info64_to_compat(const struct loop_info64 *info64,
 		      struct compat_loop_info __user *arg)
 {


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/4] mark inflate functions as noinline_for_stack
  2008-04-22 15:39 [PATCH 0/4] mark various functions as noinline_for_stack Eric Sandeen
                   ` (2 preceding siblings ...)
  2008-04-22 15:55 ` [PATCH 3/4] mark loop " Eric Sandeen
@ 2008-04-22 15:57 ` Eric Sandeen
  3 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2008-04-22 15:57 UTC (permalink / raw)
  To: linux-kernel Mailing List; +Cc: Andrew Morton

Use the self-documenting noinline_for_stack attribute
in inflate functions.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6.25/lib/inflate.c
===================================================================
--- linux-2.6.25.orig/lib/inflate.c	2008-04-22 10:31:00.923406674 -0500
+++ linux-2.6.25/lib/inflate.c	2008-04-22 10:51:19.219407765 -0500
@@ -716,10 +716,7 @@ DEBG("<stor");
 }
 
 
-/*
- * We use `noinline' here to prevent gcc-3.5 from using too much stack space
- */
-STATIC int noinline INIT inflate_fixed(void)
+STATIC int noinline_for_stack INIT inflate_fixed(void)
 /* decompress an inflated type 1 (fixed Huffman codes) block.  We should
    either replace this with a custom decoder, or at least precompute the
    Huffman tables. */
@@ -780,10 +777,7 @@ DEBG("<fix");
 }
 
 
-/*
- * We use `noinline' here to prevent gcc-3.5 from using too much stack space
- */
-STATIC int noinline INIT inflate_dynamic(void)
+STATIC int noinline_for_stack INIT inflate_dynamic(void)
 /* decompress an inflated type 2 (dynamic Huffman codes) block. */
 {
   int i;                /* temporary variables */


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-22 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22 15:39 [PATCH 0/4] mark various functions as noinline_for_stack Eric Sandeen
2008-04-22 15:51 ` [PATCH 1/4] mark sys_mount helper " Eric Sandeen
2008-04-22 15:54 ` [PATCH 2/4] mark lockdep " Eric Sandeen
2008-04-22 15:55 ` [PATCH 3/4] mark loop " Eric Sandeen
2008-04-22 15:57 ` [PATCH 4/4] mark inflate " Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox