[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111110152944.GL3153@redhat.com>
Date: Thu, 10 Nov 2011 16:29:44 +0100
From: Johannes Weiner <jweiner@...hat.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: Konstantin Khlebnikov <khlebnikov@...allels.com>,
Pekka Enberg <penberg@...nel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Wu Fengguang <fengguang.wu@...el.com>,
Johannes Weiner <hannes@...xchg.org>,
Rik van Riel <riel@...hat.com>, Mel Gorman <mel@....ul.ie>,
Minchan Kim <minchan.kim@...il.com>,
Gene Heskett <gene.heskett@...il.com>
Subject: Re: [rfc 1/3] mm: vmscan: never swap under low memory pressure
On Mon, Nov 07, 2011 at 11:29:41AM +0900, KAMEZAWA Hiroyuki wrote:
> On Wed, 2 Nov 2011 17:31:41 +0100
> Johannes Weiner <jweiner@...hat.com> wrote:
>
> > We want to prevent floods of used-once file cache pushing us to swap
> > out anonymous pages. Never swap under a certain priority level. The
> > availability of used-once cache pages should prevent us from reaching
> > that threshold.
> >
> > This is needed because subsequent patches will revert some of the
> > mechanisms that tried to prefer file over anon, and this should not
> > result in more eager swapping again.
> >
> > It might also be better to keep the aging machinery going and just not
> > swap, rather than staying away from anonymous pages in the first place
> > and having less useful age information at the time of swapout.
> >
> > Signed-off-by: Johannes Weiner <jweiner@...hat.com>
> > ---
> > mm/vmscan.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index a90c603..39d3da3 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -831,6 +831,8 @@ static unsigned long shrink_page_list(struct list_head *page_list,
> > * Try to allocate it some swap space here.
> > */
> > if (PageAnon(page) && !PageSwapCache(page)) {
> > + if (priority >= DEF_PRIORITY - 2)
> > + goto keep_locked;
> > if (!(sc->gfp_mask & __GFP_IO))
> > goto keep_locked;
> > if (!add_to_swap(page))
>
> Hm, how about not scanning LRU_ANON rather than checking here ?
> Add some bias to get_scan_count() or some..
> If you think to need rotation of LRU, only kswapd should do that..
Absolutely, it would require more tuning. This patch was really a
'hey, how about we do something like this? anyone tried that before?'
I keep those things in mind if I pursue this further, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists