Hi Paul,

Thanks for the patch. 

I agree with the general approach. But, there are some implementation
issues.

Please see below.

chandra
On Mon, 2005-09-12 at 10:31 -0700, Paul Menage wrote:
<..snip..>

>diff -X /home/menage/dontdiff -
uprN ../kernel9/2.6/kernel/ckrm/ckrm_tc.c 2.6/kernel/ckrm/ckrm_tc.c
>--- ../kernel9/2.6/kernel/ckrm/ckrm_tc.c       2005-09-09 21:10:45.000000000
-0700
>+++ 2.6/kernel/ckrm/ckrm_tc.c  2005-09-12 09:54:16.000000000 -0700
>@@ -174,6 +174,17 @@ ckrm_set_taskclass(struct task_struct *t
>       }
>       /* put into new class */
>       class_lock(class_core(newcls));
>+      while (class_core(newcls)->dead) {
>+              /* If this class is dead, we need to move up the hierarchy */
>+              struct ckrm_core_class *parent;
>+              parent = class_core(newcls)->hnode.parent;
>+              ckrm_core_grab(parent);
>+              class_unlock(class_core(newcls));
>+                printk(KERN_INFO "Redirecting task: %s -> %s\n",
class_core(newcls)->name, parent->name);
>+              ckrm_core_drop(class_core(newcls));
>+              class_lock(parent);
>+              newcls = class_type(struct ckrm_task_class, parent);
>+      }

I do not understand what this section of code is doing.

Also, how is the control getting out of the while loop ?

Any logic to use a different newcls should be placed before the block of
code
that sets the task class(not after).

>       tsk->taskclass = newcls;
>       list_add(&tsk->taskclass_link, &class_core(newcls)->objlist);
>       class_unlock(class_core(newcls));
>@@ -608,6 +619,10 @@ static int ckrm_free_task_class(struct c
> 
>       pr_debug("%p:%s:%d\n", core, core->name, atomic_read(&core->refcnt));
> 
>+      class_lock(core);
>+      core->dead = 1;
>+      class_unlock(core);
>+

I would set the dead flag in ckrm.c:ckrm_release_core_class(), than in
task class specific code.

>       taskcls = class_type(struct ckrm_task_class, core);
> 
>       ce_protect(&ct_taskclass);



----------------------------------------------------------------------
    Chandra Seetharaman               | Be careful what you choose....
              - [EMAIL PROTECTED]   |      .......you may get it.
----------------------------------------------------------------------




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to