From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755899Ab2BUThm (ORCPT ); Tue, 21 Feb 2012 14:37:42 -0500 Received: from mail-pw0-f46.google.com ([209.85.160.46]:33256 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755819Ab2BUThe (ORCPT ); Tue, 21 Feb 2012 14:37:34 -0500 Authentication-Results: mr.google.com; spf=pass (google.com: domain of hughd@google.com designates 10.68.130.233 as permitted sender) smtp.mail=hughd@google.com; dkim=pass header.i=hughd@google.com Date: Tue, 21 Feb 2012 11:37:01 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Konstantin Khlebnikov cc: Andrew Morton , KAMEZAWA Hiroyuki , Johannes Weiner , Ying Han , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 6/10] mm/memcg: take care over pc->mem_cgroup In-Reply-To: <4F4331BC.70205@openvz.org> Message-ID: References: <4F4331BC.70205@openvz.org> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Feb 2012, Konstantin Khlebnikov wrote: > > But just one question: how appears uncharged pages in mem-cg lru lists? One way is swapin readahead pages, which cannot be charged to a memcg until they're "claimed"; but we do need them visible on lru, otherwise memory pressure couldn't reclaim them when necessary. Another way is simply that uncharging has not historically removed the page from lru list if it's on. I usually assume that's an optimization: why bother to get lru locks and take it off (and put it on the root lru? if we don't, we're assuming it's will be freed very shortly - I'm not sure that's always a good assumption), if freeing the page will usually do that for us (without having to change lrus). If I thought for longer, I might come up with other scenarios. > Maybe we can forbid this case and uncharge these pages right in > __page_cache_release() and release_pages() at final removing from LRU. > This is how my old mem-controller works. There pages in lru are always > charged. As things stand, that would mean lock_page_cgroup() has to disable irqs everywhere. I'm not sure of the further ramifications of moving uncharge to __page_cache_release() and release_pages(). I don't think a change like that is out of the question, but it's certainly a bigger change than I'd like to consider in this series. Hugh