[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090401040951.GA1548@cmpxchg.org>
Date: Wed, 1 Apr 2009 06:09:51 +0200
From: Johannes Weiner <hannes@...xchg.org>
To: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Minchan Kim <minchan.kim@...il.com>,
Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
"Rafael J. Wysocki" <rjw@...k.pl>, Rik van Riel <riel@...hat.com>,
Balbir Singh <balbir@...ibm.com>
Subject: Re: [PATCH] vmscan: memcg needs may_swap (Re: [patch] vmscan: rename sc.may_swap to may_unmap)
On Tue, Mar 31, 2009 at 10:48:32AM +0900, KOSAKI Motohiro wrote:
> > > Sorry for too late response.
> > > I don't know memcg well.
> > >
> > > The memcg managed to use may_swap well with global page reclaim until now.
> > > I think that was because may_swap can represent both meaning.
> > > Do we need each variables really ?
> > >
> > > How about using union variable ?
> >
> > or Just removing one of them ?
>
> I hope all may_unmap user convert to using may_swap.
> may_swap is more efficient and cleaner meaning.
How about making may_swap mean the following:
@@ -642,6 +639,8 @@ static unsigned long shrink_page_list(st
* Try to allocate it some swap space here.
*/
if (PageAnon(page) && !PageSwapCache(page)) {
+ if (!sc->map_swap)
+ goto keep_locked;
if (!(sc->gfp_mask & __GFP_IO))
goto keep_locked;
if (!add_to_swap(page))
try_to_free_pages() always sets it.
try_to_free_mem_cgroup_pages() sets it depending on whether it really
wants swapping, and only swapping, right? But the above would still
reclaim already swapped anon pages and I don't know the memory
controller.
balance_pgdat() always sets it.
__zone_reclaim() sets it depending on zone_reclaim_mode. The
RECLAIM_SWAP bit of this field and its documentation in
Documentation/sysctl/vm.txt suggests it also really only means swap.
shrink_all_memory() would be the sole user of may_unmap because it
really wants to eat cache first. But this could be figured out on a
different occasion.
Hannes
--
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