public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Denys Vlasenko <vda.linux@googlemail.com>
Cc: David Chinner <dgc@sgi.com>,
	xfs@oss.sgi.com, Eric Sandeen <sandeen@sandeen.net>,
	Adrian Bunk <bunk@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xfs: reduce stack usage in xfs_page_state_convert()
Date: Mon, 28 Apr 2008 09:23:17 +1000	[thread overview]
Message-ID: <20080427232317.GB103491721@sgi.com> (raw)
In-Reply-To: <200804270246.58828.vda.linux@googlemail.com>

On Sun, Apr 27, 2008 at 02:46:58AM +0200, Denys Vlasenko wrote:
> Hi David,
> 
> This patch reduces xfs_page_state_convert() stack usage by 16 bytes
> by eliminating some local variables, and reducing the size
> of scope for other locals.
> 
> Compile tested only.

Can you start testing your patches? if you are touching the writeback
or allocator path, there's a pretty high barrier to having patches
excepted, and testing them before is one of them. Go and download the
XFSQA suite from the xfs-cmds CVS tree on oss.sgi.com, and run your
patches through it....

> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
> 
> P.S.
> 
> xfs_page_state_convert() carries the following comment:
>  * Calling this without startio set means we are being asked to make a dirty
>  * page ready for freeing it's buffers.  When called with startio set then
>  * we are coming from writepage.
> which leads to the following proposal: reimplement it as two
> functions, one which work as if startio parameter == 0
> and the other as if startio == 1.
> This will result in a bit of code duplication, but reduces
> stack usage on writepage path and allows for these two functions
> to have more descriptive names. (Presently the meaning of this
> function needs to be explained in that comment -> function
> name is not descriptive enough, because it does different things
> depending on startio value).
> 
> Do you like this idea?

No. That code is complex enough with only one copy of it around. I don't
want two copies that differ subtly and hence have two different sets
of nasty, rarely hit corner cases in them.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  reply	other threads:[~2008-04-27 23:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27  0:46 [PATCH] xfs: reduce stack usage in xfs_page_state_convert() Denys Vlasenko
2008-04-27 23:23 ` David Chinner [this message]
2008-04-27 23:48   ` Denys Vlasenko
2008-04-28  2:37     ` David Chinner
2008-04-28  3:51       ` Christoph Hellwig
2008-04-28  3:50   ` Christoph Hellwig
2008-04-28 22:22     ` David Chinner

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=20080427232317.GB103491721@sgi.com \
    --to=dgc@sgi.com \
    --cc=bunk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    --cc=vda.linux@googlemail.com \
    --cc=xfs@oss.sgi.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