Re: [STACK] >3k call path in ide

From: Jörn Engel
Date: Thu Jun 10 2004 - 18:01:16 EST


On Wed, 9 June 2004 12:27:21 -0700, Andrew Morton wrote:
> Jörn Engel <joern@xxxxxxxxxxxxxxxxxxxx> 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);

read_page_state doesn't exist in 2.6.7-rc3 or 2.6.6-mm5. How is it
defined?

If it is just a simple macro to access the right fields, then the
patch looks fine to me.

> - 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);
> _

Jörn

--
Fantasy is more important than knowledge. Knowledge is limited,
while fantasy embraces the whole world.
-- Albert Einstein
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/