All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] cpufreq: intel_pstate: trivial improvements
@ 2016-06-27 10:07 ` Jisheng Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

The first patch fixes incorrect placement of __initdata

The second patch is to add __init/__initdata marker to some functions
or varaiables so that we can discard them.

The third patch declares pid_params/pstate_funcs/hwp_active as
__read_mostly, under the fact that they are mostly read and not
written to.


Since v1:
 - add Viresh's ack
 - fix the third patch commit msg: remove duplicated words

Jisheng Zhang (3):
  intel_pstate: Fix incorrect placement of __initdata
  intel_pstate: add __init/__initdata marker to some functions/variables
  intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly

 drivers/cpufreq/intel_pstate.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

-- 
2.8.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 0/3] cpufreq: intel_pstate: trivial improvements
@ 2016-06-27 10:07 ` Jisheng Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

The first patch fixes incorrect placement of __initdata

The second patch is to add __init/__initdata marker to some functions
or varaiables so that we can discard them.

The third patch declares pid_params/pstate_funcs/hwp_active as
__read_mostly, under the fact that they are mostly read and not
written to.


Since v1:
 - add Viresh's ack
 - fix the third patch commit msg: remove duplicated words

Jisheng Zhang (3):
  intel_pstate: Fix incorrect placement of __initdata
  intel_pstate: add __init/__initdata marker to some functions/variables
  intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly

 drivers/cpufreq/intel_pstate.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

-- 
2.8.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 1/3] intel_pstate: Fix incorrect placement of __initdata
  2016-06-27 10:07 ` Jisheng Zhang
@ 2016-06-27 10:07   ` Jisheng Zhang
  -1 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

__initdata should be placed between the variable name and equal sign
(if there is) for the variable to be placed in the intended section.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/intel_pstate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index fe9dc17..44099e9 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1574,9 +1574,9 @@ static struct cpufreq_driver intel_pstate_driver = {
 	.name		= "intel_pstate",
 };
 
-static int __initdata no_load;
-static int __initdata no_hwp;
-static int __initdata hwp_only;
+static int no_load __initdata;
+static int no_hwp __initdata;
+static int hwp_only __initdata;
 static unsigned int force_load;
 
 static int intel_pstate_msrs_not_valid(void)
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 1/3] intel_pstate: Fix incorrect placement of __initdata
@ 2016-06-27 10:07   ` Jisheng Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

__initdata should be placed between the variable name and equal sign
(if there is) for the variable to be placed in the intended section.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/intel_pstate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index fe9dc17..44099e9 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1574,9 +1574,9 @@ static struct cpufreq_driver intel_pstate_driver = {
 	.name		= "intel_pstate",
 };
 
-static int __initdata no_load;
-static int __initdata no_hwp;
-static int __initdata hwp_only;
+static int no_load __initdata;
+static int no_hwp __initdata;
+static int hwp_only __initdata;
 static unsigned int force_load;
 
 static int intel_pstate_msrs_not_valid(void)
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/3] intel_pstate: add __init/__initdata marker to some functions/variables
  2016-06-27 10:07 ` Jisheng Zhang
