Re: [REPORT] cfs-v4 vs sd-0.44

Rogan Dawes
2007-04-24T07:06:00Z

Ingo Molnar wrote:

> static void
> yield_task_fair(struct rq *rq, struct task_struct *p, struct task_struct *p_to)
> {
> struct rb_node *curr, *next, *first;
> struct task_struct *p_next;
>
> /*
> * yield-to support: if we are on the same runqueue then
> * give half of our wait_runtime (if it's positive) to the other task:
> */
> if (p_to && p->wait_runtime > 0) {
> p->wait_runtime >>= 1;
> p_to->wait_runtime += p->wait_runtime;
> }
>
> the above is the basic expression of: "charge a positive bank balance".
>

[..]

> [note, due to the nanoseconds unit there's no rounding loss to worry
> about.]

Surely if you divide 5 nanoseconds by 2, you'll get a rounding loss?

> Ingo

Rogan