From: Balbir Singh <balbir@in.ibm.com>
To: Peter Williams <pwil3058@bigpond.net.au>
Cc: Peter Williams <peterw@aurema.com>, Andrew Morton <akpm@osdl.org>,
dev@openvz.org, vatsa@in.ibm.com,
ckrm-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org,
bsingharora@gmail.com, efault@gmx.de, kernel@kolivas.org,
sam@vilain.net, kingsley@aurema.com, mingo@elte.hu,
rene.herman@keyaccess.nl
Subject: Re: [ckrm-tech] [PATCH 0/4] sched: Add CPU rate caps
Date: Mon, 19 Jun 2006 09:01:03 +0530 [thread overview]
Message-ID: <44961A77.800@in.ibm.com> (raw)
In-Reply-To: <44961758.6070305@bigpond.net.au>
Peter Williams wrote:
> Balbir Singh wrote:
>
>> Peter Williams wrote:
>>
<snip>
>> Is it possible that the effective tasks
>> is greater than the limit of the group?
>
>
> Yes.
>
>> How do we handle this scenario?
>
>
> You've got the problem back to front. If the number of effective tasks
> is less than the group limit then you have the situation that needs
> special handling (not the other way around). I.e. if the number of
> effective tasks is less than the group limit then (strictly speaking)
> there's no need to do any capping at all as the demand is less than the
> limit. However, in the case where the group limit is less than one CPU
> (i.e. less than 1000) the recommended thing to do would be set the limit
> of each task in the group to the group limit.
>
> Obviously, group limits can be greater than one CPU (i.e. 1000).
>
> The number of CPUs on the system also needs to be taken into account for
> group capping as if the group cap is greater than the number of CPUs
> there's no way it can be exceeded and tasks in this group would not need
> any processing.
>
What if we have a group limit of 100 (out of 1000) and 150 effective tasks in
the group? How do you calculate the cap of each task?
I hope my understanding of effective tasks is correct.
<snip>
>>>
>>> I should have elaborated here that (conceptually) modifying this code
>>> to apply caps to groups of tasks instead of individual tasks is
>>> simple. It mainly involves moving most the data (statistics plus cap
>>> values) to a group structure and then modifying the code to update
>>> statistics for the group instead of the task and then make the
>>> decisions about whether a task should have a cap enforced (i.e. moved
>>> to one of the soft cap priorities or sin binned) based on the group
>>> statistics.
>>>
>>> However, maintaining and accessing the group statistics will require
>>> additional locking as the run queue lock will no longer be able to
>>> protect the data as not all tasks in the group will be associated
>>> with the same CPU. Care will be needed to ensure that this new
>>> locking doesn't lead to dead locks with the run queue locks.
>>>
>>> In addition to the extra overhead caused by these locking
>>> requirements, the code for gathering the statistics will need to be
>>> more complex also adding to the overhead. There is also the issue of
>>> increased serialization (there is already some due to load balancing)
>>> of task scheduling to be considered although, to be fair, this
>>> increased serialization will be within groups.
>>>
>>>
>>
>> The f-series CPU controller does all of what you say in 403 lines
>> (including
>> comments and copyright). I think the biggest advantage of maintaining the
>> group statistics in the kernel is that certain scheduling decisions
>> can be
>> made based on group statistics rather than task statistics, which
>> makes the
>> mechanism independent of the number of tasks in the group (isolates the
>> groups from changes in number of tasks).
>
>
> Yes, that's one of its advantages. Both methods have advantages and
> disadvantages.
>
> Peter
--
Cheers,
Balbir Singh,
Linux Technology Center,
IBM Software Labs
next prev parent reply other threads:[~2006-06-19 3:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-18 8:26 [PATCH 0/4] sched: Add CPU rate caps Peter Williams
2006-06-18 8:26 ` [PATCH 1/4] sched: Add CPU rate soft caps Peter Williams
2006-06-18 8:38 ` Con Kolivas
2006-06-18 15:52 ` Peter Williams
2006-06-19 1:21 ` Peter Williams
2006-06-18 8:26 ` [PATCH 2/4] sched: Add CPU rate hard caps Peter Williams
2006-06-18 8:27 ` [PATCH 3/4] sched: Add procfs interface for CPU rate soft caps Peter Williams
2006-06-18 8:27 ` [PATCH 4/4] sched: Add procfs interface for CPU rate hard caps Peter Williams
2006-06-18 9:50 ` [PATCH 0/4] sched: Add CPU rate caps Andrew Morton
2006-06-18 10:25 ` Peter Williams
2006-06-18 11:42 ` Srivatsa Vaddagiri
2006-06-18 12:19 ` Peter Williams
2006-06-19 0:13 ` Balbir Singh
2006-06-19 1:03 ` [ckrm-tech] " Peter Williams
2006-06-19 2:20 ` Balbir Singh
2006-06-19 3:17 ` Peter Williams
2006-06-19 3:31 ` Balbir Singh [this message]
2006-06-19 3:50 ` Peter Williams
2006-06-19 8:30 ` Balbir Singh
2006-06-19 11:35 ` Peter Williams
2006-06-19 11:33 ` Balbir Singh
2006-06-19 23:09 ` Peter Williams
2006-06-20 4:28 ` Peter Williams
2006-06-20 4:40 ` Balbir Singh
2006-06-20 5:56 ` Peter Williams
2006-06-19 5:04 ` Peter Williams
2006-06-19 23:59 ` Peter Williams
2006-06-19 18:55 ` [ckrm-tech] " Chris Friesen
2006-06-19 23:28 ` Peter Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44961A77.800@in.ibm.com \
--to=balbir@in.ibm.com \
--cc=akpm@osdl.org \
--cc=bsingharora@gmail.com \
--cc=ckrm-tech@lists.sourceforge.net \
--cc=dev@openvz.org \
--cc=efault@gmx.de \
--cc=kernel@kolivas.org \
--cc=kingsley@aurema.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterw@aurema.com \
--cc=pwil3058@bigpond.net.au \
--cc=rene.herman@keyaccess.nl \
--cc=sam@vilain.net \
--cc=vatsa@in.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox