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

From: Thara Gopinath
Date: Fri Jan 17 2020 - 10:46:39 EST


On 01/17/2020 06:47 AM, Quentin Perret wrote:
> 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 ?

You are right. I will fix it. Thanks!
>
>> + sched_thermal_decay_shift = clamp(_shift, 0, 10);
>> + return 1;
>> +}
>
> Thanks,
> Quentin
>


--
Warm Regards
Thara