From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932514Ab3EOIlZ (ORCPT ); Wed, 15 May 2013 04:41:25 -0400 Received: from mx2.parallels.com ([199.115.105.18]:38105 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932478Ab3EOIlX (ORCPT ); Wed, 15 May 2013 04:41:23 -0400 Message-ID: <51934A62.2030606@parallels.com> Date: Wed, 15 May 2013 12:42:10 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 To: Michal Hocko CC: Andrew Morton , , , , Johannes Weiner , KAMEZAWA Hiroyuki , Ying Han , Hugh Dickins , Michel Lespinasse , Greg Thelen , Tejun Heo , Balbir Singh Subject: Re: [patch v3 -mm 3/3] vmscan, memcg: Do softlimit reclaim also for targeted reclaim References: <1368431172-6844-1-git-send-email-mhocko@suse.cz> <1368431172-6844-4-git-send-email-mhocko@suse.cz> In-Reply-To: <1368431172-6844-4-git-send-email-mhocko@suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/13/2013 11:46 AM, Michal Hocko wrote: > Soft reclaim has been done only for the global reclaim (both background > and direct). Since "memcg: integrate soft reclaim tighter with zone > shrinking code" there is no reason for this limitation anymore as the > soft limit reclaim doesn't use any special code paths and it is a > part of the zone shrinking code which is used by both global and > targeted reclaims. > > From semantic point of view it is even natural to consider soft limit > before touching all groups in the hierarchy tree which is touching the > hard limit because soft limit tells us where to push back when there is > a memory pressure. It is not important whether the pressure comes from > the limit or imbalanced zones. > > This patch simply enables soft reclaim unconditionally in > mem_cgroup_should_soft_reclaim so it is enabled for both global and > targeted reclaim paths. mem_cgroup_soft_reclaim_eligible needs to learn > about the root of the reclaim to know where to stop checking soft limit > state of parents up the hierarchy. > Say we have > A (over soft limit) > \ > B (below s.l., hit the hard limit) > / \ > C D (below s.l.) > > B is the source of the outside memory pressure now for D but we > shouldn't soft reclaim it because it is behaving well under B subtree > and we can still reclaim from C (pressumably it is over the limit). > mem_cgroup_soft_reclaim_eligible should therefore stop climbing up the > hierarchy at B (root of the memory pressure). > > Changes since v1 > - add sc->target_mem_cgroup handling into mem_cgroup_soft_reclaim_eligible > > Signed-off-by: Michal Hocko > --- Reviewed-by: Glauber Costa From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [patch v3 -mm 3/3] vmscan, memcg: Do softlimit reclaim also for targeted reclaim Date: Wed, 15 May 2013 12:42:10 +0400 Message-ID: <51934A62.2030606@parallels.com> References: <1368431172-6844-1-git-send-email-mhocko@suse.cz> <1368431172-6844-4-git-send-email-mhocko@suse.cz> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1368431172-6844-4-git-send-email-mhocko@suse.cz> Sender: owner-linux-mm@kvack.org List-ID: Content-Type: text/plain; charset="us-ascii" 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 , Michel Lespinasse , Greg Thelen , Tejun Heo , Balbir Singh On 05/13/2013 11:46 AM, Michal Hocko wrote: > Soft reclaim has been done only for the global reclaim (both background > and direct). Since "memcg: integrate soft reclaim tighter with zone > shrinking code" there is no reason for this limitation anymore as the > soft limit reclaim doesn't use any special code paths and it is a > part of the zone shrinking code which is used by both global and > targeted reclaims. > > From semantic point of view it is even natural to consider soft limit > before touching all groups in the hierarchy tree which is touching the > hard limit because soft limit tells us where to push back when there is > a memory pressure. It is not important whether the pressure comes from > the limit or imbalanced zones. > > This patch simply enables soft reclaim unconditionally in > mem_cgroup_should_soft_reclaim so it is enabled for both global and > targeted reclaim paths. mem_cgroup_soft_reclaim_eligible needs to learn > about the root of the reclaim to know where to stop checking soft limit > state of parents up the hierarchy. > Say we have > A (over soft limit) > \ > B (below s.l., hit the hard limit) > / \ > C D (below s.l.) > > B is the source of the outside memory pressure now for D but we > shouldn't soft reclaim it because it is behaving well under B subtree > and we can still reclaim from C (pressumably it is over the limit). > mem_cgroup_soft_reclaim_eligible should therefore stop climbing up the > hierarchy at B (root of the memory pressure). > > Changes since v1 > - add sc->target_mem_cgroup handling into mem_cgroup_soft_reclaim_eligible > > Signed-off-by: Michal Hocko > --- Reviewed-by: Glauber Costa -- 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