2008-06-21 19:16:48

by Vegard Nossum

[permalink] [raw]
Subject: v2.6.26-rc7: Negative powertop values

Hi,

I was testing v2.6.26-rc7 by running lmbench and hotplug/-unplugging
CPUs and a few other programs at the same time. Powertop was showing a
negative number of wakeups/second and average C3 residency was
something really insane. Is there anything strange with this schedstat
file, or is there another file I should look at that can explain the
strange powertop numbers? Or maybe it's just an artifact of powertop
and this has nothing to do with the kernel?

powertop:

Cn Avg residency P-states (frequencies)
C0 (cpu running) (105.5%) 1467 Mhz 80.7%
C1 0.0ms ( 0.0%) 1067 Mhz 0.4%
C2 0.0ms ( 0.0%) 800 Mhz 19.0%
C3 0.0ms (1288344194138.5%)

Wakeups-from-idle per second : -6.2 interval: 2.0s


# cat /proc/schedstat
version 14
timestamp 811305
cpu0 0 0 0 545 0 5733898 257804 3325833 3064649 6916730262519
21980606970853 5438836
domain0 <NULL> 1514 1081 425 452096 12 10 0 1081 91 91 0 0 0 0 0
91 5916 4168 1715 1859096 34 13 4 4164 4 0 4 0 0 0 0 0 0 1013 18883 0
cpu1 0 0 0 1279 0 12508366 1294362 7173738 6484092 1515315020607
22231002791887 11146865
domain0 <NULL> 313 219 88 154083 10 3 0 219 104 104 0 527 0 0 0
104 1077 894 163 467031 41 5 0 894 1 0 1 0 0 0 0 0 0 455 14689 0


Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036


2008-06-21 21:16:37

by Arjan van de Ven

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

On Sat, 21 Jun 2008 21:16:37 +0200
"Vegard Nossum" <[email protected]> wrote:

> Hi,
>
> I was testing v2.6.26-rc7 by running lmbench and hotplug/-unplugging
> CPUs and a few other programs at the same time. Powertop was showing a
> negative number of wakeups/second and average C3 residency was
> something really insane. Is there anything strange with this schedstat
> file, or is there another file I should look at that can explain the
> strange powertop numbers? Or maybe it's just an artifact of powertop
> and this has nothing to do with the kernel?

powertop doesn't assume you do cpu hotunplug (and the internal state
goes wacky if you do).

[I assume you know that doing a software unplug you burn more power
than by leaving the cpu idle]


--
If you want to reach me at my work email, use [email protected]
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2008-06-21 21:22:30

by Vegard Nossum

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

On Sat, Jun 21, 2008 at 11:16 PM, Arjan van de Ven
<[email protected]> wrote:
> On Sat, 21 Jun 2008 21:16:37 +0200
> "Vegard Nossum" <[email protected]> wrote:
>> I was testing v2.6.26-rc7 by running lmbench and hotplug/-unplugging
>> CPUs and a few other programs at the same time. Powertop was showing a
>> negative number of wakeups/second and average C3 residency was
>> something really insane. Is there anything strange with this schedstat
>> file, or is there another file I should look at that can explain the
>> strange powertop numbers? Or maybe it's just an artifact of powertop
>> and this has nothing to do with the kernel?
>
> powertop doesn't assume you do cpu hotunplug (and the internal state
> goes wacky if you do).
>

Oh right :-) Are there any plans to support this?

> [I assume you know that doing a software unplug you burn more power
> than by leaving the cpu idle]

Well, yeah, this was purely to exercise the kernel a bit, IOW testing.
I guess this can be signed off as a non-kernel issue, then. Thanks for
the quick reply!


Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036

2008-07-08 13:38:44

by Pavel Machek

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

On Sat 2008-06-21 14:16:15, Arjan van de Ven wrote:
> On Sat, 21 Jun 2008 21:16:37 +0200
> "Vegard Nossum" <[email protected]> wrote:
>
> > Hi,
> >
> > I was testing v2.6.26-rc7 by running lmbench and hotplug/-unplugging
> > CPUs and a few other programs at the same time. Powertop was showing a
> > negative number of wakeups/second and average C3 residency was
> > something really insane. Is there anything strange with this schedstat
> > file, or is there another file I should look at that can explain the
> > strange powertop numbers? Or maybe it's just an artifact of powertop
> > and this has nothing to do with the kernel?
>
> powertop doesn't assume you do cpu hotunplug (and the internal state
> goes wacky if you do).
>
> [I assume you know that doing a software unplug you burn more power
> than by leaving the cpu idle]

