From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754692Ab3EPWMK (ORCPT ); Thu, 16 May 2013 18:12:10 -0400 Received: from mail-qe0-f53.google.com ([209.85.128.53]:60281 "EHLO mail-qe0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097Ab3EPWMI (ORCPT ); Thu, 16 May 2013 18:12:08 -0400 Date: Thu, 16 May 2013 15:12:00 -0700 From: Tejun Heo To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Weiner , KAMEZAWA Hiroyuki , Ying Han , Hugh Dickins , Glauber Costa , Michel Lespinasse , Greg Thelen , Balbir Singh Subject: Re: [patch v3 -mm 1/3] memcg: integrate soft reclaim tighter with zone shrinking code Message-ID: <20130516221200.GF7171@mtj.dyndns.org> References: <1368431172-6844-1-git-send-email-mhocko@suse.cz> <1368431172-6844-2-git-send-email-mhocko@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1368431172-6844-2-git-send-email-mhocko@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry about the delay. Just getting back to memcg. On Mon, May 13, 2013 at 09:46:10AM +0200, Michal Hocko wrote: ... > during the first pass. Only groups which are over their soft limit or > any of their parents up the hierarchy is over the limit are considered ancestors? > +static void shrink_zone(struct zone *zone, struct scan_control *sc) > +{ > + bool do_soft_reclaim = mem_cgroup_should_soft_reclaim(sc); > + unsigned long nr_scanned = sc->nr_scanned; > + > + __shrink_zone(zone, sc, do_soft_reclaim); > + > + /* > + * No group is over the soft limit or those that are do not have > + * pages in the zone we are reclaiming so we have to reclaim everybody > + */ > + if (do_soft_reclaim && (sc->nr_scanned == nr_scanned)) { > + __shrink_zone(zone, sc, false); > + return; > + } > +} Maybe the following is easier to follow? if (mem_cgroup_should_soft_reclaim(sc)) { __shrink_zone(zone, sc, true); if (sc->nr_scanned == nr_scanned) __shrink_zone(zone, sc, false); } else { __shrink_zone(zone, sc, false); } But it's a minor point, please feel free to ignore. Reviewed-by: Tejun Heo Thanks. -- tejun From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx130.postini.com [74.125.245.130]) by kanga.kvack.org (Postfix) with SMTP id A9D266B0032 for ; Thu, 16 May 2013 18:12:08 -0400 (EDT) Received: by mail-qa0-f54.google.com with SMTP id hu16so28625qab.13 for ; Thu, 16 May 2013 15:12:07 -0700 (PDT) Date: Thu, 16 May 2013 15:12:00 -0700 From: Tejun Heo Subject: Re: [patch v3 -mm 1/3] memcg: integrate soft reclaim tighter with zone shrinking code Message-ID: <20130516221200.GF7171@mtj.dyndns.org> References: <1368431172-6844-1-git-send-email-mhocko@suse.cz> <1368431172-6844-2-git-send-email-mhocko@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1368431172-6844-2-git-send-email-mhocko@suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Weiner , KAMEZAWA Hiroyuki , Ying Han , Hugh Dickins , Glauber Costa , Michel Lespinasse , Greg Thelen , Balbir Singh Sorry about the delay. Just getting back to memcg. On Mon, May 13, 2013 at 09:46:10AM +0200, Michal Hocko wrote: ... > during the first pass. Only groups which are over their soft limit or > any of their parents up the hierarchy is over the limit are considered ancestors? > +static void shrink_zone(struct zone *zone, struct scan_control *sc) > +{ > + bool do_soft_reclaim = mem_cgroup_should_soft_reclaim(sc); > + unsigned long nr_scanned = sc->nr_scanned; > + > + __shrink_zone(zone, sc, do_soft_reclaim); > + > + /* > + * No group is over the soft limit or those that are do not have > + * pages in the zone we are reclaiming so we have to reclaim everybody > + */ > + if (do_soft_reclaim && (sc->nr_scanned == nr_scanned)) { > + __shrink_zone(zone, sc, false); > + return; > + } > +} Maybe the following is easier to follow? if (mem_cgroup_should_soft_reclaim(sc)) { __shrink_zone(zone, sc, true); if (sc->nr_scanned == nr_scanned) __shrink_zone(zone, sc, false); } else { __shrink_zone(zone, sc, false); } But it's a minor point, please feel free to ignore. Reviewed-by: Tejun Heo Thanks. -- tejun -- 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/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [patch v3 -mm 1/3] memcg: integrate soft reclaim tighter with zone shrinking code Date: Thu, 16 May 2013 15:12:00 -0700 Message-ID: <20130516221200.GF7171@mtj.dyndns.org> References: <1368431172-6844-1-git-send-email-mhocko@suse.cz> <1368431172-6844-2-git-send-email-mhocko@suse.cz> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=a57u+pV2kYOYAZWOjWXc/D0kmVfQszNo3FuIaDjM9u8=; b=S2ME946ROFyUflKLfc0tkQWAhF21NbstmBEP28YqEv9aiLu3+LqD61LRRfSrJSuMNb xFDJgAG/Ryqj9OzSTMberjWjL7jG0dyXjo2c4G6GcTd/Ixz6mo7YkXlQkU2TuXsGGnKl ZY2BOYmQ9746CpaLrsmOqUqSFJ4vrsW69ysYVDWz7gforxJ1WdYcipwhz9Kg0ubxQMpM KM3gi/cbD3G/uhT+/PX0/uLbvvVRV+SKDplyijNQlECeS+liTDYmGc7R0+mmQ/W6YvaL fyFGmxrlz5IPQYWbFU9lxkLEQQSvPVRveUYBPNGr4tfgZk2AZC0IFNOp1ytxFrQm8vAE 1RWA== Content-Disposition: inline In-Reply-To: <1368431172-6844-2-git-send-email-mhocko-AlSwsSmVLrQ@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michal Hocko Cc: Andrew Morton , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Johannes Weiner , KAMEZAWA Hiroyuki , Ying Han , Hugh Dickins , Glauber Costa , Michel Lespinasse , Greg Thelen , Balbir Singh Sorry about the delay. Just getting back to memcg. On Mon, May 13, 2013 at 09:46:10AM +0200, Michal Hocko wrote: ... > during the first pass. Only groups which are over their soft limit or > any of their parents up the hierarchy is over the limit are considered ancestors? > +static void shrink_zone(struct zone *zone, struct scan_control *sc) > +{ > + bool do_soft_reclaim = mem_cgroup_should_soft_reclaim(sc); > + unsigned long nr_scanned = sc->nr_scanned; > + > + __shrink_zone(zone, sc, do_soft_reclaim); > + > + /* > + * No group is over the soft limit or those that are do not have > + * pages in the zone we are reclaiming so we have to reclaim everybody > + */ > + if (do_soft_reclaim && (sc->nr_scanned == nr_scanned)) { > + __shrink_zone(zone, sc, false); > + return; > + } > +} Maybe the following is easier to follow? if (mem_cgroup_should_soft_reclaim(sc)) { __shrink_zone(zone, sc, true); if (sc->nr_scanned == nr_scanned) __shrink_zone(zone, sc, false); } else { __shrink_zone(zone, sc, false); } But it's a minor point, please feel free to ignore. Reviewed-by: Tejun Heo Thanks. -- tejun