Re: [PATCH] stop page_state stack waste

From: Andrew Morton
Date: Tue Jun 08 2004 - 17:54:40 EST


Hugh Dickins <hugh@xxxxxxxxxxx> wrote:
>
> On Tue, 8 Jun 2004, Andrew Morton wrote:
> > Hugh Dickins <hugh@xxxxxxxxxxx> wrote:
> > >
> > > Replace get_page_state (which memset most of full page_state to 0) by
> > > get_main_page_state, which just sets the small structure needed. This
> > > helps 4k stacks not to overflow: cuts 224 bytes off try_to_free_pages
> > > and wakeup_bdflush (and sync_inodes_sb) stack usages: wakeup_bdflush
> > > doesn't do much, but is called by try_to_free_pages and mempool_alloc.
> >
> > Yeah, I was looking at that. I simply did:
> > -} ____cacheline_aligned;
> > +};
>
> Well, that is a smaller patch; but you're still wasting 124 bytes of
> stack in wakeup_bdflush below 124 bytes wasted in try_to_free_pages.
>

yup, but that's better than 256+256, or 512+256 in -mm.

Your patch was kinda icky. I think it would be better to remove those
page_state variables altogether and use something along the lines of

unsigned long __read_page_state(unsigned offset);
#define read_page_state(var) __read_page_state(offsetof(page_states, var))

I'll cook something up...
-
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/