* [PATCH 1/3] intel_idle: shrink states tables
@ 2013-08-30 10:25 Bartlomiej Zolnierkiewicz
2013-08-30 12:03 ` Rafael J. Wysocki
2013-09-02 9:30 ` Daniel Lezcano
0 siblings, 2 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2013-08-30 10:25 UTC (permalink / raw)
To: Len Brown; +Cc: Daniel Lezcano, Rafael J. Wysocki, linux-pm, linux-kernel
There is no reason to define CPUIDLE_STATE_MAX (currently 10) entries
in states tables if the driver always stops iterating over table when
it encounters first .enter == NULL entry.
$ size drivers/idle/intel_idle.o.*
text data bss dec hex filename
2886 5440 32 8358 20a6 drivers/idle/intel_idle.o.before
2886 3752 32 6670 1a0e drivers/idle/intel_idle.o.after
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Len Brown <lenb@kernel.org>
---
drivers/idle/intel_idle.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index fa6964d..9c97fbb42 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table;
* which is also the index into the MWAIT hint array.
* Thus C0 is a dummy.
*/
-static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
+static struct cpuidle_state nehalem_cstates[] = {
{
.name = "C1-NHM",
.desc = "MWAIT 0x00",
@@ -156,7 +156,7 @@ static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
.enter = NULL }
};
-static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
+static struct cpuidle_state snb_cstates[] = {
{
.name = "C1-SNB",
.desc = "MWAIT 0x00",
@@ -196,7 +196,7 @@ static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
.enter = NULL }
};
-static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
+static struct cpuidle_state ivb_cstates[] = {
{
.name = "C1-IVB",
.desc = "MWAIT 0x00",
@@ -236,7 +236,7 @@ static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
.enter = NULL }
};
-static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
+static struct cpuidle_state hsw_cstates[] = {
{
.name = "C1-HSW",
.desc = "MWAIT 0x00",
@@ -297,7 +297,7 @@ static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
.enter = NULL }
};
-static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = {
+static struct cpuidle_state atom_cstates[] = {
{
.name = "C1E-ATM",
.desc = "MWAIT 0x00",
@@ -628,7 +628,7 @@ static int intel_idle_cpu_init(int cpu)
int num_substates, mwait_hint, mwait_cstate, mwait_substate;
if (cpuidle_state_table[cstate].enter == NULL)
- continue;
+ break;
if (cstate + 1 > max_cstate) {
printk(PREFIX "max_cstate %d reached\n", max_cstate);
--
1.8.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/3] intel_idle: shrink states tables
2013-08-30 10:25 [PATCH 1/3] intel_idle: shrink states tables Bartlomiej Zolnierkiewicz
@ 2013-08-30 12:03 ` Rafael J. Wysocki
2013-09-02 9:30 ` Daniel Lezcano
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2013-08-30 12:03 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Len Brown, Daniel Lezcano, linux-pm, linux-kernel
On Friday, August 30, 2013 12:25:10 PM Bartlomiej Zolnierkiewicz wrote:
> There is no reason to define CPUIDLE_STATE_MAX (currently 10) entries
> in states tables if the driver always stops iterating over table when
> it encounters first .enter == NULL entry.
>
> $ size drivers/idle/intel_idle.o.*
> text data bss dec hex filename
> 2886 5440 32 8358 20a6 drivers/idle/intel_idle.o.before
> 2886 3752 32 6670 1a0e drivers/idle/intel_idle.o.after
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Len Brown <lenb@kernel.org>
Thanks, I'll queue this series up for 3.13.
> ---
> drivers/idle/intel_idle.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index fa6964d..9c97fbb42 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table;
> * which is also the index into the MWAIT hint array.
> * Thus C0 is a dummy.
> */
> -static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state nehalem_cstates[] = {
> {
> .name = "C1-NHM",
> .desc = "MWAIT 0x00",
> @@ -156,7 +156,7 @@ static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state snb_cstates[] = {
> {
> .name = "C1-SNB",
> .desc = "MWAIT 0x00",
> @@ -196,7 +196,7 @@ static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state ivb_cstates[] = {
> {
> .name = "C1-IVB",
> .desc = "MWAIT 0x00",
> @@ -236,7 +236,7 @@ static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state hsw_cstates[] = {
> {
> .name = "C1-HSW",
> .desc = "MWAIT 0x00",
> @@ -297,7 +297,7 @@ static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state atom_cstates[] = {
> {
> .name = "C1E-ATM",
> .desc = "MWAIT 0x00",
> @@ -628,7 +628,7 @@ static int intel_idle_cpu_init(int cpu)
> int num_substates, mwait_hint, mwait_cstate, mwait_substate;
>
> if (cpuidle_state_table[cstate].enter == NULL)
> - continue;
> + break;
>
> if (cstate + 1 > max_cstate) {
> printk(PREFIX "max_cstate %d reached\n", max_cstate);
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/3] intel_idle: shrink states tables
2013-08-30 10:25 [PATCH 1/3] intel_idle: shrink states tables Bartlomiej Zolnierkiewicz
2013-08-30 12:03 ` Rafael J. Wysocki
@ 2013-09-02 9:30 ` Daniel Lezcano
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2013-09-02 9:30 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Len Brown, Rafael J. Wysocki, linux-pm, linux-kernel
On 08/30/2013 12:25 PM, Bartlomiej Zolnierkiewicz wrote:
> There is no reason to define CPUIDLE_STATE_MAX (currently 10) entries
> in states tables if the driver always stops iterating over table when
> it encounters first .enter == NULL entry.
>
> $ size drivers/idle/intel_idle.o.*
> text data bss dec hex filename
> 2886 5440 32 8358 20a6 drivers/idle/intel_idle.o.before
> 2886 3752 32 6670 1a0e drivers/idle/intel_idle.o.after
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Len Brown <lenb@kernel.org>
> ---
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> drivers/idle/intel_idle.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index fa6964d..9c97fbb42 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table;
> * which is also the index into the MWAIT hint array.
> * Thus C0 is a dummy.
> */
> -static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state nehalem_cstates[] = {
> {
> .name = "C1-NHM",
> .desc = "MWAIT 0x00",
> @@ -156,7 +156,7 @@ static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state snb_cstates[] = {
> {
> .name = "C1-SNB",
> .desc = "MWAIT 0x00",
> @@ -196,7 +196,7 @@ static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state ivb_cstates[] = {
> {
> .name = "C1-IVB",
> .desc = "MWAIT 0x00",
> @@ -236,7 +236,7 @@ static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state hsw_cstates[] = {
> {
> .name = "C1-HSW",
> .desc = "MWAIT 0x00",
> @@ -297,7 +297,7 @@ static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
> .enter = NULL }
> };
>
> -static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = {
> +static struct cpuidle_state atom_cstates[] = {
> {
> .name = "C1E-ATM",
> .desc = "MWAIT 0x00",
> @@ -628,7 +628,7 @@ static int intel_idle_cpu_init(int cpu)
> int num_substates, mwait_hint, mwait_cstate, mwait_substate;
>
> if (cpuidle_state_table[cstate].enter == NULL)
> - continue;
> + break;
>
> if (cstate + 1 > max_cstate) {
> printk(PREFIX "max_cstate %d reached\n", max_cstate);
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-02 9:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30 10:25 [PATCH 1/3] intel_idle: shrink states tables Bartlomiej Zolnierkiewicz
2013-08-30 12:03 ` Rafael J. Wysocki
2013-09-02 9:30 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).