From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by kanga.kvack.org (Postfix) with ESMTP id 7A1BB6B00EE for ; Wed, 31 Aug 2011 06:13:36 -0400 (EDT) Received: by yib2 with SMTP id 2so488691yib.14 for ; Wed, 31 Aug 2011 03:13:34 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20110831090850.GA27345@redhat.com> References: <20110831090850.GA27345@redhat.com> Date: Wed, 31 Aug 2011 19:13:34 +0900 Message-ID: Subject: Re: [patch] memcg: skip scanning active lists based on individual size From: Minchan Kim Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Andrew Morton , Rik van Riel , KOSAKI Motohiro , KAMEZAWA Hiroyuki , Daisuke Nishimura , Balbir Singh , linux-mm@kvack.org, linux-kernel@vger.kernel.org On Wed, Aug 31, 2011 at 6:08 PM, Johannes Weiner wrote: > Reclaim decides to skip scanning an active list when the corresponding > inactive list is above a certain size in comparison to leave the > assumed working set alone while there are still enough reclaim > candidates around. > > The memcg implementation of comparing those lists instead reports > whether the whole memcg is low on the requested type of inactive > pages, considering all nodes and zones. > > This can lead to an oversized active list not being scanned because of > the state of the other lists in the memcg, as well as an active list > being scanned while its corresponding inactive list has enough pages. > > Not only is this wrong, it's also a scalability hazard, because the > global memory state over all nodes and zones has to be gathered for > each memcg and zone scanned. > > Make these calculations purely based on the size of the two LRU lists > that are actually affected by the outcome of the decision. > > Signed-off-by: Johannes Weiner > Cc: Rik van Riel > Cc: KOSAKI Motohiro > Cc: KAMEZAWA Hiroyuki > Cc: Daisuke Nishimura > Cc: Balbir Singh Reviewed-by: Minchan Kim I can't understand why memcg is designed for considering all nodes and zones. Is it a mistake or on purpose? Maybe Kame or Balbir can answer it. Anyway, this change does make sense to me. Nitpick: Please remove inactive_ratio in Documentation/cgroups/memory.txt. I think it would be better to separate it into another patch. -- Kind regards, Minchan Kim -- 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