Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753764AbZI3M5S (ORCPT ); Wed, 30 Sep 2009 08:57:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752905AbZI3M5R (ORCPT ); Wed, 30 Sep 2009 08:57:17 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:44666 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752764AbZI3M5Q (ORCPT ); Wed, 30 Sep 2009 08:57:16 -0400 Date: Wed, 30 Sep 2009 18:25:40 +0530 From: Bharata B Rao To: linux-kernel@vger.kernel.org Cc: Dhaval Giani , Balbir Singh , Vaidyanathan Srinivasan , Gautham R Shenoy , Srivatsa Vaddagiri , Ingo Molnar , Peter Zijlstra , Pavel Emelyanov , Herbert Poetzl , Avi Kivity , Chris Friesen , Paul Menage , Mike Waychison Subject: [RFC v2 PATCH 8/8] sched: Hard limits documentation Message-ID: <20090930125540.GI19951@in.ibm.com> Reply-To: bharata@linux.vnet.ibm.com References: <20090930124919.GA19951@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090930124919.GA19951@in.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2784 Lines: 75 sched: Hard limits documentation From: Bharata B Rao Documentation for hard limits feature. Signed-off-by: Bharata B Rao --- Documentation/scheduler/sched-cfs-hard-limits.txt | 52 +++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) create mode 100644 Documentation/scheduler/sched-cfs-hard-limits.txt diff --git a/Documentation/scheduler/sched-cfs-hard-limits.txt b/Documentation/scheduler/sched-cfs-hard-limits.txt new file mode 100644 index 0000000..bf3859f --- /dev/null +++ b/Documentation/scheduler/sched-cfs-hard-limits.txt @@ -0,0 +1,52 @@ +CPU HARD LIMITS FOR CFS GROUPS +============================== + +1. Overview +2. Interface +3. Examples + +1. Overview +----------- + +CFS is a proportional share scheduler which tries to divide the CPU time +proportionately between tasks or groups of tasks (task group/cgroup) depending +on the priority/weight of the task or shares assigned to groups of tasks. +In CFS, a task/task group can get more than its share of CPU if there are +enough idle CPU cycles available in the system, due to the work conserving +nature of the scheduler. However in certain scenarios (like pay-per-use), +it is desirable not to provide extra time to a group even in the presence +of idle CPU cycles. This is where hard limiting can be of use. + +Hard limits for task groups can be set by specifying how much CPU runtime a +group can consume within a given period. If the group consumes more CPU time +than the runtime in a given period, it gets throttled. None of the tasks of +the throttled group gets to run until the runtime of the group gets refreshed +at the beginning of the next period. + +2. Interface +------------ + +Hard limit feature adds 3 cgroup files for CFS group scheduler: + +cfs_runtime_us: Hard limit for the group in microseconds. + +cfs_period_us: Time period in microseconds within which hard limits is +enforced. + +cfs_hard_limit: The control file to enable or disable hard limiting for the +group. + +A group gets created with default values for runtime and period and with +hard limit disabled. Each group can set its own values for runtime and period +independent of other groups in the system. + +3. Examples +----------- + +# mount -t cgroup -ocpu none /cgroups/ +# cd /cgroups +# mkdir 1 +# cd 1/ +# echo 250000 > cfs_runtime_us /* set a 250ms runtime or limit */ +# echo 500000 > cfs_period_us /* set a 500ms period */ +# echo 1 > cfs_hard_limit /* enable hard limiting for group 1/ */ -- 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/