From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with ESMTP id 2D1E5900001 for ; Thu, 28 Apr 2011 19:25:47 -0400 (EDT) Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id p3SNPjOW024356 for ; Thu, 28 Apr 2011 16:25:45 -0700 Received: from qyk10 (qyk10.prod.google.com [10.241.83.138]) by wpaz37.hot.corp.google.com with ESMTP id p3SNOKAx017805 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 28 Apr 2011 16:25:44 -0700 Received: by qyk10 with SMTP id 10so2463567qyk.18 for ; Thu, 28 Apr 2011 16:25:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1304030226-19332-2-git-send-email-yinghan@google.com> References: <1304030226-19332-1-git-send-email-yinghan@google.com> <1304030226-19332-2-git-send-email-yinghan@google.com> Date: Thu, 28 Apr 2011 16:25:44 -0700 Message-ID: Subject: Re: [PATCH 1/2] Add the soft_limit reclaim in global direct reclaim. From: Ying Han Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: KOSAKI Motohiro , Minchan Kim , Daisuke Nishimura , Balbir Singh , Tejun Heo , Pavel Emelyanov , KAMEZAWA Hiroyuki , Andrew Morton , Li Zefan , Mel Gorman , Christoph Lameter , Johannes Weiner , Rik van Riel , Hugh Dickins , Michal Hocko , Dave Hansen , Zhu Yanhai , kamezawa.hiroyuki@gmail.com Cc: linux-mm@kvack.org On Thu, Apr 28, 2011 at 3:37 PM, Ying Han wrote: > We recently added the change in global background reclaim which > counts the return value of soft_limit reclaim. Now this patch adds > the similar logic on global direct reclaim. > > We should skip scanning global LRU on shrink_zone if soft_limit reclaim > does enough work. This is the first step where we start with counting > the nr_scanned and nr_reclaimed from soft_limit reclaim into global > scan_control. > > Signed-off-by: Ying Han > --- > =A0mm/vmscan.c | =A0 16 ++++++++++++++-- > =A01 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index b3a569f..84003cc 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1959,11 +1959,14 @@ restart: > =A0* If a zone is deemed to be full of pinned pages then just give it a l= ight > =A0* scan then give up on it. > =A0*/ > -static void shrink_zones(int priority, struct zonelist *zonelist, > +static unsigned long shrink_zones(int priority, struct zonelist *zonelis= t, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0struct scan_control *sc) > =A0{ > =A0 =A0 =A0 =A0struct zoneref *z; > =A0 =A0 =A0 =A0struct zone *zone; > + =A0 =A0 =A0 unsigned long nr_soft_reclaimed; > + =A0 =A0 =A0 unsigned long nr_soft_scanned; > + =A0 =A0 =A0 unsigned long total_scanned =3D 0; > > =A0 =A0 =A0 =A0for_each_zone_zonelist_nodemask(zone, z, zonelist, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0gfp_zone(sc->gfp_mask), sc->nodemask) { > @@ -1980,8 +1983,17 @@ static void shrink_zones(int priority, struct zone= list *zonelist, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue; = =A0 =A0 =A0 /* Let kswapd poll it */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr_soft_scanned =3D 0; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr_soft_reclaimed =3D mem_cgroup_soft_limit= _reclaim(zone, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->order, sc->gfp_mask, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &nr_soft_scanned); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 sc->nr_reclaimed +=3D nr_soft_reclaimed; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 total_scanned +=3D nr_soft_scanned; > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0shrink_zone(priority, zone, sc); > =A0 =A0 =A0 =A0} > + > + =A0 =A0 =A0 return total_scanned; > =A0} > > =A0static bool zone_reclaimable(struct zone *zone) > @@ -2045,7 +2057,7 @@ static unsigned long do_try_to_free_pages(struct zo= nelist *zonelist, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sc->nr_scanned =3D 0; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!priority) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0disable_swap_token(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 shrink_zones(priority, zonelist, sc); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 total_scanned +=3D shrink_zones(priority, z= onelist, sc); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * Don't shrink slabs when reclaiming memo= ry from > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * over limit cgroups > -- > 1.7.3.1 > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org