From mboxrd@z Thu Jan 1 00:00:00 1970 From: Balbir Singh Subject: Re: [-mm PATCH 8/9] Memory controller add switch to control what type of pages to limit (v4) Date: Mon, 13 Aug 2007 11:08:58 +0530 Message-ID: <46BFEE72.9080209@linux.vnet.ibm.com> References: <20070727201103.31565.3104.sendpatchset@balbir-laptop> <20070813003348.91E3E1BF943@siro.lan> Reply-To: balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20070813003348.91E3E1BF943-Pcsii4f/SVk@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: YAMAMOTO Takashi Cc: a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, dhaval-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org List-Id: containers.vger.kernel.org YAMAMOTO Takashi wrote: >> Choose if we want cached pages to be accounted or not. By default both >> are accounted for. A new set of tunables are added. >> >> echo -n 1 > mem_control_type >> >> switches the accounting to account for only mapped pages >> >> echo -n 2 > mem_control_type >> >> switches the behaviour back > > MEM_CONTAINER_TYPE_ALL is 3, not 2. > Thanks, I'll fix the comment on the top. > YAMAMOTO Takashi > >> +enum { >> + MEM_CONTAINER_TYPE_UNSPEC = 0, >> + MEM_CONTAINER_TYPE_MAPPED, >> + MEM_CONTAINER_TYPE_CACHED, >> + MEM_CONTAINER_TYPE_ALL, >> + MEM_CONTAINER_TYPE_MAX, >> +} mem_control_type; >> + >> +static struct mem_container init_mem_container; > >> + mem = rcu_dereference(mm->mem_container); >> + if (mem->control_type == MEM_CONTAINER_TYPE_ALL) >> + return mem_container_charge(page, mm); >> + else >> + return 0; -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S945417AbXHMMfa (ORCPT ); Mon, 13 Aug 2007 08:35:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932194AbXHMHDq (ORCPT ); Mon, 13 Aug 2007 03:03:46 -0400 Received: from ausmtp04.au.ibm.com ([202.81.18.152]:60900 "EHLO ausmtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933460AbXHMHDn (ORCPT ); Mon, 13 Aug 2007 03:03:43 -0400 Message-ID: <46BFEE72.9080209@linux.vnet.ibm.com> Date: Mon, 13 Aug 2007 11:08:58 +0530 From: Balbir Singh Reply-To: balbir@linux.vnet.ibm.com Organization: IBM User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: YAMAMOTO Takashi CC: akpm@linux-foundation.org, a.p.zijlstra@chello.nl, dhaval@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ebiederm@xmission.com, containers@lists.osdl.org, menage@google.com, xemul@openvz.org Subject: Re: [-mm PATCH 8/9] Memory controller add switch to control what type of pages to limit (v4) References: <20070727201103.31565.3104.sendpatchset@balbir-laptop> <20070813003348.91E3E1BF943@siro.lan> In-Reply-To: <20070813003348.91E3E1BF943@siro.lan> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org YAMAMOTO Takashi wrote: >> Choose if we want cached pages to be accounted or not. By default both >> are accounted for. A new set of tunables are added. >> >> echo -n 1 > mem_control_type >> >> switches the accounting to account for only mapped pages >> >> echo -n 2 > mem_control_type >> >> switches the behaviour back > > MEM_CONTAINER_TYPE_ALL is 3, not 2. > Thanks, I'll fix the comment on the top. > YAMAMOTO Takashi > >> +enum { >> + MEM_CONTAINER_TYPE_UNSPEC = 0, >> + MEM_CONTAINER_TYPE_MAPPED, >> + MEM_CONTAINER_TYPE_CACHED, >> + MEM_CONTAINER_TYPE_ALL, >> + MEM_CONTAINER_TYPE_MAX, >> +} mem_control_type; >> + >> +static struct mem_container init_mem_container; > >> + mem = rcu_dereference(mm->mem_container); >> + if (mem->control_type == MEM_CONTAINER_TYPE_ALL) >> + return mem_container_charge(page, mm); >> + else >> + return 0; -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.18.234]) by ausmtp04.au.ibm.com (8.13.8/8.13.8) with ESMTP id l7D5i7l1232138 for ; Mon, 13 Aug 2007 15:44:07 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l7D5dT773407890 for ; Mon, 13 Aug 2007 15:39:29 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l7D5dSVT016684 for ; Mon, 13 Aug 2007 15:39:29 +1000 Message-ID: <46BFEE72.9080209@linux.vnet.ibm.com> Date: Mon, 13 Aug 2007 11:08:58 +0530 From: Balbir Singh Reply-To: balbir@linux.vnet.ibm.com MIME-Version: 1.0 Subject: Re: [-mm PATCH 8/9] Memory controller add switch to control what type of pages to limit (v4) References: <20070727201103.31565.3104.sendpatchset@balbir-laptop> <20070813003348.91E3E1BF943@siro.lan> In-Reply-To: <20070813003348.91E3E1BF943@siro.lan> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: YAMAMOTO Takashi Cc: akpm@linux-foundation.org, a.p.zijlstra@chello.nl, dhaval@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ebiederm@xmission.com, containers@lists.osdl.org, menage@google.com, xemul@openvz.org List-ID: YAMAMOTO Takashi wrote: >> Choose if we want cached pages to be accounted or not. By default both >> are accounted for. A new set of tunables are added. >> >> echo -n 1 > mem_control_type >> >> switches the accounting to account for only mapped pages >> >> echo -n 2 > mem_control_type >> >> switches the behaviour back > > MEM_CONTAINER_TYPE_ALL is 3, not 2. > Thanks, I'll fix the comment on the top. > YAMAMOTO Takashi > >> +enum { >> + MEM_CONTAINER_TYPE_UNSPEC = 0, >> + MEM_CONTAINER_TYPE_MAPPED, >> + MEM_CONTAINER_TYPE_CACHED, >> + MEM_CONTAINER_TYPE_ALL, >> + MEM_CONTAINER_TYPE_MAX, >> +} mem_control_type; >> + >> +static struct mem_container init_mem_container; > >> + mem = rcu_dereference(mm->mem_container); >> + if (mem->control_type == MEM_CONTAINER_TYPE_ALL) >> + return mem_container_charge(page, mm); >> + else >> + return 0; -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL -- 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