Re: [PATCH] stop page_state stack waste

From: Andrew Morton
Date: Tue Jun 08 2004 - 16:11:50 EST


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:



The ____cacheline_aligned in there is a leftover from before the existence of
the percpu infrastructure. It bloats struct page_state and structures which
contain it enormously, and we use these things on the stack deep in page
reclaim.

Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

25-akpm/include/linux/page-flags.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN include/linux/page-flags.h~unalign-page_state include/linux/page-flags.h
--- 25/include/linux/page-flags.h~unalign-page_state 2004-06-08 03:08:02.766976760 -0700
+++ 25-akpm/include/linux/page-flags.h 2004-06-08 03:08:02.769976304 -0700
@@ -133,7 +133,7 @@ struct page_state {
unsigned long allocstall; /* direct reclaim calls */

unsigned long pgrotated; /* pages rotated to tail of the LRU */
-} ____cacheline_aligned;
+};

DECLARE_PER_CPU(struct page_state, page_states);

_

-
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/