Re: [PATCH] cpufreq: stats: Make the stats code non-modular

2016-05-31 Thread Rafael J. Wysocki
On Tuesday, May 31, 2016 04:14:34 PM Viresh Kumar wrote: > On 28-05-16, 15:15, Rafael J. Wysocki wrote: > > -static int __init cpufreq_stats_init(void) > > -{ > > - int ret; > > - unsigned int cpu; > > - > > - spin_lock_init(&cpufreq_stats_lock); > > My bad for ignoring this, but the spin lo

Re: [PATCH] cpufreq: stats: Make the stats code non-modular

2016-05-31 Thread Viresh Kumar
On 28-05-16, 15:15, Rafael J. Wysocki wrote: > -static int __init cpufreq_stats_init(void) > -{ > - int ret; > - unsigned int cpu; > - > - spin_lock_init(&cpufreq_stats_lock); My bad for ignoring this, but the spin lock is left uninitialized now and this is what I get: [3.335732]

Re: [PATCH] cpufreq: stats: Make the stats code non-modular

2016-05-30 Thread Rafael J. Wysocki
On Mon, May 30, 2016 at 6:53 AM, Viresh Kumar wrote: > On 28-05-16, 15:15, Rafael J. Wysocki wrote: >> It does, but there's a problem. >> >> If fast frequency switching is in use, the stats attributes just sit there >> full of zeros (because the stats are not updated then) which is confusing. >> >

Re: [PATCH] cpufreq: stats: Make the stats code non-modular

2016-05-29 Thread Viresh Kumar
rom there, which would have been cleaner, unfortunately breaks > powertop). What's stopping us from doing that? Sorry I don't remember that well :( I mean, why can't we call cpufreq_stats_record_transition() somehow via that code ? > Updated patch is below. > > --- >

Re: [PATCH] cpufreq: stats: Make the stats code non-modular

2016-05-28 Thread Rafael J. Wysocki
th fast frequency switching, but that requires some major surgery of the stats code, so for now I'd like to simply make those attributes return nothing if fast frequency switching is enabled for the policy (returning -EBUSY from there, which would have been cleaner, unfortunately breaks po

Re: [PATCH] cpufreq: stats: Make the stats code non-modular

2016-05-25 Thread Viresh Kumar
On 26-05-16, 00:23, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > The modularity of cpufreq_stats is quite problematic. > > First off, the usage of policy notifiers for the initialization > and cleanup in the cpufreq_stats module is inherently racy with > respect to CPU offline/online a

[PATCH] cpufreq: stats: Make the stats code non-modular

2016-05-25 Thread Rafael J. Wysocki
From: Rafael J. Wysocki The modularity of cpufreq_stats is quite problematic. First off, the usage of policy notifiers for the initialization and cleanup in the cpufreq_stats module is inherently racy with respect to CPU offline/online and the initialization and cleanup of the cpufreq driver. S