Rule-based Classification Engine for CKRM

RBCE allows privileged users control over the classification of tasks into classes and also provides an API for setting class shares and getting class usage. RBCE has three major entities:
  1. RBCE Class : Represents a user-defined grouping of tasks. The kernel representation of RBCE classes points to per-resource class objects, one each for cpu, mem, io and net, that are instantiated by the respective resource controller, if present. Hence the RBCE class is distinct from the per-resource classes and corresponds to the user's grouping of tasks.
  2. Rules : Consists of a list of task struct fields and an associated RBCE class. If the corresponding fields of a task's task_struct match those in the rule, the task is put in the RBCE class specified by the rule. Classification is triggered whenever elements of the task_struct change e.g. at task creation, uid/gid/euid/egid change, task exit etc.

    A rule is a logical AND of rule terms. Each rule term contains the value of a task_struct field or the id of a previously defined rule. The latter can be used to link rules together.e.g.

    R1 := (uid == 1234) -> C0


    is a rule that puts a task in class C0 if its uid equals 1234.

    R2 := R1 AND (cmd == "*gcc*") -> C1


    is a rule which puts a task in class C1 if its uid == 1234 and commandline contains the word gcc.
    Some tasks will match R1 alone and some will match R2 (and hence R1 too). To ensure that the latter get classified in C1, rules are evaluated in the order "specific to generic". However, the specification of the rules is in the reverse order "generic to specific" as seen for R1 and R2 above.

  3. Policies : A group of RBCE classes and associated rules. Only one policy is in effect at a given time. New policies can be created (while the old one is active) with RBCE classes and rules being added individually. When a complete policy has been created, it is committed and replaces the old policy in the kernel module. All tasks in the system are reclassified on a new policy commit.

    Policies can be of two types : MONITOR and MANAGE. The former is a monitor only mode of operation where classification is done only to measure resource consumption by class. The MANAGE mode additionally allows shares to be specified and enforced by the individual resource controllers. MONITOR type policies are not currently supported.

    The user's view of RBCE is contained in rbce.h and rbcelib.c and consists of the following API :

    rbce_open : opens a pseudo device
    rbce_close

    rbce_create_policy
    rbce_commit_policy
    rbce_decommit_policy
    rbce_delete_policy
    rbce_set/get_policy_type : only RBCE_POLICY_MANAGE type is currently implemented.

    rbce_create_class
    rbce_delete_class
    rbce_get_resource_usage : get resource usage since last call to the same function. Not implemented currently.
    rbce_get_cum_resource_usage : get resource usage since policy commit. Not implemented currently

    rbce_create_rule
    rbce_delete_rule


29 Aug 2003

SourceForge.net Logo