@ 2016-06-27 10:07   ` Jisheng Zhang
  -1 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

These functions/variables are not needed after booting, so mark them
as __init or __initdata.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/intel_pstate.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 44099e9..861bcba 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1355,7 +1355,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
 };
 MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
 
-static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] = {
+static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] __initconst = {
 	ICPU(0x56, core_params),
 	{}
 };
@@ -1577,9 +1577,9 @@ static struct cpufreq_driver intel_pstate_driver = {
 static int no_load __initdata;
 static int no_hwp __initdata;
 static int hwp_only __initdata;
-static unsigned int force_load;
+static unsigned int force_load __initdata;
 
-static int intel_pstate_msrs_not_valid(void)
+static int __init intel_pstate_msrs_not_valid(void)
 {
 	if (!pstate_funcs.get_max() ||
 	    !pstate_funcs.get_min() ||
@@ -1589,7 +1589,7 @@ static int intel_pstate_msrs_not_valid(void)
 	return 0;
 }
 
-static void copy_pid_params(struct pstate_adjust_policy *policy)
+static void __init copy_pid_params(struct pstate_adjust_policy *policy)
 {
 	pid_params.sample_rate_ms = policy->sample_rate_ms;
 	pid_params.sample_rate_ns = pid_params.sample_rate_ms * NSEC_PER_MSEC;
@@ -1600,7 +1600,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
 	pid_params.setpoint = policy->setpoint;
 }
 
-static void copy_cpu_funcs(struct pstate_funcs *funcs)
+static void __init copy_cpu_funcs(struct pstate_funcs *funcs)
 {
 	pstate_funcs.get_max   = funcs->get_max;
 	pstate_funcs.get_max_physical = funcs->get_max_physical;
@@ -1615,7 +1615,7 @@ static void copy_cpu_funcs(struct pstate_funcs *funcs)
 
 #ifdef CONFIG_ACPI
 
-static bool intel_pstate_no_acpi_pss(void)
+static bool __init intel_pstate_no_acpi_pss(void)
 {
 	int i;
 
@@ -1644,7 +1644,7 @@ static bool intel_pstate_no_acpi_pss(void)
 	return true;
 }
 
-static bool intel_pstate_has_acpi_ppc(void)
+static bool __init intel_pstate_has_acpi_ppc(void)
 {
 	int i;
 
@@ -1672,7 +1672,7 @@ struct hw_vendor_info {
 };
 
 /* Hardware vendor-specific info that has its own power management modes */
-static struct hw_vendor_info vendor_info[] = {
+static struct hw_vendor_info vendor_info[] __initdata = {
 	{1, "HP    ", "ProLiant", PSS},
 	{1, "ORACLE", "X4-2    ", PPC},
 	{1, "ORACLE", "X4-2L   ", PPC},
@@ -1691,7 +1691,7 @@ static struct hw_vendor_info vendor_info[] = {
 	{0, "", ""},
 };
 
-static bool intel_pstate_platform_pwr_mgmt_exists(void)
+static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
 {
 	struct acpi_table_header hdr;
 	struct hw_vendor_info *v_info;
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/3] intel_pstate: add __init/__initdata marker to some functions/variables
@ 2016-06-27 10:07   ` Jisheng Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

These functions/variables are not needed after booting, so mark them
as __init or __initdata.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/intel_pstate.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 44099e9..861bcba 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1355,7 +1355,7 @@ static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
 };
 MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
 
-static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] = {
+static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] __initconst = {
 	ICPU(0x56, core_params),
 	{}
 };
