Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Viresh Kumar
On 25-05-16, 02:48, Rafael J. Wysocki wrote: > I'm actually considering making the stats code non-modular. > > It won't have a reason to use notifiers then and may be simplified > quite a bit this way. As an added benefit, if it doesn't use the > transition notifier, it won't interfere with fast

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Viresh Kumar
On 25-05-16, 02:48, Rafael J. Wysocki wrote: > I'm actually considering making the stats code non-modular. > > It won't have a reason to use notifiers then and may be simplified > quite a bit this way. As an added benefit, if it doesn't use the > transition notifier, it won't interfere with fast

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Rafael J. Wysocki
On Wed, May 25, 2016 at 2:00 AM, Rafael J. Wysocki wrote: > On Tuesday, May 24, 2016 05:47:17 PM Viresh Kumar wrote: >> On 24-05-16, 14:13, Rafael J. Wysocki wrote: >> > I don't really get it why you don't like get/put_online_cpus() so much. >> >> Not that I don't like them, I

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Rafael J. Wysocki
On Wed, May 25, 2016 at 2:00 AM, Rafael J. Wysocki wrote: > On Tuesday, May 24, 2016 05:47:17 PM Viresh Kumar wrote: >> On 24-05-16, 14:13, Rafael J. Wysocki wrote: >> > I don't really get it why you don't like get/put_online_cpus() so much. >> >> Not that I don't like them, I just wanted to see

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Rafael J. Wysocki
On Tuesday, May 24, 2016 05:47:17 PM Viresh Kumar wrote: > On 24-05-16, 14:13, Rafael J. Wysocki wrote: > > I don't really get it why you don't like get/put_online_cpus() so much. > > Not that I don't like them, I just wanted to see if its possible to > work without any additional locking. > >

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Rafael J. Wysocki
On Tuesday, May 24, 2016 05:47:17 PM Viresh Kumar wrote: > On 24-05-16, 14:13, Rafael J. Wysocki wrote: > > I don't really get it why you don't like get/put_online_cpus() so much. > > Not that I don't like them, I just wanted to see if its possible to > work without any additional locking. > >

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Viresh Kumar
On 24-05-16, 14:13, Rafael J. Wysocki wrote: > I don't really get it why you don't like get/put_online_cpus() so much. Not that I don't like them, I just wanted to see if its possible to work without any additional locking. Anyway, so the first version of your patch did the get_online_cpus()

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Viresh Kumar
On 24-05-16, 14:13, Rafael J. Wysocki wrote: > I don't really get it why you don't like get/put_online_cpus() so much. Not that I don't like them, I just wanted to see if its possible to work without any additional locking. Anyway, so the first version of your patch did the get_online_cpus()

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Rafael J. Wysocki
On Tuesday, May 24, 2016 10:26:30 AM Viresh Kumar wrote: > On 23-05-16, 22:47, Rafael J. Wysocki wrote: > > Assuming that the loops are over online CPUs and not over possible > > CPUs I suppose? > > I wasn't focussing on that loop lately but the policy->rwsem :) > > > Anyway, if you are talking

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-24 Thread Rafael J. Wysocki
On Tuesday, May 24, 2016 10:26:30 AM Viresh Kumar wrote: > On 23-05-16, 22:47, Rafael J. Wysocki wrote: > > Assuming that the loops are over online CPUs and not over possible > > CPUs I suppose? > > I wasn't focussing on that loop lately but the policy->rwsem :) > > > Anyway, if you are talking

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Viresh Kumar
On 23-05-16, 22:47, Rafael J. Wysocki wrote: > Assuming that the loops are over online CPUs and not over possible > CPUs I suppose? I wasn't focussing on that loop lately but the policy->rwsem :) > Anyway, if you are talking about the code without the patch (which I > guess is the case), the

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Viresh Kumar
On 23-05-16, 22:47, Rafael J. Wysocki wrote: > Assuming that the loops are over online CPUs and not over possible > CPUs I suppose? I wasn't focussing on that loop lately but the policy->rwsem :) > Anyway, if you are talking about the code without the patch (which I > guess is the case), the

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Rafael J. Wysocki
On Mon, May 23, 2016 at 5:19 PM, Viresh Kumar wrote: > On 23-05-16, 15:40, Rafael J. Wysocki wrote: >> On Monday, May 23, 2016 09:27:03 AM Viresh Kumar wrote: >> > On 20-05-16, 23:33, Rafael J. Wysocki wrote: >> > > The policy rwsem is really only needed in

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Rafael J. Wysocki
On Mon, May 23, 2016 at 5:19 PM, Viresh Kumar wrote: > On 23-05-16, 15:40, Rafael J. Wysocki wrote: >> On Monday, May 23, 2016 09:27:03 AM Viresh Kumar wrote: >> > On 20-05-16, 23:33, Rafael J. Wysocki wrote: >> > > The policy rwsem is really only needed in cpufreq_stats_create_table(), >> > >

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Viresh Kumar
On 23-05-16, 15:40, Rafael J. Wysocki wrote: > On Monday, May 23, 2016 09:27:03 AM Viresh Kumar wrote: > > On 20-05-16, 23:33, Rafael J. Wysocki wrote: > > > The policy rwsem is really only needed in cpufreq_stats_create_table(), > > > because > > > the policy notifier is gone when _free_table()

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Viresh Kumar
On 23-05-16, 15:40, Rafael J. Wysocki wrote: > On Monday, May 23, 2016 09:27:03 AM Viresh Kumar wrote: > > On 20-05-16, 23:33, Rafael J. Wysocki wrote: > > > The policy rwsem is really only needed in cpufreq_stats_create_table(), > > > because > > > the policy notifier is gone when _free_table()

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Rafael J. Wysocki
On Monday, May 23, 2016 09:27:03 AM Viresh Kumar wrote: > On 20-05-16, 23:33, Rafael J. Wysocki wrote: > > The policy rwsem is really only needed in cpufreq_stats_create_table(), > > because > > the policy notifier is gone when _free_table() runs, so another version of > > the > > patch goes

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-23 Thread Rafael J. Wysocki
On Monday, May 23, 2016 09:27:03 AM Viresh Kumar wrote: > On 20-05-16, 23:33, Rafael J. Wysocki wrote: > > The policy rwsem is really only needed in cpufreq_stats_create_table(), > > because > > the policy notifier is gone when _free_table() runs, so another version of > > the > > patch goes

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-22 Thread Viresh Kumar
On 20-05-16, 23:33, Rafael J. Wysocki wrote: > The policy rwsem is really only needed in cpufreq_stats_create_table(), > because > the policy notifier is gone when _free_table() runs, so another version of the > patch goes below. Right. I saw that while reading your previous version but didn't

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-22 Thread Viresh Kumar
On 20-05-16, 23:33, Rafael J. Wysocki wrote: > The policy rwsem is really only needed in cpufreq_stats_create_table(), > because > the policy notifier is gone when _free_table() runs, so another version of the > patch goes below. Right. I saw that while reading your previous version but didn't

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-20 Thread Rafael J. Wysocki
On Friday, May 20, 2016 02:13:26 PM Rafael J. Wysocki wrote: > On Friday, May 20, 2016 07:52:47 AM Viresh Kumar wrote: > > On 20-05-16, 03:41, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > > > Loops over online CPUs in cpufreq_stats_init() and

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-20 Thread Rafael J. Wysocki
On Friday, May 20, 2016 02:13:26 PM Rafael J. Wysocki wrote: > On Friday, May 20, 2016 07:52:47 AM Viresh Kumar wrote: > > On 20-05-16, 03:41, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > > > Loops over online CPUs in cpufreq_stats_init() and cpufreq_stats_exit() > > > should

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-20 Thread Rafael J. Wysocki
On Friday, May 20, 2016 07:52:47 AM Viresh Kumar wrote: > On 20-05-16, 03:41, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Loops over online CPUs in cpufreq_stats_init() and cpufreq_stats_exit() > > should be carried out with CPU offline/online locked

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-20 Thread Rafael J. Wysocki
On Friday, May 20, 2016 07:52:47 AM Viresh Kumar wrote: > On 20-05-16, 03:41, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Loops over online CPUs in cpufreq_stats_init() and cpufreq_stats_exit() > > should be carried out with CPU offline/online locked or races are > > possible

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-19 Thread Viresh Kumar
On 20-05-16, 03:41, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Loops over online CPUs in cpufreq_stats_init() and cpufreq_stats_exit() > should be carried out with CPU offline/online locked or races are > possible otherwise, so make that happen. > >

Re: [PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-19 Thread Viresh Kumar
On 20-05-16, 03:41, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Loops over online CPUs in cpufreq_stats_init() and cpufreq_stats_exit() > should be carried out with CPU offline/online locked or races are > possible otherwise, so make that happen. > > Signed-off-by: Rafael J. Wysocki

[PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-19 Thread Rafael J. Wysocki
From: Rafael J. Wysocki Loops over online CPUs in cpufreq_stats_init() and cpufreq_stats_exit() should be carried out with CPU offline/online locked or races are possible otherwise, so make that happen. Signed-off-by: Rafael J. Wysocki

[PATCH v2] cpufreq: stats: Walk online CPUs with CPU offline/online locked

2016-05-19 Thread Rafael J. Wysocki
From: Rafael J. Wysocki Loops over online CPUs in cpufreq_stats_init() and cpufreq_stats_exit() should be carried out with CPU offline/online locked or races are possible otherwise, so make that happen. Signed-off-by: Rafael J. Wysocki --- v1 -> v2: On a second thought, add the policy