Andrew Morton wrote:
On Sun, 18 Jun 2006 18:26:38 +1000
Peter Williams <pwil3058@xxxxxxxxxxxxxx> wrote:
People are going to want to extend this to capping a *group* of tasks, with
some yet-to-be-determined means of tying those tasks together. How well
suited is this code to that extension?
Quite good. It can be used from outside the scheduler to impose caps on arbitrary groups of tasks. Were the PAGG interface available I could knock up a module to demonstrate this. When/if the "task watchers" patch is included I will try and implement a higher level mechanism using that. The general technique is to get an estimate of the "effective number" of tasks in the group (similar to load) and give each task in the group a cap which is the group's cap divided by the effective number of tasks (or the group cap whichever is smaller -- i.e. the effective number of tasks could be less than one).
)
Doing it inside the scheduler is also doable but would have some locking issues. The run queue lock could no longer be used to protect the data as there's no guarantee that all the tasks in the group are associated with the same queue.
If the task can exceed its cap without impacting any other tasks (ie: there
is spare idle capacity), what happens?
That's the difference between soft and hard caps. If it's a soft cap then the task is allowed to exceed it if there's spare capacity. If it's a hard cap it's not.
I trust that spare capacity gets
used? (Is this termed "work conserving"?)
Soft caps, yes. Hard caps, no.