[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131120120815.GA12860@redhat.com>
Date: Wed, 20 Nov 2013 13:08:25 +0100
From: Stanislaw Gruszka <sgruszka@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Christian Engelmayer <cengelma@....at>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>, fweisbec@...il.com,
Paul Turner <pjt@...gle.com>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists