public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: michael@metaparadigm.com, linux-kernel@vger.kernel.org, hugh@veritas.com
Subject: Re: [STACK] >3k call path in ide
Date: Wed, 9 Jun 2004 12:27:21 -0700	[thread overview]
Message-ID: <20040609122721.0695cf96.akpm@osdl.org> (raw)
In-Reply-To: <20040609162949.GC29531@wohnheim.fh-wedel.de>

Jörn Engel <joern@wohnheim.fh-wedel.de> wrote:
>
>  Andrew, what do you thing about the patch below for sync_inodes_sb()?
>  It's stack consumption is reduced from 308 to 64, at the cost of one
>  more function call.

Like this:

--- 25/fs/fs-writeback.c~sync_inodes_sb-stack-reduction	2004-06-09 12:25:57.111389456 -0700
+++ 25-akpm/fs/fs-writeback.c	2004-06-09 12:25:57.115388848 -0700
@@ -433,15 +433,15 @@ restart:
  */
 void sync_inodes_sb(struct super_block *sb, int wait)
 {
-	struct page_state ps;
 	struct writeback_control wbc = {
 		.sync_mode	= wait ? WB_SYNC_ALL : WB_SYNC_HOLD,
 	};
+	unsigned long nr_dirty = read_page_state(nr_dirty);
+	unsigned long nr_unstable = read_page_state(nr_unstable);
 
-	get_page_state(&ps);
-	wbc.nr_to_write = ps.nr_dirty + ps.nr_unstable +
+	wbc.nr_to_write = nr_dirty + nr_unstable +
 			(inodes_stat.nr_inodes - inodes_stat.nr_unused) +
-			ps.nr_dirty + ps.nr_unstable;
+			nr_dirty + nr_unstable;
 	wbc.nr_to_write += wbc.nr_to_write / 2;		/* Bit more for luck */
 	spin_lock(&inode_lock);
 	sync_sb_inodes(sb, &wbc);
_


  reply	other threads:[~2004-06-09 19:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09 12:29 [STACK] >3k call path in ide Jörn Engel
2004-06-09 15:23 ` Michael Clark
2004-06-09 16:29   ` Jörn Engel
2004-06-09 19:27     ` Andrew Morton [this message]
2004-06-10 22:59       ` Jörn Engel
2004-06-10 23:10         ` Andrew Morton
2004-06-11 10:53           ` Jörn Engel
2004-10-15  1:58           ` Rusty Russell
2004-06-15 23:34 ` [PATCH] " Randy.Dunlap
2004-06-16  7:11   ` Florian Schirmer
2004-06-16  9:47     ` Jörn Engel
2004-06-16  9:55       ` Florian Schirmer
2004-06-16 10:00         ` Jörn Engel
2004-06-16 17:37           ` [PATCH] [STACK] reduce " Randy.Dunlap
2004-06-16 17:57             ` Jörn Engel
2004-06-16 18:16               ` Randy.Dunlap
2004-06-16 18:29                 ` Jörn Engel
2004-06-16 18:49                   ` Randy.Dunlap
2004-06-16 18:58             ` Brian Gerst
2004-06-16 19:52               ` Randy.Dunlap
2004-06-16 22:53                 ` Randy.Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040609122721.0695cf96.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@metaparadigm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox