Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752709AbYKMBPr (ORCPT ); Wed, 12 Nov 2008 20:15:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751544AbYKMBPj (ORCPT ); Wed, 12 Nov 2008 20:15:39 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:43826 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbYKMBPj (ORCPT ); Wed, 12 Nov 2008 20:15:39 -0500 Date: Thu, 13 Nov 2008 10:13:44 +0900 From: KAMEZAWA Hiroyuki To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, balbir@linux.vnet.ibm.com, nishimura@mxp.nes.nec.co.jp, menage@google.com Subject: Re: [RFC][PATCH 1/6] memcg: free all at rmdir Message-Id: <20081113101344.6882c209.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20081112160758.3dca0b22.akpm@linux-foundation.org> References: <20081112122606.76051530.kamezawa.hiroyu@jp.fujitsu.com> <20081112122656.c6e56248.kamezawa.hiroyu@jp.fujitsu.com> <20081112160758.3dca0b22.akpm@linux-foundation.org> Organization: FUJITSU Co. LTD. X-Mailer: Sylpheed 2.5.0 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1954 Lines: 61 On Wed, 12 Nov 2008 16:07:58 -0800 Andrew Morton wrote: > On Wed, 12 Nov 2008 12:26:56 +0900 > KAMEZAWA Hiroyuki wrote: > > > +5.1 on_rmdir > > +set behavior of memcg at rmdir (Removing cgroup) default is "drop". > > + > > +5.1.1 drop > > + #echo on_rmdir drop > memory.attribute > > + This is default. All pages on the memcg will be freed. > > + If pages are locked or too busy, they will be moved up to the parent. > > + Useful when you want to drop (large) page caches used in this memcg. > > + But some of in-use page cache can be dropped by this. > > + > > +5.1.2 keep > > + #echo on_rmdir keep > memory.attribute > > + All pages on the memcg will be moved to its parent. > > + Useful when you don't want to drop page caches used in this memcg. > > + You can keep page caches from some library or DB accessed by this > > + memcg on memory. > > Would it not be more useful to implement a per-memcg version of > /proc/sys/vm/drop_caches? (One without drop_caches' locking bug, > hopefully). > > If we do this then we can make the above "keep" behaviour non-optional, > and the operator gets to choose whether or not to drop the caches > before doing the rmdir. > > Plus, we get a new per-memcg drop_caches capability. And it's a nicer > interface, and it doesn't have the obvious races which on_rmdir has, > etc. > > hm? > In my plan, I'll add memory.shrink_usage interface to do and allows #echo 0M > memory.shrink_memory_usage (you may swap tasks out if there is task..) to drop pages. Balbir, how do you think ? I've already removed "force_empty". Thanks, -Kame -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/