lkml.org 
[lkml]   [2006]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectJiffies wraparound is not treated in the schedstats
Hi Balbir,

Do you know why in the sched_info_arrive() and sched_info_depart()
functions the calculation of delta_jiffies does not use the time_after
or time_before macro to prevent the miscalculation when jiffies
overflow?

For instance the delta_jiffies variable is simply calculated as:

delta_jiffies = now - t->sched_info.last_queued;

Do not you think the more logical way should be

if (time_after(now, t->sched_info.last_queued))
delta_jiffies = now - t->sched_info.last_queued;
else
delta_jiffies = (MAX_JIFFIES - t->sched_info.last_queued) + now

I have included more variables to measure some issues of schedule in
the kernel (following schedstat idea) and I noticed that jiffies
wraparound has led to wrong values, since the user space tool when
collecting the values is producing negative values.

Any comments?

Can I provide a patch for that?

BR,

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

\
 
 \ /
  Last update: 2006-11-08 19:07    [W:0.054 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site