Re: [PATCH V3 09/13] cpufreq: governor: Move common sysfs tunables to cpufreq_governor.c
From: Rafael J. Wysocki
Date: Mon Feb 08 2016 - 07:58:56 EST
On Mon, Feb 8, 2016 at 12:39 PM, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> We have got five common sysfs tunables between ondemand and conservative
> governors, move their callbacks to cpufreq_governor.c to get rid of
> redundant code.
>
> Because of minor differences in the implementation of the callbacks,
> some more per-governor callbacks are introduced in order to not
> introduce any more "governor == ONDEMAND/CONSERVATIVE" like checks.
My most fundamental concern here is that attributes that don't apply
to a particular governor should not appear in sysfs at all when that
governor is in use (instead of appearing and always returning -EINVAL
which is sort of silly).
That doesn't mean the common code cannot access them, though. They
still can be present in the data structure, but it may be a good idea
to set them to special values clearly meaning "invalid" then.
Thanks,
Rafael