Some of these could still get pushed into 2.6.38?
If not, it would be great if they get queued in:
- x86-tip tree, the two perf patches and the pm_qos patch
- idle tree, the intel_idle patch
- shmobile tree (which I expect exists), the shmobile patch
Thanks,
Thomas
Thomas Renninger (5):
shmobile: Rename cpuidle states to fit to general conventions
intel_idle: Rename cpuidle states
pm_qos: Make pm_qos settings readable
perf: timechart: fix black idle boxes in the title.
perf: timechart -> fix max number of cpus
arch/sh/kernel/cpu/shmobile/cpuidle.c | 6 +++---
drivers/idle/intel_idle.c | 22 +++++++++++-----------
kernel/pm_qos_params.c | 24 ++++++++++++++++++++++++
tools/perf/builtin-timechart.c | 6 +++---
tools/perf/util/svghelper.c | 6 +++---
5 files changed, 44 insertions(+), 20 deletions(-)
--
1.7.3.4
C0 is known as "busy", "not idle" state.
X86 "busy polling" state also got renamed from C0
to "POLL" recently.
Let's stay consistent with naming to avoid confusions.
Signed-off-by: Thomas Renninger <[email protected]>
Acked-by: Magnus Damm <[email protected]>
CC: [email protected]
---
arch/sh/kernel/cpu/shmobile/cpuidle.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
index c19e2a9..e4469e72 100644
--- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
+++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
@@ -75,7 +75,7 @@ void sh_mobile_setup_cpuidle(void)
i = CPUIDLE_DRIVER_STATE_START;
state = &dev->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C0");
+ snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN);
state->exit_latency = 1;
state->target_residency = 1 * 2;
@@ -88,7 +88,7 @@ void sh_mobile_setup_cpuidle(void)
if (sh_mobile_sleep_supported & SUSP_SH_SF) {
state = &dev->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
+ snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
strncpy(state->desc, "SuperH Sleep Mode [SF]",
CPUIDLE_DESC_LEN);
state->exit_latency = 100;
@@ -101,7 +101,7 @@ void sh_mobile_setup_cpuidle(void)
if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) {
state = &dev->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
+ snprintf(state->name, CPUIDLE_NAME_LEN, "C3");
strncpy(state->desc, "SuperH Mobile Standby Mode [SF]",
CPUIDLE_DESC_LEN);
state->exit_latency = 2300;
--
1.7.3.4
Userspace apps might have to cut off parts off the
idle state name for display reasons.
Switch NHM-C1 to C1-NHM (and others) so that a cut off
name is unique and makes sense to the user.
Signed-off-by: Thomas Renninger <[email protected]>
CC: [email protected]
---
drivers/idle/intel_idle.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 1fa091e..de6d0c5 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -100,7 +100,7 @@ static struct cpuidle_state *cpuidle_state_table;
static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
{ /* MWAIT C0 */ },
{ /* MWAIT C1 */
- .name = "NHM-C1",
+ .name = "C1-NHM",
.desc = "MWAIT 0x00",
.driver_data = (void *) 0x00,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -108,7 +108,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 6,
.enter = &intel_idle },
{ /* MWAIT C2 */
- .name = "NHM-C3",
+ .name = "C3-NHM",
.desc = "MWAIT 0x10",
.driver_data = (void *) 0x10,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -116,7 +116,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 80,
.enter = &intel_idle },
{ /* MWAIT C3 */
- .name = "NHM-C6",
+ .name = "C6-NHM",
.desc = "MWAIT 0x20",
.driver_data = (void *) 0x20,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -128,7 +128,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
{ /* MWAIT C0 */ },
{ /* MWAIT C1 */
- .name = "SNB-C1",
+ .name = "C1-SNB",
.desc = "MWAIT 0x00",
.driver_data = (void *) 0x00,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -136,7 +136,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 1,
.enter = &intel_idle },
{ /* MWAIT C2 */
- .name = "SNB-C3",
+ .name = "C3-SNB",
.desc = "MWAIT 0x10",
.driver_data = (void *) 0x10,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -144,7 +144,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 211,
.enter = &intel_idle },
{ /* MWAIT C3 */
- .name = "SNB-C6",
+ .name = "C6-SNB",
.desc = "MWAIT 0x20",
.driver_data = (void *) 0x20,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -152,7 +152,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 345,
.enter = &intel_idle },
{ /* MWAIT C4 */
- .name = "SNB-C7",
+ .name = "C7-SNB",
.desc = "MWAIT 0x30",
.driver_data = (void *) 0x30,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -164,7 +164,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
{ /* MWAIT C0 */ },
{ /* MWAIT C1 */
- .name = "ATM-C1",
+ .name = "C1-ATM",
.desc = "MWAIT 0x00",
.driver_data = (void *) 0x00,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -172,7 +172,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 4,
.enter = &intel_idle },
{ /* MWAIT C2 */
- .name = "ATM-C2",
+ .name = "C2-ATM",
.desc = "MWAIT 0x10",
.driver_data = (void *) 0x10,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -181,7 +181,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle },
{ /* MWAIT C3 */ },
{ /* MWAIT C4 */
- .name = "ATM-C4",
+ .name = "C4-ATM",
.desc = "MWAIT 0x30",
.driver_data = (void *) 0x30,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -190,7 +190,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle },
{ /* MWAIT C5 */ },
{ /* MWAIT C6 */
- .name = "ATM-C6",
+ .name = "C6-ATM",
.desc = "MWAIT 0x52",
.driver_data = (void *) 0x52,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
--
1.7.3.4
Currently numcpus is determined in pid_put_sample which is only
called on sched_switch/sched_wakeup sample processing.
On a machine with a lot cpus I often saw the last cpu missing.
Check for (max) numcpus on every event happening and in the beginning.
-> fixes the issue for me.
Signed-off-by: Thomas Renninger <[email protected]>
CC: Arnaldo Carvalho de Melo <[email protected]>
CC: Arjan van de Ven <[email protected]>
CC: [email protected]
---
tools/perf/builtin-timechart.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 746cf03..0ace786 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -264,9 +264,6 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end)
c->start_time = start;
if (p->start_time == 0 || p->start_time > start)
p->start_time = start;
-
- if (cpu > numcpus)
- numcpus = cpu;
}
#define MAX_CPUS 4096
@@ -511,6 +508,9 @@ static int process_sample_event(event_t *event __used,
if (!event_str)
return 0;
+ if (sample->cpu > numcpus)
+ numcpus = sample->cpu;
+
if (strcmp(event_str, "power:cpu_idle") == 0) {
struct power_processor_entry *ppe = (void *)te;
if (ppe->state == (u32)PWR_EVENT_EXIT)
--
1.7.3.4
I have a machine where entering deep C-states broke.
pm_qos was a hot candidate, but I couldn't find any way to double
check without the need of recompiling.
While in this case it was a driver bug (ath9k):
https://bugzilla.kernel.org/show_bug.cgi?id=27532
powertop or others may want to read out cpu_dma_latency
restrictions which could be the cause of preventing a machine
entering deeper C-states.
Output with this patch:
# default value of 2000 * USEC_PER_SEC (0x77359400)
cat /dev/network_latency |hexdump
0000000 9400 7735
0000004
# value of 55 us which is the reason for not entering C2
cat /dev/cpu_dma_latency |hexdump
0000000 0037 0000
0000004
There is no reason to hide this info -> make pm_qos files readable.
Signed-off-by: Thomas Renninger <[email protected]>
CC: [email protected]
CC: [email protected]
---
kernel/pm_qos_params.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index aeaa7f8..0da058b 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -103,11 +103,14 @@ static struct pm_qos_object *pm_qos_array[] = {
static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
size_t count, loff_t *f_pos);
+static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
+ size_t count, loff_t *f_pos);
static int pm_qos_power_open(struct inode *inode, struct file *filp);
static int pm_qos_power_release(struct inode *inode, struct file *filp);
static const struct file_operations pm_qos_power_fops = {
.write = pm_qos_power_write,
+ .read = pm_qos_power_read,
.open = pm_qos_power_open,
.release = pm_qos_power_release,
.llseek = noop_llseek,
@@ -376,6 +379,27 @@ static int pm_qos_power_release(struct inode *inode, struct file *filp)
}
+static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
+ size_t count, loff_t *f_pos)
+{
+ s32 value;
+ unsigned long flags;
+ struct pm_qos_object *o;
+ struct pm_qos_request_list *pm_qos_req = filp->private_data;;
+
+ if (!pm_qos_req)
+ return -EINVAL;
+ if (!pm_qos_request_active(pm_qos_req))
+ return -EINVAL;
+
+ o = pm_qos_array[pm_qos_req->pm_qos_class];
+ spin_lock_irqsave(&pm_qos_lock, flags);
+ value = pm_qos_get_value(o);
+ spin_unlock_irqrestore(&pm_qos_lock, flags);
+
+ return simple_read_from_buffer(buf, count, f_pos, &value, sizeof(s32));
+}
+
static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
size_t count, loff_t *f_pos)
{
--
1.7.3.4
This fix is needed for eye of gnome and firefox svg viewers.
Only Inkscape can handle the broken case.
Compare with the other svg_legenda_box declarations, looks
like a typo slipped in at this place.
Signed-off-by: Thomas Renninger <[email protected]>
CC: Arnaldo Carvalho de Melo <[email protected]>
CC: Arjan van de Ven <[email protected]>
CC: [email protected]
---
tools/perf/util/svghelper.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
index fb737fe..96c8660 100644
--- a/tools/perf/util/svghelper.c
+++ b/tools/perf/util/svghelper.c
@@ -456,9 +456,9 @@ void svg_legenda(void)
return;
svg_legenda_box(0, "Running", "sample");
- svg_legenda_box(100, "Idle","rect.c1");
- svg_legenda_box(200, "Deeper Idle", "rect.c3");
- svg_legenda_box(350, "Deepest Idle", "rect.c6");
+ svg_legenda_box(100, "Idle","c1");
+ svg_legenda_box(200, "Deeper Idle", "c3");
+ svg_legenda_box(350, "Deepest Idle", "c6");
svg_legenda_box(550, "Sleeping", "process2");
svg_legenda_box(650, "Waiting for cpu", "waiting");
svg_legenda_box(800, "Blocked on IO", "blocked");
--
1.7.3.4
* Thomas Renninger <[email protected]> wrote:
> Some of these could still get pushed into 2.6.38?
>
> If not, it would be great if they get queued in:
> - x86-tip tree, the two perf patches and the pm_qos patch
I suspect the pm_qos patch should be processed by the PM tree - Rafael?
Thanks,
Ingo
Commit-ID: e853072055a01d8b3c4dc89d231649189454c4f1
Gitweb: http://git.kernel.org/tip/e853072055a01d8b3c4dc89d231649189454c4f1
Author: Thomas Renninger <[email protected]>
AuthorDate: Sun, 27 Feb 2011 22:36:45 +0100
Committer: Ingo Molnar <[email protected]>
CommitDate: Mon, 28 Feb 2011 08:56:14 +0100
perf timechart: Fix black idle boxes in the title
This fix is needed for eye of gnome and firefox svg viewers.
Only Inkscape can handle the broken case.
Compare with the other svg_legenda_box declarations, looks
like a typo slipped in at this place.
Signed-off-by: Thomas Renninger <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/util/svghelper.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
index fb737fe..96c8660 100644
--- a/tools/perf/util/svghelper.c
+++ b/tools/perf/util/svghelper.c
@@ -456,9 +456,9 @@ void svg_legenda(void)
return;
svg_legenda_box(0, "Running", "sample");
- svg_legenda_box(100, "Idle","rect.c1");
- svg_legenda_box(200, "Deeper Idle", "rect.c3");
- svg_legenda_box(350, "Deepest Idle", "rect.c6");
+ svg_legenda_box(100, "Idle","c1");
+ svg_legenda_box(200, "Deeper Idle", "c3");
+ svg_legenda_box(350, "Deepest Idle", "c6");
svg_legenda_box(550, "Sleeping", "process2");
svg_legenda_box(650, "Waiting for cpu", "waiting");
svg_legenda_box(800, "Blocked on IO", "blocked");
Commit-ID: 54b08f5f90feebc9756d96e0c7bf2fdffe4af7c3
Gitweb: http://git.kernel.org/tip/54b08f5f90feebc9756d96e0c7bf2fdffe4af7c3
Author: Thomas Renninger <[email protected]>
AuthorDate: Sun, 27 Feb 2011 22:36:46 +0100
Committer: Ingo Molnar <[email protected]>
CommitDate: Mon, 28 Feb 2011 08:56:15 +0100
perf timechart: Fix max number of cpus
Currently numcpus is determined in pid_put_sample which is only
called on sched_switch/sched_wakeup sample processing.
On a machine with a lot cpus I often saw the last cpu missing.
Check for (max) numcpus on every event happening and in the
beginning. -> fixes the issue for me.
Signed-off-by: Thomas Renninger <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/builtin-timechart.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 746cf03..0ace786 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -264,9 +264,6 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end)
c->start_time = start;
if (p->start_time == 0 || p->start_time > start)
p->start_time = start;
-
- if (cpu > numcpus)
- numcpus = cpu;
}
#define MAX_CPUS 4096
@@ -511,6 +508,9 @@ static int process_sample_event(event_t *event __used,
if (!event_str)
return 0;
+ if (sample->cpu > numcpus)
+ numcpus = sample->cpu;
+
if (strcmp(event_str, "power:cpu_idle") == 0) {
struct power_processor_entry *ppe = (void *)te;
if (ppe->state == (u32)PWR_EVENT_EXIT)
applied to idle-test
thanks,
Len Brown, Intel Open Source Technology Center
On Monday, February 28, 2011, Ingo Molnar wrote:
>
> * Thomas Renninger <[email protected]> wrote:
>
> > Some of these could still get pushed into 2.6.38?
> >
> > If not, it would be great if they get queued in:
> > - x86-tip tree, the two perf patches and the pm_qos patch
>
> I suspect the pm_qos patch should be processed by the PM tree - Rafael?
That's correct, thanks!
Rafael
On Sunday, February 27, 2011, Thomas Renninger wrote:
> I have a machine where entering deep C-states broke.
> pm_qos was a hot candidate, but I couldn't find any way to double
> check without the need of recompiling.
>
> While in this case it was a driver bug (ath9k):
> https://bugzilla.kernel.org/show_bug.cgi?id=27532
>
> powertop or others may want to read out cpu_dma_latency
> restrictions which could be the cause of preventing a machine
> entering deeper C-states.
>
> Output with this patch:
>
> # default value of 2000 * USEC_PER_SEC (0x77359400)
> cat /dev/network_latency |hexdump
> 0000000 9400 7735
> 0000004
>
> # value of 55 us which is the reason for not entering C2
> cat /dev/cpu_dma_latency |hexdump
> 0000000 0037 0000
> 0000004
>
> There is no reason to hide this info -> make pm_qos files readable.
>
> Signed-off-by: Thomas Renninger <[email protected]>
> CC: [email protected]
> CC: [email protected]
Applied to suspend-2.6/linux-next.
Thanks,
Rafael
> ---
> kernel/pm_qos_params.c | 24 ++++++++++++++++++++++++
> 1 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
> index aeaa7f8..0da058b 100644
> --- a/kernel/pm_qos_params.c
> +++ b/kernel/pm_qos_params.c
> @@ -103,11 +103,14 @@ static struct pm_qos_object *pm_qos_array[] = {
>
> static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
> size_t count, loff_t *f_pos);
> +static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
> + size_t count, loff_t *f_pos);
> static int pm_qos_power_open(struct inode *inode, struct file *filp);
> static int pm_qos_power_release(struct inode *inode, struct file *filp);
>
> static const struct file_operations pm_qos_power_fops = {
> .write = pm_qos_power_write,
> + .read = pm_qos_power_read,
> .open = pm_qos_power_open,
> .release = pm_qos_power_release,
> .llseek = noop_llseek,
> @@ -376,6 +379,27 @@ static int pm_qos_power_release(struct inode *inode, struct file *filp)
> }
>
>
> +static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
> + size_t count, loff_t *f_pos)
> +{
> + s32 value;
> + unsigned long flags;
> + struct pm_qos_object *o;
> + struct pm_qos_request_list *pm_qos_req = filp->private_data;;
> +
> + if (!pm_qos_req)
> + return -EINVAL;
> + if (!pm_qos_request_active(pm_qos_req))
> + return -EINVAL;
> +
> + o = pm_qos_array[pm_qos_req->pm_qos_class];
> + spin_lock_irqsave(&pm_qos_lock, flags);
> + value = pm_qos_get_value(o);
> + spin_unlock_irqrestore(&pm_qos_lock, flags);
> +
> + return simple_read_from_buffer(buf, count, f_pos, &value, sizeof(s32));
> +}
> +
> static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
> size_t count, loff_t *f_pos)
> {
>
On Sun, Feb 27, 2011 at 10:36:42PM +0100, Thomas Renninger wrote:
> C0 is known as "busy", "not idle" state.
> X86 "busy polling" state also got renamed from C0
> to "POLL" recently.
> Let's stay consistent with naming to avoid confusions.
>
> Signed-off-by: Thomas Renninger <[email protected]>
> Acked-by: Magnus Damm <[email protected]>
> CC: [email protected]
Fine with me. Applied, thanks.