• Viresh Kumar's avatar
    arch_topology: Allow multiple entities to provide sched_freq_tick() callback · 01e055c1
    Viresh Kumar authored
    This patch attempts to make it generic enough so other parts of the
    kernel can also provide their own implementation of scale_freq_tick()
    callback, which is called by the scheduler periodically to update the
    per-cpu arch_freq_scale variable.
    
    The implementations now need to provide 'struct scale_freq_data' for the
    CPUs for which they have hardware counters available, and a callback
    gets registered for each possible CPU in a per-cpu variable.
    
    The arch specific (or ARM AMU) counters are updated to adapt to this and
    they take the highest priority if they are available, i.e. they will be
    used instead of CPPC based counters for example.
    
    The special code to rebuild the sched domains, in case invariance status
    change for the system, is moved out of arm64 specific code and is added
    to arch_topology.c.
    
    Note that this also defines SCALE_FREQ_SOURCE_CPUFREQ but doesn't use it
    and it is added to show that cpufreq is also acts as source of
    information for FIE and will be used by default if no other counters are
    supported for a platform.
    Reviewed-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
    Tested-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
    Acked-by: Will Deacon <will@kernel.org> # for arm64
    Tested-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    01e055c1
topology.h 1.17 KB