@@ -1577,9 +1577,9 @@ static struct cpufreq_driver intel_pstate_driver = {
 static int no_load __initdata;
 static int no_hwp __initdata;
 static int hwp_only __initdata;
-static unsigned int force_load;
+static unsigned int force_load __initdata;
 
-static int intel_pstate_msrs_not_valid(void)
+static int __init intel_pstate_msrs_not_valid(void)
 {
 	if (!pstate_funcs.get_max() ||
 	    !pstate_funcs.get_min() ||
@@ -1589,7 +1589,7 @@ static int intel_pstate_msrs_not_valid(void)
 	return 0;
 }
 
-static void copy_pid_params(struct pstate_adjust_policy *policy)
+static void __init copy_pid_params(struct pstate_adjust_policy *policy)
 {
 	pid_params.sample_rate_ms = policy->sample_rate_ms;
 	pid_params.sample_rate_ns = pid_params.sample_rate_ms * NSEC_PER_MSEC;
@@ -1600,7 +1600,7 @@ static void copy_pid_params(struct pstate_adjust_policy *policy)
 	pid_params.setpoint = policy->setpoint;
 }
 
-static void copy_cpu_funcs(struct pstate_funcs *funcs)
+static void __init copy_cpu_funcs(struct pstate_funcs *funcs)
 {
 	pstate_funcs.get_max   = funcs->get_max;
 	pstate_funcs.get_max_physical = funcs->get_max_physical;
@@ -1615,7 +1615,7 @@ static void copy_cpu_funcs(struct pstate_funcs *funcs)
 
 #ifdef CONFIG_ACPI
 
-static bool intel_pstate_no_acpi_pss(void)
+static bool __init intel_pstate_no_acpi_pss(void)
 {
 	int i;
 
@@ -1644,7 +1644,7 @@ static bool intel_pstate_no_acpi_pss(void)
 	return true;
 }
 
-static bool intel_pstate_has_acpi_ppc(void)
+static bool __init intel_pstate_has_acpi_ppc(void)
 {
 	int i;
 
@@ -1672,7 +1672,7 @@ struct hw_vendor_info {
 };
 
 /* Hardware vendor-specific info that has its own power management modes */
-static struct hw_vendor_info vendor_info[] = {
+static struct hw_vendor_info vendor_info[] __initdata = {
 	{1, "HP    ", "ProLiant", PSS},
 	{1, "ORACLE", "X4-2    ", PPC},
 	{1, "ORACLE", "X4-2L   ", PPC},
@@ -1691,7 +1691,7 @@ static struct hw_vendor_info vendor_info[] = {
 	{0, "", ""},
 };
 
-static bool intel_pstate_platform_pwr_mgmt_exists(void)
+static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
 {
 	struct acpi_table_header hdr;
 	struct hw_vendor_info *v_info;
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 3/3] intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly
  2016-06-27 10:07 ` Jisheng Zhang
@ 2016-06-27 10:07   ` Jisheng Zhang
  -1 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

pid_params is written once by copy_pid_params() during initialization,
and thereafter is mostly read by hot path intel_pstate_update_util().
The read of pid_params gets more after commit a4675fbc4a7a ("cpufreq:
intel_pstate: Replace timers with utilization update callbacks")

pstate_funcs is written once by copy_cpu_funcs() during initialization,
and thereafter is mostly read by hot path intel_pstate_update_util()

hwp_active is written to once during initialization and thereafter is
mostly read by hot path intel_pstate_update_util().

The fact that they are mostly read and not written to makes them
candidates for __read_mostly declarations.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/cpufreq/intel_pstate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 861bcba..2eda50d 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -281,9 +281,9 @@ struct cpu_defaults {
 static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu);
 static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu);
 
-static struct pstate_adjust_policy pid_params;
-static struct pstate_funcs pstate_funcs;
-static int hwp_active;
+static struct pstate_adjust_policy pid_params __read_mostly;
+static struct pstate_funcs pstate_funcs __read_mostly;
+static int hwp_active __read_mostly;
 
 #ifdef CONFIG_ACPI
 static bool acpi_ppc;
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 3/3] intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly
@ 2016-06-27 10:07   ` Jisheng Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-27 10:07 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rjw, viresh.kumar
  Cc: linux-pm, linux-kernel, Jisheng Zhang

pid_params is written once by copy_pid_params() during initialization,
and thereafter is mostly read by hot path intel_pstate_update_util().
The read of pid_params gets more after commit a4675fbc4a7a ("cpufreq:
intel_pstate: Replace timers with utilization update callbacks")

pstate_funcs is written once by copy_cpu_funcs() during initialization,
and thereafter is mostly read by hot path intel_pstate_update_util()

hwp_active is written to once during initialization and thereafter is
mostly read by hot path intel_pstate_update_util().

The fact that they are mostly read and not written to makes them
candidates for __read_mostly declarations.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/cpufreq/intel_pstate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 861bcba..2eda50d 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -281,9 +281,9 @@ struct cpu_defaults {
 static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu);
 static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu);
 
-static struct pstate_adjust_policy pid_params;
-static struct pstate_funcs pstate_funcs;
-static int hwp_active;
+static struct pstate_adjust_policy pid_params __read_mostly;
+static struct pstate_funcs pstate_funcs __read_mostly;
+static int hwp_active __read_mostly;
 
 #ifdef CONFIG_ACPI
 static bool acpi_ppc;
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] intel_pstate: Fix incorrect placement of __initdata
  2016-06-27 10:07   ` Jisheng Zhang
  (?)
@ 2016-06-27 17:19   ` Srinivas Pandruvada
  -1 siblings, 0 replies; 15+ messages in thread
From: Srinivas Pandruvada @ 2016-06-27 17:19 UTC (permalink / raw)
  To: Jisheng Zhang, lenb, rjw, viresh.kumar; +Cc: linux-pm, linux-kernel

On Mon, 2016-06-27 at 18:07 +0800, Jisheng Zhang wrote:
> __initdata should be placed between the variable name and equal sign
> (if there is) for the variable to be placed in the intended section.
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index fe9dc17..44099e9 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1574,9 +1574,9 @@ static struct cpufreq_driver
> intel_pstate_driver = {
>  	.name		= "intel_pstate",
>  };
>  
> -static int __initdata no_load;
> -static int __initdata no_hwp;
> -static int __initdata hwp_only;
> +static int no_load __initdata;
> +static int no_hwp __initdata;
> +static int hwp_only __initdata;
>  static unsigned int force_load;
>  
>  static int intel_pstate_msrs_not_valid(void)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/3] intel_pstate: add __init/__initdata marker to some functions/variables
  2016-06-27 10:07   ` Jisheng Zhang
  (?)
@ 2016-06-27 17:26   ` Srinivas Pandruvada
  -1 siblings, 0 replies; 15+ messages in thread
From: Srinivas Pandruvada @ 2016-06-27 17:26 UTC (permalink / raw)
  To: Jisheng Zhang, lenb, rjw, viresh.kumar; +Cc: linux-pm, linux-kernel

On Mon, 2016-06-27 at 18:07 +0800, Jisheng Zhang wrote:
> These functions/variables are not needed after booting, so mark them
> as __init or __initdata.
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 44099e9..861bcba 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1355,7 +1355,7 @@ static const struct x86_cpu_id
> intel_pstate_cpu_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
>  
> -static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] = {
> +static const struct x86_cpu_id intel_pstate_cpu_oob_ids[]
> __initconst = {
>  	ICPU(0x56, core_params),
>  	{}
>  };
> @@ -1577,9 +1577,9 @@ static struct cpufreq_driver
> intel_pstate_driver = {
>  static int no_load __initdata;
>  static int no_hwp __initdata;
>  static int hwp_only __initdata;
> -static unsigned int force_load;
> +static unsigned int force_load __initdata;
>  
> -static int intel_pstate_msrs_not_valid(void)
> +static int __init intel_pstate_msrs_not_valid(void)
>  {
>  	if (!pstate_funcs.get_max() ||
>  	    !pstate_funcs.get_min() ||
> @@ -1589,7 +1589,7 @@ static int intel_pstate_msrs_not_valid(void)
>  	return 0;
>  }
>  
> -static void copy_pid_params(struct pstate_adjust_policy *policy)
> +static void __init copy_pid_params(struct pstate_adjust_policy
> *policy)
>  {
>  	pid_params.sample_rate_ms = policy->sample_rate_ms;
>  	pid_params.sample_rate_ns = pid_params.sample_rate_ms *
> NSEC_PER_MSEC;
> @@ -1600,7 +1600,7 @@ static void copy_pid_params(struct
> pstate_adjust_policy *policy)
>  	pid_params.setpoint = policy->setpoint;
>  }
>  
> -static void copy_cpu_funcs(struct pstate_funcs *funcs)
> +static void __init copy_cpu_funcs(struct pstate_funcs *funcs)
>  {
>  	pstate_funcs.get_max   = funcs->get_max;
>  	pstate_funcs.get_max_physical = funcs->get_max_physical;
> @@ -1615,7 +1615,7 @@ static void copy_cpu_funcs(struct pstate_funcs
> *funcs)
>  
>  #ifdef CONFIG_ACPI
>  
> -static bool intel_pstate_no_acpi_pss(void)
> +static bool __init intel_pstate_no_acpi_pss(void)
>  {
>  	int i;
>  
> @@ -1644,7 +1644,7 @@ static bool intel_pstate_no_acpi_pss(void)
>  	return true;
>  }
>  
> -static bool intel_pstate_has_acpi_ppc(void)
> +static bool __init intel_pstate_has_acpi_ppc(void)
>  {
>  	int i;
>  
> @@ -1672,7 +1672,7 @@ struct hw_vendor_info {
>  };
>  
>  /* Hardware vendor-specific info that has its own power management
> modes */
> -static struct hw_vendor_info vendor_info[] = {
> +static struct hw_vendor_info vendor_info[] __initdata = {
>  	{1, "HP    ", "ProLiant", PSS},
>  	{1, "ORACLE", "X4-2    ", PPC},
>  	{1, "ORACLE", "X4-2L   ", PPC},
> @@ -1691,7 +1691,7 @@ static struct hw_vendor_info vendor_info[] = {
>  	{0, "", ""},
>  };
>  
> -static bool intel_pstate_platform_pwr_mgmt_exists(void)
> +static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
>  {
>  	struct acpi_table_header hdr;
>  	struct hw_vendor_info *v_info;

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 3/3] intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly
  2016-06-27 10:07   ` Jisheng Zhang
  (?)
@ 2016-06-27 17:29   ` Srinivas Pandruvada
  2016-06-28  2:29       ` Jisheng Zhang
  -1 siblings, 1 reply; 15+ messages in thread
From: Srinivas Pandruvada @ 2016-06-27 17:29 UTC (permalink / raw)
  To: Jisheng Zhang, lenb, rjw, viresh.kumar; +Cc: linux-pm, linux-kernel

On Mon, 2016-06-27 at 18:07 +0800, Jisheng Zhang wrote:
> pid_params is written once by copy_pid_params() during
> initialization,
> and thereafter is mostly read by hot path intel_pstate_update_util().
> The read of pid_params gets more after commit a4675fbc4a7a ("cpufreq:
> intel_pstate: Replace timers with utilization update callbacks")
> 
> pstate_funcs is written once by copy_cpu_funcs() during
> initialization,
> and thereafter is mostly read by hot path intel_pstate_update_util()
> 
> hwp_active is written to once during initialization and thereafter is
> mostly read by hot path intel_pstate_update_util().
> 
> The fact that they are mostly read and not written to makes them
> candidates for __read_mostly declarations.
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 861bcba..2eda50d 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -281,9 +281,9 @@ struct cpu_defaults {
>  static inline int32_t get_target_pstate_use_performance(struct
> cpudata *cpu);
>  static inline int32_t get_target_pstate_use_cpu_load(struct cpudata
> *cpu);
>  
> -static struct pstate_adjust_policy pid_params;
> -static struct pstate_funcs pstate_funcs;
> -static int hwp_active;
> +static struct pstate_adjust_policy pid_params __read_mostly;
> +static struct pstate_funcs pstate_funcs __read_mostly;
> +static int hwp_active __read_mostly;
>  
>  #ifdef CONFIG_ACPI
>  static bool acpi_ppc;

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 3/3] intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly
  2016-06-27 17:29   ` Srinivas Pandruvada
@ 2016-06-28  2:29       ` Jisheng Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-28  2:29 UTC (permalink / raw)
  To: Srinivas Pandruvada, lenb, rjw, viresh.kumar; +Cc: linux-pm, linux-kernel

Dear Rafael,

On Mon, 27 Jun 2016 10:29:54 -0700
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:

> On Mon, 2016-06-27 at 18:07 +0800, Jisheng Zhang wrote:
> > pid_params is written once by copy_pid_params() during
> > initialization,
> > and thereafter is mostly read by hot path intel_pstate_update_util().
> > The read of pid_params gets more after commit a4675fbc4a7a ("cpufreq:
> > intel_pstate: Replace timers with utilization update callbacks")
> > 
> > pstate_funcs is written once by copy_cpu_funcs() during
> > initialization,
> > and thereafter is mostly read by hot path intel_pstate_update_util()
> > 
> > hwp_active is written to once during initialization and thereafter is
> > mostly read by hot path intel_pstate_update_util().
> > 
> > The fact that they are mostly read and not written to makes them
> > candidates for __read_mostly declarations.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>  
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

oops, I missed Viresh's Ack in this patch, so can you please add the missing

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Sorry for inconvenience,
Jisheng

> > ---
> >  drivers/cpufreq/intel_pstate.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/cpufreq/intel_pstate.c
> > b/drivers/cpufreq/intel_pstate.c
> > index 861bcba..2eda50d 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -281,9 +281,9 @@ struct cpu_defaults {
> >  static inline int32_t get_target_pstate_use_performance(struct
> > cpudata *cpu);
> >  static inline int32_t get_target_pstate_use_cpu_load(struct cpudata
> > *cpu);
> >  
> > -static struct pstate_adjust_policy pid_params;
> > -static struct pstate_funcs pstate_funcs;
> > -static int hwp_active;
> > +static struct pstate_adjust_policy pid_params __read_mostly;
> > +static struct pstate_funcs pstate_funcs __read_mostly;
> > +static int hwp_active __read_mostly;
> >  
> >  #ifdef CONFIG_ACPI
> >  static bool acpi_ppc;  

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 3/3] intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly
@ 2016-06-28  2:29       ` Jisheng Zhang
  0 siblings, 0 replies; 15+ messages in thread
From: Jisheng Zhang @ 2016-06-28  2:29 UTC (permalink / raw)
  To: Srinivas Pandruvada, lenb, rjw, viresh.kumar; +Cc: linux-pm, linux-kernel

Dear Rafael,

On Mon, 27 Jun 2016 10:29:54 -0700
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:

> On Mon, 2016-06-27 at 18:07 +0800, Jisheng Zhang wrote:
> > pid_params is written once by copy_pid_params() during
> > initialization,
> > and thereafter is mostly read by hot path intel_pstate_update_util().
> > The read of pid_params gets more after commit a4675fbc4a7a ("cpufreq:
> > intel_pstate: Replace timers with utilization update callbacks")
> > 
> > pstate_funcs is written once by copy_cpu_funcs() during
> > initialization,
> > and thereafter is mostly read by hot path intel_pstate_update_util()
> > 
> > hwp_active is written to once during initialization and thereafter is
> > mostly read by hot path intel_pstate_update_util().
> > 
> > The fact that they are mostly read and not written to makes them
> > candidates for __read_mostly declarations.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>  
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

oops, I missed Viresh's Ack in this patch, so can you please add the missing

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Sorry for inconvenience,
Jisheng

> > ---
> >  drivers/cpufreq/intel_pstate.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/cpufreq/intel_pstate.c
> > b/drivers/cpufreq/intel_pstate.c
> > index 861bcba..2eda50d 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -281,9 +281,9 @@ struct cpu_defaults {
> >  static inline int32_t get_target_pstate_use_performance(struct
> > cpudata *cpu);
> >  static inline int32_t get_target_pstate_use_cpu_load(struct cpudata
> > *cpu);
> >  
> > -static struct pstate_adjust_policy pid_params;
> > -static struct pstate_funcs pstate_funcs;
> > -static int hwp_active;
> > +static struct pstate_adjust_policy pid_params __read_mostly;
> > +static struct pstate_funcs pstate_funcs __read_mostly;
> > +static int hwp_active __read_mostly;
> >  
> >  #ifdef CONFIG_ACPI
> >  static bool acpi_ppc;  

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 3/3] intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly
  2016-06-28  2:29       ` Jisheng Zhang
  (?)
@ 2016-06-28 11:43       ` Rafael J. Wysocki
  -1 siblings, 0 replies; 15+ messages in thread
From: Rafael J. Wysocki @ 2016-06-28 11:43 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Srinivas Pandruvada, lenb, viresh.kumar, linux-pm, linux-kernel

On Tuesday, June 28, 2016 10:29:27 AM Jisheng Zhang wrote:
> Dear Rafael,
> 
> On Mon, 27 Jun 2016 10:29:54 -0700
> Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:
> 
> > On Mon, 2016-06-27 at 18:07 +0800, Jisheng Zhang wrote:
> > > pid_params is written once by copy_pid_params() during
> > > initialization,
> > > and thereafter is mostly read by hot path intel_pstate_update_util().
> > > The read of pid_params gets more after commit a4675fbc4a7a ("cpufreq:
> > > intel_pstate: Replace timers with utilization update callbacks")
> > > 
> > > pstate_funcs is written once by copy_cpu_funcs() during
> > > initialization,
> > > and thereafter is mostly read by hot path intel_pstate_update_util()
> > > 
> > > hwp_active is written to once during initialization and thereafter is
> > > mostly read by hot path intel_pstate_update_util().
> > > 
> > > The fact that they are mostly read and not written to makes them
> > > candidates for __read_mostly declarations.
> > > 
> > > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>  
> > Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> 
> oops, I missed Viresh's Ack in this patch, so can you please add the missing
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

I've added it already.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/3] cpufreq: intel_pstate: trivial improvements
  2016-06-27 10:07 ` Jisheng Zhang
                   ` (3 preceding siblings ...)
  (?)
@ 2016-07-04 13:03 ` Rafael J. Wysocki
  -1 siblings, 0 replies; 15+ messages in thread
From: Rafael J. Wysocki @ 2016-07-04 13:03 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: srinivas.pandruvada, lenb, viresh.kumar, linux-pm, linux-kernel

On Monday, June 27, 2016 06:07:15 PM Jisheng Zhang wrote:
> The first patch fixes incorrect placement of __initdata
> 
> The second patch is to add __init/__initdata marker to some functions
> or varaiables so that we can discard them.
> 
> The third patch declares pid_params/pstate_funcs/hwp_active as
> __read_mostly, under the fact that they are mostly read and not
> written to.
> 
> 
> Since v1:
>  - add Viresh's ack
>  - fix the third patch commit msg: remove duplicated words
> 
> Jisheng Zhang (3):
>   intel_pstate: Fix incorrect placement of __initdata
>   intel_pstate: add __init/__initdata marker to some functions/variables
>   intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly
> 
>  drivers/cpufreq/intel_pstate.c | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)

All [1-3/3] applied (with tags), thanks!

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-07-04 12:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-27 10:07 [PATCH v2 0/3] cpufreq: intel_pstate: trivial improvements Jisheng Zhang
2016-06-27 10:07 ` Jisheng Zhang
2016-06-27 10:07 ` [PATCH v2 1/3] intel_pstate: Fix incorrect placement of __initdata Jisheng Zhang
2016-06-27 10:07   ` Jisheng Zhang
2016-06-27 17:19   ` Srinivas Pandruvada
2016-06-27 10:07 ` [PATCH v2 2/3] intel_pstate: add __init/__initdata marker to some functions/variables Jisheng Zhang
2016-06-27 10:07   ` Jisheng Zhang
2016-06-27 17:26   ` Srinivas Pandruvada
2016-06-27 10:07 ` [PATCH v2 3/3] intel_pstate: Declare pid_params/pstate_funcs/hwp_active __read_mostly Jisheng Zhang
2016-06-27 10:07   ` Jisheng Zhang
2016-06-27 17:29   ` Srinivas Pandruvada
2016-06-28  2:29     ` Jisheng Zhang
2016-06-28  2:29       ` Jisheng Zhang
2016-06-28 11:43       ` Rafael J. Wysocki
2016-07-04 13:03 ` [PATCH v2 0/3] cpufreq: intel_pstate: trivial improvements Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.