Re: [Patch v8 7/7] sched/fair: Enable tuning of decay period

From: Quentin Perret
Date: Fri Jan 17 2020 - 06:48:07 EST


On Tuesday 14 Jan 2020 at 14:57:39 (-0500), Thara Gopinath wrote:
> +static int __init setup_sched_thermal_decay_shift(char *str)
> +{
> + int _shift;
> +
> + if (kstrtoint(str, 0, &_shift))
> + pr_warn("Unable to set scheduler thermal pressure decay shift parameter\n");

Nit: looking at kstrtoint() it seems that _shift will be left unmodified
upon failure. To avoid feeding a random value to clamp() below, perhaps
initialize _shift to 0 ?

> + sched_thermal_decay_shift = clamp(_shift, 0, 10);
> + return 1;
> +}

Thanks,
Quentin