Re: [ckrm-tech] [PATCH 1/2] add a CPU resource controller

From: KUROSAWA Takahiro
Date: Mon Feb 13 2006 - 18:53:25 EST


On Mon, 13 Feb 2006 20:03:45 +0530
Srivatsa Vaddagiri <vatsa@xxxxxxxxxx> wrote:

> > +void cpu_rc_collect_hunger(task_t *tsk)
> > +{
>
> [snip]
>
> > + if (CPU_RC_GUAR_SCALE * tsk->last_slice / (wait + tsk->last_slice)
> > + < cr->guarantee / cr->rcd->numcpus)
> ^^^^^^^^^^^^^^^^^^
>
> Debugging it a bit indicated that the division of cr->guarantee by
> cr->rcd->numcpus in cpu_rc_collect_hunger doesn't seem to be required (since
> LHS is not on global scale and also the class's tasks may not be running
> on other CPUs as in case 2). Removing the division rectified CPU sharing
> anomaly I had found.
>
> Let me know what you think of this fix!

Ah, you are right. LHS is on per-cpu scale.
I'll apply your patch.

> --- kernel/cpu_rc.c.org 2006-02-11 08:44:38.000000000 +0530
> +++ kernel/cpu_rc.c 2006-02-13 18:34:30.000000000 +0530
> @@ -204,7 +204,7 @@ void cpu_rc_collect_hunger(task_t *tsk)
>
> wait = jiffies - tsk->last_activated;
> if (CPU_RC_GUAR_SCALE * tsk->last_slice / (wait + tsk->last_slice)
> - < cr->guarantee / cr->rcd->numcpus)
> + < cr->guarantee)
> cr->stat[cpu].maybe_hungry++;
>
> tsk->last_activated = 0;

Thanks,

--
KUROSAWA, Takahiro
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/