On Thu, 2005-02-24 at 01:34 -0800, Gerrit Huizenga wrote:
> This patch provides a resource controller for limiting the number
> of tasks per class in CKRM.

It takes 627 lines of code to count the number of tasks in a class?
What does all of that infrastructure buy you, again?

All of the logic to borrow if you've gone over your limit should be a
quite repeated theme throughout all of the controllers.  Seems to me
that at least a larger chunk of that should be in generic code.  

> +static void numtasks_res_free(void *my_res)
> +{
...
> +       if (unlikely(atomic_read(&res->cnt_cur_alloc) < 0)) {
> +               printk(KERN_WARNING "numtasks_res: counter below 0
> \n");
> +       }
> +       if (unlikely(atomic_read(&res->cnt_cur_alloc) > 0 ||
> +                               atomic_read(&res->cnt_borrowed) > 0)) 

How often is this called?  Do you really need unlikely()?

-- Dave



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to