Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1190360 > unrolled thread
| Started by | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| First post | 2015-07-23 01:40 +0200 |
| Last post | 2015-07-27 16:50 +0200 |
| Articles | 6 on this page of 26 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] cpufreq: Better separation of device addition/removal and online/offline paths "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-23 01:40 +0200
[PATCH 1/2] cpufreq: Rename two functions related to CPU offline "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-23 01:40 +0200
Re: [PATCH 1/2] cpufreq: Rename two functions related to CPU offline Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-23 08:50 +0200
[PATCH 1/7] cpufreq: Rework two functions related to CPU offline "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
Re: [PATCH 1/7] cpufreq: Rework two functions related to CPU offline Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 16:50 +0200
[PATCH 0/7] cpufreq: Better separation of device addition/removal and online/offline paths "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
[PATCH 6/7] cpufreq: Pass CPU number to cpufreq_policy_alloc() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
Re: [PATCH 6/7] cpufreq: Pass CPU number to cpufreq_policy_alloc() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
[PATCH 3/7] cpufreq: Drop unnecessary label from cpufreq_add_dev() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
Re: [PATCH 3/7] cpufreq: Drop unnecessary label from cpufreq_add_dev() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
[PATCH 7/7] cpufreq: Separate CPU device removal from CPU online "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
Re: [PATCH 7/7] cpufreq: Separate CPU device removal from CPU online Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:10 +0200
Re: [PATCH 7/7] cpufreq: Separate CPU device removal from CPU online "Rafael J. Wysocki" <rafael@kernel.org> - 2015-07-28 00:00 +0200
[Update][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 23:30 +0200
[Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-29 02:40 +0200
[PATCH] cpufreq: Replace recover_policy with new_policy in cpufreq_online() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-29 02:50 +0200
Re: [PATCH] cpufreq: Replace recover_policy with new_policy in cpufreq_online() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-29 07:40 +0200
Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-29 07:40 +0200
Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-29 16:10 +0200
Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online "Rafael J. Wysocki" <rafael@kernel.org> - 2015-07-29 16:10 +0200
[PATCH 4/7] cpufreq: Drop unused dev argument from two functions "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
Re: [PATCH 4/7] cpufreq: Drop unused dev argument from two functions Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
[PATCH 5/7] cpufreq: Do not update related_cpus on every policy activation "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
Re: [PATCH 5/7] cpufreq: Do not update related_cpus on every policy activation Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
[PATCH 2/7] cpufreq: Drop cpufreq_policy_restore() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
Re: [PATCH 2/7] cpufreq: Drop cpufreq_policy_restore() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 16:50 +0200
Page 2 of 2 — ← Prev page 1 [2]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2015-07-27 15:50 +0200 |
| Subject | [PATCH 4/7] cpufreq: Drop unused dev argument from two functions |
| Message-ID | <pQQX2-3uw-41@gated-at.bofh.it> |
| In reply to | #1193099 |
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The dev argument of cpufreq_add_policy_cpu() and
cpufreq_add_dev_interface() is not used by any of them,
so drop it.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/cpufreq.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -999,8 +999,7 @@ static void cpufreq_remove_dev_symlink(s
}
}
-static int cpufreq_add_dev_interface(struct cpufreq_policy *policy,
- struct device *dev)
+static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)
{
struct freq_attr **drv_attr;
int ret = 0;
@@ -1057,8 +1056,7 @@ static int cpufreq_init_policy(struct cp
return cpufreq_set_policy(policy, &new_policy);
}
-static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
- unsigned int cpu, struct device *dev)
+static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu)
{
int ret = 0;
@@ -1225,7 +1223,7 @@ static int cpufreq_add_dev(struct device
if (policy) {
WARN_ON(!cpumask_test_cpu(cpu, policy->related_cpus));
if (!policy_is_inactive(policy))
- return cpufreq_add_policy_cpu(policy, cpu, dev);
+ return cpufreq_add_policy_cpu(policy, cpu);
/* This is the only online CPU for the policy. Start over. */
recover_policy = true;
@@ -1328,7 +1326,7 @@ static int cpufreq_add_dev(struct device
CPUFREQ_START, policy);
if (!recover_policy) {
- ret = cpufreq_add_dev_interface(policy, dev);
+ ret = cpufreq_add_dev_interface(policy);
if (ret)
goto out_exit_policy;
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2015-07-27 17:00 +0200 |
| Subject | Re: [PATCH 4/7] cpufreq: Drop unused dev argument from two functions |
| Message-ID | <pQS2K-52h-15@gated-at.bofh.it> |
| In reply to | #1193110 |
On 27-07-15, 16:05, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > The dev argument of cpufreq_add_policy_cpu() and > cpufreq_add_dev_interface() is not used by any of them, > so drop it. > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > --- > drivers/cpufreq/cpufreq.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2015-07-27 15:50 +0200 |
| Subject | [PATCH 5/7] cpufreq: Do not update related_cpus on every policy activation |
| Message-ID | <pQQX2-3uw-43@gated-at.bofh.it> |
| In reply to | #1193099 |
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The related_cpus mask includes CPUs whose cpufreq_cpu_data per-CPU
pointers have been set to the given policy. Since those pointers
are only set at the policy creation time and unset when the policy
is deleted, the related_cpus should not be updated between those
two operations.
For this reason, avoid updating it whenever the first of the
"related" CPUs goes online.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/cpufreq.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -1251,12 +1251,12 @@ static int cpufreq_add_dev(struct device
down_write(&policy->rwsem);
- /* related cpus should atleast have policy->cpus */
- cpumask_or(policy->related_cpus, policy->related_cpus, policy->cpus);
-
- /* Remember which CPUs have been present at the policy creation time. */
- if (!recover_policy)
+ if (!recover_policy) {
+ /* related_cpus should at least include policy->cpus. */
+ cpumask_or(policy->related_cpus, policy->related_cpus, policy->cpus);
+ /* Remember CPUs present at the policy creation time. */
cpumask_and(policy->real_cpus, policy->cpus, cpu_present_mask);
+ }
/*
* affected cpus must always be the one, which are online. We aren't
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2015-07-27 17:00 +0200 |
| Subject | Re: [PATCH 5/7] cpufreq: Do not update related_cpus on every policy activation |
| Message-ID | <pQS2L-52h-25@gated-at.bofh.it> |
| In reply to | #1193111 |
On 27-07-15, 16:06, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > The related_cpus mask includes CPUs whose cpufreq_cpu_data per-CPU > pointers have been set to the given policy. Since those pointers > are only set at the policy creation time and unset when the policy > is deleted, the related_cpus should not be updated between those > two operations. > > For this reason, avoid updating it whenever the first of the > "related" CPUs goes online. > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > --- > drivers/cpufreq/cpufreq.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2015-07-27 15:50 +0200 |
| Subject | [PATCH 2/7] cpufreq: Drop cpufreq_policy_restore() |
| Message-ID | <pQQX2-3uw-45@gated-at.bofh.it> |
| In reply to | #1193099 |
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Notice that when cpufreq_policy_restore() is called, its per-CPU
cpufreq_cpu_data variable has been already dereferenced and if that
variable is not NULL, the policy local pointer in cpufreq_add_dev()
contains its value.
Therefore it is not necessary to dereference it again and the
policy pointer can be used directly. Moreover, if that pointer
is not NULL, the policy is inactive (or the previous check would
have made us return from cpufreq_add_dev()) so the restoration
code from cpufreq_policy_restore() can be moved to that point
in cpufreq_add_dev().
Do that and drop cpufreq_policy_restore().
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/cpufreq.c | 44 +++++++++++---------------------------------
1 file changed, 11 insertions(+), 33 deletions(-)
Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -1092,28 +1092,6 @@ static int cpufreq_add_policy_cpu(struct
return 0;
}
-static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu)
-{
- struct cpufreq_policy *policy;
- unsigned long flags;
-
- read_lock_irqsave(&cpufreq_driver_lock, flags);
- policy = per_cpu(cpufreq_cpu_data, cpu);
- read_unlock_irqrestore(&cpufreq_driver_lock, flags);
-
- if (likely(policy)) {
- /* Policy should be inactive here */
- WARN_ON(!policy_is_inactive(policy));
-
- down_write(&policy->rwsem);
- policy->cpu = cpu;
- policy->governor = NULL;
- up_write(&policy->rwsem);
- }
-
- return policy;
-}
-
static struct cpufreq_policy *cpufreq_policy_alloc(struct device *dev)
{
struct cpufreq_policy *policy;
@@ -1226,7 +1204,7 @@ static int cpufreq_add_dev(struct device
int ret = -ENOMEM;
struct cpufreq_policy *policy;
unsigned long flags;
- bool recover_policy = !sif;
+ bool recover_policy;
pr_debug("adding CPU %u\n", cpu);
@@ -1244,18 +1222,18 @@ static int cpufreq_add_dev(struct device
/* Check if this CPU already has a policy to manage it */
policy = per_cpu(cpufreq_cpu_data, cpu);
- if (policy && !policy_is_inactive(policy)) {
+ if (policy) {
WARN_ON(!cpumask_test_cpu(cpu, policy->related_cpus));
- ret = cpufreq_add_policy_cpu(policy, cpu, dev);
- return ret;
- }
+ if (!policy_is_inactive(policy))
+ return cpufreq_add_policy_cpu(policy, cpu, dev);
- /*
- * Restore the saved policy when doing light-weight init and fall back
- * to the full init if that fails.
- */
- policy = recover_policy ? cpufreq_policy_restore(cpu) : NULL;
- if (!policy) {
+ /* This is the only online CPU for the policy. Start over. */
+ recover_policy = true;
+ down_write(&policy->rwsem);
+ policy->cpu = cpu;
+ policy->governor = NULL;
+ up_write(&policy->rwsem);
+ } else {
recover_policy = false;
policy = cpufreq_policy_alloc(dev);
if (!policy)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2015-07-27 16:50 +0200 |
| Subject | Re: [PATCH 2/7] cpufreq: Drop cpufreq_policy_restore() |
| Message-ID | <pQRT4-4QW-3@gated-at.bofh.it> |
| In reply to | #1193112 |
On 27-07-15, 16:03, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > Notice that when cpufreq_policy_restore() is called, its per-CPU > cpufreq_cpu_data variable has been already dereferenced and if that > variable is not NULL, the policy local pointer in cpufreq_add_dev() > contains its value. > > Therefore it is not necessary to dereference it again and the > policy pointer can be used directly. Moreover, if that pointer > is not NULL, the policy is inactive (or the previous check would > have made us return from cpufreq_add_dev()) so the restoration > code from cpufreq_policy_restore() can be moved to that point > in cpufreq_add_dev(). > > Do that and drop cpufreq_policy_restore(). > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > --- > drivers/cpufreq/cpufreq.c | 44 +++++++++++--------------------------------- > 1 file changed, 11 insertions(+), 33 deletions(-) Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web