From mboxrd@z Thu Jan 1 00:00:00 1970 From: jacob pan Subject: Re: [PATCH 1/1, v6] cgroup/freezer: add per freezer duty ratio control Date: Wed, 9 Feb 2011 10:16:31 -0800 Message-ID: <20110209101631.5f265687__7104.54014265469$1297275540$gmane$org@jacob-laptop> References: <1297213541-18156-1-git-send-email-jacob.jun.pan@linux.intel.com> <4D52050F.3060907@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4D52050F.3060907-BthXqXjhjHXQFUHtdCDX3A@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: Li Zefan Cc: container cgroup , LKML , rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org, Cedric Le Goater , Paul Menage , Arjan van de Ven , akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org List-Id: containers.vger.kernel.org On Wed, 09 Feb 2011 11:07:59 +0800 Li Zefan wrote: > jacob.jun.pan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org wrote: > > From: Jacob Pan > > > > Freezer subsystem is used to manage batch jobs which can start > > stop at the same time. However, sometime it is desirable to let > > the kernel manage the freezer state automatically with a given > > duty ratio. > > For example, if we want to reduce the time that backgroup apps > > are allowed to run we can put them into a freezer subsystem and > > set the kernel to turn them THAWED/FROZEN at given duty ratio. > > > > This patch introduces two file nodes under cgroup > > freezer.duty_ratio_pct and freezer.period_sec > > > > Usage example: set period to be 5 seconds and frozen duty ratio 90% > > [root@localhost aoa]# echo 90 > freezer.duty_ratio_pct > > [root@localhost aoa]# echo 5000 > freezer.period_ms > > > > So after: > > # echo FROZEN > freezer.state > # echo 90 > freezer.duty_ratio_pct > # echo 5000 > freezer.period_ms > ... > # echo 0 > freezer.duty_ratio_pct > > All the tasks in this cgroup are in THAWED state, but the cgroup is > in FROZEN state. This should be fixed. I don't know how could this ever happen. Is it based on your testing? Whenever tasks in a cgroup are thawed/frozen, its freezer state would change accordingly. After your example, freezer.state should have THAWED. It matches user's intention, i.e. if a user do echo 0 > freezer.duty_ratio_pct It must want 0% to be frozen, which is THAWED. Am I missing anything?