[RFC V2 1/2] topology: Allow multiple entities to provide sched_freq_tick() callback

2020-12-15 Thread Viresh Kumar
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 freq_scale variable. The implementations now need to provide struct scale_freq_tic

Re: [RFC V2 1/2] topology: Allow multiple entities to provide sched_freq_tick() callback

2021-01-13 Thread Ionela Voinescu
Hi, I focused for now on the design of the solution and mostly on the generic code in arch_topology.c, as that will then impact the arm64 code. On Tuesday 15 Dec 2020 at 16:46:35 (+0530), Viresh Kumar wrote: [..] > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > in

Re: [RFC V2 1/2] topology: Allow multiple entities to provide sched_freq_tick() callback

2021-01-19 Thread Ionela Voinescu
Hi, On Friday 15 Jan 2021 at 13:18:47 (+0530), Viresh Kumar wrote: > On 13-01-21, 16:18, Ionela Voinescu wrote: > > On Tuesday 15 Dec 2020 at 16:46:35 (+0530), Viresh Kumar wrote: > > > +void topology_scale_freq_tick(void) > > > +{ > > > + struct scale_freq_tick_data *sftd = *this_cpu_ptr(&sft_dat

Re: [RFC V2 1/2] topology: Allow multiple entities to provide sched_freq_tick() callback

2021-01-21 Thread Viresh Kumar
On 19-01-21, 19:05, Ionela Voinescu wrote: > I think it would improve clarity a lot by having a single topology > function, with clear comments on which path is taken when. > > In regards to them sharing code, there's not much code they could be > sharing, as one just does some simple math on prov

Re: [RFC V2 1/2] topology: Allow multiple entities to provide sched_freq_tick() callback

2021-01-14 Thread Viresh Kumar
On 13-01-21, 16:18, Ionela Voinescu wrote: > On Tuesday 15 Dec 2020 at 16:46:35 (+0530), Viresh Kumar wrote: > > +void topology_scale_freq_tick(void) > > +{ > > + struct scale_freq_tick_data *sftd = *this_cpu_ptr(&sft_data); > > + > > + if (sftd) > > + sftd->scale_freq(); > > +} > >