Re: [PATCH] sched/fair: Care divide error in update_task_scan_period()

From: Rik van Riel
Date: Wed Oct 08 2014 - 12:45:09 EST


On 10/08/2014 02:43 AM, Yasuaki Ishimatsu wrote:

> The divide error is rare case because the trigger is node offline.
> By this patch, when both of private and shared are set to 0, diff
> is just set to 0, not calculating the division.

How about a simple

if (private + shared) == 0)
return;

higher up in the function, to avoid adding an extra
layer of indentation and confusion to the main part
of the function?
--
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/