We should really fix that one day...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2008-07-08 13:53:07

by Arjan van de Ven

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

On Sun, 6 Jul 2008 21:48:45 +0200
Pavel Machek <[email protected]> wrote:

> >
> > [I assume you know that doing a software unplug you burn more power
> > than by leaving the cpu idle]
>
> We should really fix that one day...

yeah but it's incredibly hard to get right (in the light of the bios
constantly changing what our allowed C-states are)... and the best case
is equal to just being idle.

--
If you want to reach me at my work email, use [email protected]
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2008-07-13 11:57:42

by Pavel Machek

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

On Tue 2008-07-08 06:52:51, Arjan van de Ven wrote:
> On Sun, 6 Jul 2008 21:48:45 +0200
> Pavel Machek <[email protected]> wrote:
>
> > >
> > > [I assume you know that doing a software unplug you burn more power
> > > than by leaving the cpu idle]
> >
> > We should really fix that one day...
>
> yeah but it's incredibly hard to get right (in the light of the bios
> constantly changing what our allowed C-states are)... and the best case

What can happen there? So BIOS decides C4 may no longer be cool idea
because we have AC power now, but that does not mean C4 stops working,
right?

How is changing allowed C-states list supposed to work, anyway? I
mean, we may be in one of those on other CPU when BIOS decides to
change the list...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2008-07-13 15:36:18

by Arjan van de Ven

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

Pavel Machek wrote:
> On Tue 2008-07-08 06:52:51, Arjan van de Ven wrote:
>> On Sun, 6 Jul 2008 21:48:45 +0200
>> Pavel Machek <[email protected]> wrote:
>>
>>>> [I assume you know that doing a software unplug you burn more power
>>>> than by leaving the cpu idle]
>>> We should really fix that one day...
>> yeah but it's incredibly hard to get right (in the light of the bios
>> constantly changing what our allowed C-states are)... and the best case
>
> What can happen there? So BIOS decides C4 may no longer be cool idea
> because we have AC power now, but that does not mean C4 stops working,
> right?

or it decides that your voltage regulator needs to operate in a certain mode and the voltage for C4 is no longer
available. or .. or ...

>
> How is changing allowed C-states list supposed to work, anyway? I
> mean, we may be in one of those on other CPU when BIOS decides to
> change the list...

you get an interrupt to notify you of the change ;-)

2008-07-13 15:37:33

by Arjan van de Ven

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

Pavel Machek wrote:
> On Tue 2008-07-08 06:52:51, Arjan van de Ven wrote:
>> On Sun, 6 Jul 2008 21:48:45 +0200
>> Pavel Machek <[email protected]> wrote:
>>
>>>> [I assume you know that doing a software unplug you burn more power
>>>> than by leaving the cpu idle]
>>> We should really fix that one day...
>> yeah but it's incredibly hard to get right (in the light of the bios
>> constantly changing what our allowed C-states are)... and the best case
>
> What can happen there? So BIOS decides C4 may no longer be cool idea
> because we have AC power now, but that does not mean C4 stops working,
> right?

it's also the other way around; you put the sleepy core in C4 because C6 is not available;
then C6 becomes available and the sleepy core is wasting power;

Either way, the *best* case you get is to be equal to being idle.....

2008-07-14 06:26:17

by Pavel Machek

[permalink] [raw]
Subject: Re: v2.6.26-rc7: Negative powertop values

On Sun 2008-07-13 08:35:59, Arjan van de Ven wrote:
> Pavel Machek wrote:
>> On Tue 2008-07-08 06:52:51, Arjan van de Ven wrote:
>>> On Sun, 6 Jul 2008 21:48:45 +0200
>>> Pavel Machek <[email protected]> wrote:
>>>
>>>>> [I assume you know that doing a software unplug you burn more power
>>>>> than by leaving the cpu idle]
>>>> We should really fix that one day...
>>> yeah but it's incredibly hard to get right (in the light of the bios
>>> constantly changing what our allowed C-states are)... and the best case
>>
>> What can happen there? So BIOS decides C4 may no longer be cool idea
>> because we have AC power now, but that does not mean C4 stops working,
>> right?
>
> or it decides that your voltage regulator needs to operate in a certain mode and the voltage for C4 is no longer
> available. or .. or ...
>
>>
>> How is changing allowed C-states list supposed to work, anyway? I
>> mean, we may be in one of those on other CPU when BIOS decides to
>> change the list...
>
> you get an interrupt to notify you of the change ;-)

But that's too late, right? You may be actively using that Cstate on
another CPU...
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html