lkml.org 
[lkml]   [2013]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PROBLEM] possible divide by 0 in kernel/sched/cputime.c scale_stime()
On Mon, Nov 18, 2013 at 06:27:06PM +0100, Peter Zijlstra wrote:
> The below is a compile tested only attempt to deal with both these
> problems. Comments?

Just two nits as I don't understand vast of the patch.

> + delta_exec = now - curr->exec_start;
> + if ((s64)delta_exec < 0)
> return;

Check here should probably use <= and also unlikely() would be
reasonable.

> + schedstat_set(curr->statistics.exec_max,
> + max((u64)delta_exec, curr->statistics.exec_max));

(u64) cast not needed.

Stanislaw


\
 
 \ /
  Last update: 2013-11-20 12:41    [W:0.129 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site