Re: [PATCH] fix granularity of task_u/stime(), v2

From: Stanislaw Gruszka
Date: Mon Nov 23 2009 - 05:49:09 EST


On Mon, 23 Nov 2009 15:55:28 +0530
Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:

> * Stanislaw Gruszka <sgruszka@xxxxxxxxxx> [2009-11-23 11:09:26]:
> [snip]
> > +
> > + utime = task_utime(tsk);
> > + stime = task_stime(tsk);
> > + if (tsk->utime > utime || tsk->stime > stime) {
> > + utime = tsk->utime;
> > + stime = tsk->stime;
> > + }
>
> Won't this condition be problematic, since it can reset stime
> when tsk->utime > utime for example?

We use both {u,s}time adjusted values or both not adjusted values.
This seems to be right to me. Adjusting not help anyway, if we have
stime/utime ticks disproportion, e.g. task only gets stime ticks but
not gets utime ticks, but it runs in user and kernel space in
the same amount of time.

If this solution whold be accepted, patch will contain additional
comment.

Stanislaw
--
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/