Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Srivatsa S. Bhat
On 07/16/2014 11:14 AM, Viresh Kumar wrote: > On 15 July 2014 12:28, Srivatsa S. Bhat wrote: >> Wait, allowing an offline CPU to be the policy->cpu (i.e., the CPU which is >> considered as the master of the policy/group) is just absurd. > > Yeah, that was as Absurd as I am :) > I have had my

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Srivatsa S. Bhat
On 07/15/2014 11:05 PM, skan...@codeaurora.org wrote: > > Srivatsa S. Bhat wrote: >> On 07/15/2014 11:06 AM, Saravana Kannan wrote: >>> On 07/14/2014 09:35 PM, Viresh Kumar wrote: On 15 July 2014 00:38, Saravana Kannan wrote: > Yeah, it definitely crashes if policy->cpu if an offline

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Srivatsa S. Bhat
On 07/15/2014 11:05 PM, skan...@codeaurora.org wrote: Srivatsa S. Bhat wrote: On 07/15/2014 11:06 AM, Saravana Kannan wrote: On 07/14/2014 09:35 PM, Viresh Kumar wrote: On 15 July 2014 00:38, Saravana Kannan skan...@codeaurora.org wrote: Yeah, it definitely crashes if policy-cpu if an

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-16 Thread Srivatsa S. Bhat
On 07/16/2014 11:14 AM, Viresh Kumar wrote: On 15 July 2014 12:28, Srivatsa S. Bhat sriva...@mit.edu wrote: Wait, allowing an offline CPU to be the policy-cpu (i.e., the CPU which is considered as the master of the policy/group) is just absurd. Yeah, that was as Absurd as I am :) I have

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-15 Thread Viresh Kumar
On 15 July 2014 12:28, Srivatsa S. Bhat wrote: > Wait, allowing an offline CPU to be the policy->cpu (i.e., the CPU which is > considered as the master of the policy/group) is just absurd. Yeah, that was as Absurd as I am :) > The goal of this patchset should be to just de-couple the sysfs >

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-15 Thread skannan
Srivatsa S. Bhat wrote: > On 07/15/2014 11:06 AM, Saravana Kannan wrote: >> On 07/14/2014 09:35 PM, Viresh Kumar wrote: >>> On 15 July 2014 00:38, Saravana Kannan wrote: Yeah, it definitely crashes if policy->cpu if an offline cpu. Because the mutex would be uninitialized if it's

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-15 Thread Srivatsa S. Bhat
On 07/15/2014 11:06 AM, Saravana Kannan wrote: > On 07/14/2014 09:35 PM, Viresh Kumar wrote: >> On 15 July 2014 00:38, Saravana Kannan wrote: >>> Yeah, it definitely crashes if policy->cpu if an offline cpu. Because >>> the >>> mutex would be uninitialized if it's stopped after boot or it would

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-15 Thread Srivatsa S. Bhat
On 07/15/2014 11:06 AM, Saravana Kannan wrote: On 07/14/2014 09:35 PM, Viresh Kumar wrote: On 15 July 2014 00:38, Saravana Kannan skan...@codeaurora.org wrote: Yeah, it definitely crashes if policy-cpu if an offline cpu. Because the mutex would be uninitialized if it's stopped after boot or

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-15 Thread skannan
Srivatsa S. Bhat wrote: On 07/15/2014 11:06 AM, Saravana Kannan wrote: On 07/14/2014 09:35 PM, Viresh Kumar wrote: On 15 July 2014 00:38, Saravana Kannan skan...@codeaurora.org wrote: Yeah, it definitely crashes if policy-cpu if an offline cpu. Because the mutex would be uninitialized if

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-15 Thread Viresh Kumar
On 15 July 2014 12:28, Srivatsa S. Bhat sriva...@mit.edu wrote: Wait, allowing an offline CPU to be the policy-cpu (i.e., the CPU which is considered as the master of the policy/group) is just absurd. Yeah, that was as Absurd as I am :) The goal of this patchset should be to just de-couple

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 15 July 2014 11:06, Saravana Kannan wrote: > Btw, I tried to take a stab at removing any assumption in cpufreq code about > policy->cpu being ONLINE. There are 160 instances of those of with 23 are in > cpufreq.c > > So, even if we are sure cpufreq.c is fine, it's 137 other uses spread across

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Saravana Kannan
On 07/14/2014 09:35 PM, Viresh Kumar wrote: On 15 July 2014 00:38, Saravana Kannan wrote: Yeah, it definitely crashes if policy->cpu if an offline cpu. Because the mutex would be uninitialized if it's stopped after boot or it would never have been initialized (depending on how you fix

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 15 July 2014 00:38, Saravana Kannan wrote: > Yeah, it definitely crashes if policy->cpu if an offline cpu. Because the > mutex would be uninitialized if it's stopped after boot or it would never > have been initialized (depending on how you fix policy->cpu at boot). > > Look at this snippet on

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Saravana Kannan
On 07/13/2014 11:13 PM, Viresh Kumar wrote: On 12 July 2014 08:36, Saravana Kannan wrote: On 07/10/2014 11:19 PM, Viresh Kumar wrote: Please make sure you take care of these issues: - suspend/resume - hotplug - module insert/remove Ok, I was just at the current code. Does

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Saravana Kannan
On 07/13/2014 11:09 PM, Viresh Kumar wrote: On 12 July 2014 08:14, Saravana Kannan wrote: I'm just always adding the real nodes to the first CPU in a cluster independent of which CPU gets added first. Makes it easier to know which ones to symlink. See comment next to policy->cpu for full

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 12 July 2014 08:36, Saravana Kannan wrote: > On 07/10/2014 11:19 PM, Viresh Kumar wrote: > >> >> Please make sure you take care of these issues: >> - suspend/resume >> - hotplug >> - module insert/remove > > Ok, I was just at the current code. Does cpufreq_unregister_driver() even > really

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 12 July 2014 08:14, Saravana Kannan wrote: >>> I'm just always adding the real nodes to the first CPU in a cluster >>> independent of which CPU gets added first. Makes it easier to know which >>> ones to symlink. See comment next to policy->cpu for full context. >> >> >> Yeah, and that is the

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 12 July 2014 08:14, Saravana Kannan skan...@codeaurora.org wrote: I'm just always adding the real nodes to the first CPU in a cluster independent of which CPU gets added first. Makes it easier to know which ones to symlink. See comment next to policy-cpu for full context. Yeah, and that

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 12 July 2014 08:36, Saravana Kannan skan...@codeaurora.org wrote: On 07/10/2014 11:19 PM, Viresh Kumar wrote: Please make sure you take care of these issues: - suspend/resume - hotplug - module insert/remove Ok, I was just at the current code. Does cpufreq_unregister_driver() even

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Saravana Kannan
On 07/13/2014 11:09 PM, Viresh Kumar wrote: On 12 July 2014 08:14, Saravana Kannan skan...@codeaurora.org wrote: I'm just always adding the real nodes to the first CPU in a cluster independent of which CPU gets added first. Makes it easier to know which ones to symlink. See comment next to

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Saravana Kannan
On 07/13/2014 11:13 PM, Viresh Kumar wrote: On 12 July 2014 08:36, Saravana Kannan skan...@codeaurora.org wrote: On 07/10/2014 11:19 PM, Viresh Kumar wrote: Please make sure you take care of these issues: - suspend/resume - hotplug - module insert/remove Ok, I was just at the current code.

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 15 July 2014 00:38, Saravana Kannan skan...@codeaurora.org wrote: Yeah, it definitely crashes if policy-cpu if an offline cpu. Because the mutex would be uninitialized if it's stopped after boot or it would never have been initialized (depending on how you fix policy-cpu at boot). Look at

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Saravana Kannan
On 07/14/2014 09:35 PM, Viresh Kumar wrote: On 15 July 2014 00:38, Saravana Kannan skan...@codeaurora.org wrote: Yeah, it definitely crashes if policy-cpu if an offline cpu. Because the mutex would be uninitialized if it's stopped after boot or it would never have been initialized (depending on

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-14 Thread Viresh Kumar
On 15 July 2014 11:06, Saravana Kannan skan...@codeaurora.org wrote: Btw, I tried to take a stab at removing any assumption in cpufreq code about policy-cpu being ONLINE. There are 160 instances of those of with 23 are in cpufreq.c So, even if we are sure cpufreq.c is fine, it's 137 other

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Saravana Kannan
On 07/10/2014 11:19 PM, Viresh Kumar wrote: Please make sure you take care of these issues: - suspend/resume - hotplug - module insert/remove Ok, I was just at the current code. Does cpufreq_unregister_driver() even really work correctly as it stands? It doesn't even seem to stop any of the

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Saravana Kannan
On 07/11/2014 03:52 AM, Viresh Kumar wrote: Just responding to one comment. The one about policy->cpu. diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c static int cpufreq_add_dev_symlink(struct cpufreq_policy *policy) { - unsigned int j; + unsigned int j,

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Viresh Kumar
On 11 July 2014 15:29, wrote: > Viresh Kumar wrote: >> On 11 July 2014 09:48, Saravana Kannan wrote: >>> * Policy settings and governor tunables maintained across suspend/resume >>> and hotplug. >> >> Its already maintained during suspend/resume. > > But not across hotplug. Which is also

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread skannan
skan...@codeaurora.org wrote: > > Viresh Kumar wrote: >> Hi Saravana, >> >> Thanks for trying this.. >> >> On 11 July 2014 09:48, Saravana Kannan wrote: >>> The CPUfreq driver moves the cpufreq policy ownership between CPUs when >> >> s/driver/core > > Will do > S many typos. This is what

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread skannan
Srivatsa S. Bhat wrote: > On 07/11/2014 09:48 AM, Saravana Kannan wrote: >> The CPUfreq driver moves the cpufreq policy ownership between CPUs when >> CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When >> moving policy ownership between CPUs, it also moves the cpufreq sysfs

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread skannan
Viresh Kumar wrote: > Hi Saravana, > > Thanks for trying this.. > > On 11 July 2014 09:48, Saravana Kannan wrote: >> The CPUfreq driver moves the cpufreq policy ownership between CPUs when > > s/driver/core Will do > >> CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Srivatsa S. Bhat
On 07/11/2014 09:48 AM, Saravana Kannan wrote: > The CPUfreq driver moves the cpufreq policy ownership between CPUs when > CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When > moving policy ownership between CPUs, it also moves the cpufreq sysfs > directory between CPUs and

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Viresh Kumar
Hi Saravana, Thanks for trying this.. On 11 July 2014 09:48, Saravana Kannan wrote: > The CPUfreq driver moves the cpufreq policy ownership between CPUs when s/driver/core > CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When > moving policy ownership between CPUs, it

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Viresh Kumar
Hi Saravana, Thanks for trying this.. On 11 July 2014 09:48, Saravana Kannan skan...@codeaurora.org wrote: The CPUfreq driver moves the cpufreq policy ownership between CPUs when s/driver/core CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When moving policy ownership

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Srivatsa S. Bhat
On 07/11/2014 09:48 AM, Saravana Kannan wrote: The CPUfreq driver moves the cpufreq policy ownership between CPUs when CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When moving policy ownership between CPUs, it also moves the cpufreq sysfs directory between CPUs and also

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread skannan
Viresh Kumar wrote: Hi Saravana, Thanks for trying this.. On 11 July 2014 09:48, Saravana Kannan skan...@codeaurora.org wrote: The CPUfreq driver moves the cpufreq policy ownership between CPUs when s/driver/core Will do CPUs within a cluster (CPUs sharing same policy) go

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread skannan
Srivatsa S. Bhat wrote: On 07/11/2014 09:48 AM, Saravana Kannan wrote: The CPUfreq driver moves the cpufreq policy ownership between CPUs when CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When moving policy ownership between CPUs, it also moves the cpufreq sysfs

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread skannan
skan...@codeaurora.org wrote: Viresh Kumar wrote: Hi Saravana, Thanks for trying this.. On 11 July 2014 09:48, Saravana Kannan skan...@codeaurora.org wrote: The CPUfreq driver moves the cpufreq policy ownership between CPUs when s/driver/core Will do snip S many typos. This is

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Viresh Kumar
On 11 July 2014 15:29, skan...@codeaurora.org wrote: Viresh Kumar wrote: On 11 July 2014 09:48, Saravana Kannan skan...@codeaurora.org wrote: * Policy settings and governor tunables maintained across suspend/resume and hotplug. Its already maintained during suspend/resume. But not

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Saravana Kannan
On 07/11/2014 03:52 AM, Viresh Kumar wrote: Just responding to one comment. The one about policy-cpu. diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c static int cpufreq_add_dev_symlink(struct cpufreq_policy *policy) { - unsigned int j; + unsigned int j,

Re: [PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-11 Thread Saravana Kannan
On 07/10/2014 11:19 PM, Viresh Kumar wrote: Please make sure you take care of these issues: - suspend/resume - hotplug - module insert/remove Ok, I was just at the current code. Does cpufreq_unregister_driver() even really work correctly as it stands? It doesn't even seem to stop any of the

[PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-10 Thread Saravana Kannan
The CPUfreq driver moves the cpufreq policy ownership between CPUs when CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When moving policy ownership between CPUs, it also moves the cpufreq sysfs directory between CPUs and also fixes up the symlinks of the other CPUs in the

[PATCH v2] cpufreq: Don't destroy/realloc policy/sysfs on hotplug/suspend

2014-07-10 Thread Saravana Kannan
The CPUfreq driver moves the cpufreq policy ownership between CPUs when CPUs within a cluster (CPUs sharing same policy) go ONLINE/OFFLINE. When moving policy ownership between CPUs, it also moves the cpufreq sysfs directory between CPUs and also fixes up the symlinks of the other CPUs in the