LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-21-2009, 08:06 AM   #1
Olaus
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: Slackware64 14.2
Posts: 126

Rep: Reputation: 17
C2 state used much more than C3 when computer seems to be idling


According to powertop, when the system seems to be idling (at least according to the top command):
Code:
Cn                Avg residency                     
C0 (cpu running)        ( 2,6%)                     
polling           0,0ms ( 0,0%)                     
C1 mwait          0,0ms ( 0,0%)                     
C2 mwait          5,3ms (79,9%)                     
C3 mwait          3,1ms (17,4%)
And
Code:
Top causes for wakeups:                                
  35,8% ( 94,1)     <kernel core> : hrtimer_start_range_ns (tick_sched_timer) 
  23,4% ( 61,7)       <interrupt> : uhci_hcd:usb2, uhci_hcd:usb8, nvidia      
  10,1% ( 26,6)      <kernel IPI> : Rescheduling interrupts                   
   6,6% ( 17,4)     <kernel core> : hrtimer_start (tick_sched_timer)
Anything I can do about the kernel core interrupts?
The processor is a Pentium Dual-Core T4200
 
Old 10-24-2009, 05:33 AM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
Are you using a kernel compiled by yourself? You should have "tickless system" enabled for power efficiency, maybe that's the point. The flag is called "TICK_ONESHOT", look for it in /proc/config.gz (e.g. run "zgrep TICK_ONESHOT /proc/config.gz")
 
Old 10-26-2009, 01:46 AM   #3
Olaus
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: Slackware64 14.2
Posts: 126

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by clvic View Post
Are you using a kernel compiled by yourself? You should have "tickless system" enabled for power efficiency, maybe that's the point. The flag is called "TICK_ONESHOT", look for it in /proc/config.gz (e.g. run "zgrep TICK_ONESHOT /proc/config.gz")
Unfortunately:
Code:
zgrep TICK_ONESHOT /proc/config.gz
CONFIG_TICK_ONESHOT=y
So, I guess the problem lies somewhere else.
 
Old 10-29-2009, 01:37 PM   #4
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
Uhm, have you tried unplugging all USB devices? I recall that USB devices cause the system to stay in higher C states... try, let's see if this is the reason
 
Old 10-30-2009, 05:05 AM   #5
Olaus
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: Slackware64 14.2
Posts: 126

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by clvic View Post
Uhm, have you tried unplugging all USB devices? I recall that USB devices cause the system to stay in higher C states... try, let's see if this is the reason
Thank you for the tip! With USB unplugged:
Code:
Cn                Avg residency                     
C0 (cpu running)        ( 2,1%)                     
polling           0,0ms ( 0,0%)                     
C1 mwait          0,0ms ( 0,0%)                     
C2 mwait          1,6ms ( 0,4%)                     
C3 mwait          6,8ms (97,5%)
Unfortunately, it is nice to have the external keyboard attached to the laptop, so I guess this is something that I will have to live with. The extra power consumption is OK since the laptop is stationary anyway then.
Is there some way to lower the USB polling frequency/priority?
 
Old 10-31-2009, 07:14 PM   #6
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
I know of no way to lower USB pressure on buses and CPU... maybe we could ask someone else.
But, you could use a PS2 keyboard, or use the same keyboard with a USB-PS2 adaptor... maybe ps2 makes less pressure on C states.
 
Old 10-31-2009, 08:32 PM   #7
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Hi.

What kind of chipset is on your motherboard?
I had the same problem and I solve it by tweak some registry with "pcitweak".
 
Old 11-02-2009, 06:30 AM   #8
Olaus
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: Slackware64 14.2
Posts: 126

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by nimnull22 View Post
Hi.

What kind of chipset is on your motherboard?
I had the same problem and I solve it by tweak some registry with "pcitweak".
Code:
lspci -v (somewhat edited)                              
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)                                                                   
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, fast devsel, latency 0                               
        Capabilities: [e0] Vendor Specific Information <?>                      
        Kernel modules: intel-agp                                               

00:01.0 PCI bridge: Intel Corporation Mobile 4 Series Chipset PCI Express Graphics Port (rev 07) (prog-if 00 [Normal decode])                                   
        Flags: bus master, fast devsel, latency 0                               
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0            
        I/O behind bridge: 00002000-00002fff                                    
        Memory behind bridge: cc000000-ceffffff                                 
        Prefetchable memory behind bridge: 00000000d0000000-00000000dfffffff    
        Capabilities: [88] Subsystem: Acer Incorporated [ALI] Device 0253       
        Capabilities: [80] Power Management version 3                           
        Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-              
        Capabilities: [a0] Express Root Port (Slot+), MSI 00                    
        Capabilities: [100] Virtual Channel <?>                                 
        Capabilities: [140] Root Complex Link <?>                               
        Kernel driver in use: pcieport-driver                                   
        Kernel modules: shpchp                                                  

00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03) (prog-if 00 [UHCI])                                              
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 16                     
        I/O ports at 1800 [size=32]                                             
        Capabilities: [50] PCI Advanced Features                                
        Kernel driver in use: uhci_hcd                                          
        Kernel modules: uhci-hcd                                                

00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03) (prog-if 00 [UHCI])                                              
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 21                     
        I/O ports at 1820 [size=32]                                             
        Capabilities: [50] PCI Advanced Features                                
        Kernel driver in use: uhci_hcd                                          
        Kernel modules: uhci-hcd                                                

00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03) (prog-if 20 [EHCI])                                             
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 19                     
        Memory at f0404800 (32-bit, non-prefetchable) [size=1K]                 
        Capabilities: [50] Power Management version 2                           
        Capabilities: [58] Debug port: BAR=1 offset=00a0                        
        Capabilities: [98] PCI Advanced Features                                
        Kernel driver in use: ehci_hcd                                          
        Kernel modules: ehci-hcd                                                
                                          
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03) (prog-if 00 [Normal decode])                                             
        Flags: bus master, fast devsel, latency 0                               
        Bus: primary=00, secondary=02, subordinate=04, sec-latency=0            
        Capabilities: [40] Express Root Port (Slot+), MSI 00                    
        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-              
        Capabilities: [90] Subsystem: Acer Incorporated [ALI] Device 0253       
        Capabilities: [a0] Power Management version 2                           
        Capabilities: [100] Virtual Channel <?>                                 
        Capabilities: [180] Root Complex Link <?>                               
        Kernel driver in use: pcieport-driver                                   
        Kernel modules: shpchp                                                  

00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03) (prog-if 00 [Normal decode])                                             
        Flags: bus master, fast devsel, latency 0                               
        Bus: primary=00, secondary=07, subordinate=07, sec-latency=0            
        Memory behind bridge: c0000000-c00fffff                                 
        Capabilities: [40] Express Root Port (Slot+), MSI 00                    
        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-              
        Capabilities: [90] Subsystem: Acer Incorporated [ALI] Device 0253       
        Capabilities: [a0] Power Management version 2                           
        Capabilities: [100] Virtual Channel <?>                                 
        Capabilities: [180] Root Complex Link <?>                               
        Kernel driver in use: pcieport-driver                                   
        Kernel modules: shpchp                                                  

00:1c.5 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 6 (rev 03) (prog-if 00 [Normal decode])                                             
        Flags: bus master, fast devsel, latency 0                               
        Bus: primary=00, secondary=09, subordinate=09, sec-latency=0            
        I/O behind bridge: 00003000-00003fff                                    
        Memory behind bridge: c0100000-c01fffff                                 
        Capabilities: [40] Express Root Port (Slot+), MSI 00                    
        Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-              
        Capabilities: [90] Subsystem: Acer Incorporated [ALI] Device 0253       
        Capabilities: [a0] Power Management version 2                           
        Capabilities: [100] Virtual Channel <?>                                 
        Capabilities: [180] Root Complex Link <?>                               
        Kernel driver in use: pcieport-driver                                   
        Kernel modules: shpchp                                                  

00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03) (prog-if 00 [UHCI])                                              
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 23                     
        I/O ports at 1840 [size=32]                                             
        Capabilities: [50] PCI Advanced Features                                
        Kernel driver in use: uhci_hcd                                          
        Kernel modules: uhci-hcd                                                

00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03) (prog-if 00 [UHCI])                                              
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 19                     
        I/O ports at 1860 [size=32]                                             
        Capabilities: [50] PCI Advanced Features                                
        Kernel driver in use: uhci_hcd                                          
        Kernel modules: uhci-hcd                                                

00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03) (prog-if 00 [UHCI])                                              
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 18                     
        I/O ports at 1880 [size=32]                                             
        Capabilities: [50] PCI Advanced Features                                
        Kernel driver in use: uhci_hcd                                          
        Kernel modules: uhci-hcd                                                

00:1d.3 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03) (prog-if 00 [UHCI])                                              
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 16                     
        I/O ports at 18a0 [size=32]                                             
        Capabilities: [50] PCI Advanced Features                                
        Kernel driver in use: uhci_hcd                                          
        Kernel modules: uhci-hcd                                                

00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03) (prog-if 20 [EHCI])                                             
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, medium devsel, latency 0, IRQ 23                     
        Memory at f0404c00 (32-bit, non-prefetchable) [size=1K]                 
        Capabilities: [50] Power Management version 2                           
        Capabilities: [58] Debug port: BAR=1 offset=00a0                        
        Capabilities: [98] PCI Advanced Features                                
        Kernel driver in use: ehci_hcd                                          
        Kernel modules: ehci-hcd                                                

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) (prog-if 01 [Subtractive decode])                                                        
        Flags: bus master, fast devsel, latency 0                               
        Bus: primary=00, secondary=0a, subordinate=0a, sec-latency=0            
        Capabilities: [50] Subsystem: Acer Incorporated [ALI] Device 0253       

00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
        Subsystem: Acer Incorporated [ALI] Device 0253                       
        Flags: bus master, medium devsel, latency 0                          
        Capabilities: [e0] Vendor Specific Information <?>                   

00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03) (prog-if 01 [AHCI 1.0])                                                      
        Subsystem: Acer Incorporated [ALI] Device 0253                          
        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 28              
        I/O ports at 18f0 [size=8]                                              
        I/O ports at 18e4 [size=4]                                              
        I/O ports at 18e8 [size=8]                                              
        I/O ports at 18e0 [size=4]                                              
        I/O ports at 18c0 [size=32]                                             
        Memory at f0404000 (32-bit, non-prefetchable) [size=2K]                 
        Capabilities: [80] MSI: Enable+ Count=1/16 Maskable- 64bit-             
        Capabilities: [70] Power Management version 3                           
        Capabilities: [a8] SATA HBA <?>                                         
        Capabilities: [b0] PCI Advanced Features                                
        Kernel driver in use: ahci                                              

00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
        Subsystem: Acer Incorporated [ALI] Device 0253                         
        Flags: medium devsel, IRQ 19                                           
        Memory at c0200000 (64-bit, non-prefetchable) [size=256]               
        I/O ports at 1c00 [size=32]                                            
        Kernel modules: i2c-i801
I am not really sure, is the motherboard chip maybe Intel Corporation 82801I (ICH9 Family)?
 
Old 11-02-2009, 07:59 AM   #9
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
lspci | grep Intel, please
 
Old 11-02-2009, 08:44 AM   #10
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
And another thing.
Unplug any usb devices, measure C1, C2, C3 and then plug USB mouse, and measure C2, C3. Do they behave the same ?

If so try to find on your laptop web site any BIOS updates for low power consumption.
 
Old 11-02-2009, 09:52 AM   #11
Olaus
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: Slackware64 14.2
Posts: 126

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by nimnull22 View Post
lspci | grep Intel, please
Search for Intel in my post above, that will yield the same result.
 
Old 11-02-2009, 09:53 AM   #12
Olaus
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: Slackware64 14.2
Posts: 126

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by nimnull22 View Post
And another thing.
Unplug any usb devices, measure C1, C2, C3 and then plug USB mouse, and measure C2, C3. Do they behave the same ?

If so try to find on your laptop web site any BIOS updates for low power consumption.
Check out what I did in the post from Oct 30th for the answer to that question.
 
Old 11-02-2009, 10:05 AM   #13
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
OK.

Check in your system or find somewhere "pcitweak" size 35016 b.

From Intel ICH9 Family Datasheet:

..."To take advantage of the Deferred C3/C4 mode, the BM_STS_ZERO_EN bit must be
set. This will cause the BM_STS bit to read as 0 even if some bus master activity is
present. If this is not done, then the software may avoid even attempting to go to the
C3 or C4 state if it sees the BM_STS bit as 1."...
And
..." the ICH9 enables a mode of operation where standard (non-isochronous) bus master activity will not be treated as a full break event from the C3 or C4 states. Instead, these will be treated merely as
bus master events and return the platform to a C2 state, and thus allow snoops to be performed."...
 
Old 11-02-2009, 10:37 AM   #14
Olaus
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: Slackware64 14.2
Posts: 126

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by nimnull22 View Post
OK.

Check in your system or find somewhere "pcitweak" size 35016 b.

From Intel ICH9 Family Datasheet:

..."To take advantage of the Deferred C3/C4 mode, the BM_STS_ZERO_EN bit must be
set. This will cause the BM_STS bit to read as 0 even if some bus master activity is
present. If this is not done, then the software may avoid even attempting to go to the
C3 or C4 state if it sees the BM_STS bit as 1."...
And
..." the ICH9 enables a mode of operation where standard (non-isochronous) bus master activity will not be treated as a full break event from the C3 or C4 states. Instead, these will be treated merely as
bus master events and return the platform to a C2 state, and thus allow snoops to be performed."...
Ok, where do I find this utility? I have googled, but found nothing.
 
Old 11-02-2009, 12:20 PM   #15
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
I have upload it to http://www.filefactory.com/file/a081...file372053_zip

To open it type where necessary "$pcitw$", without " ".
Copy it to /usr/bin and try to execute: under root type "pcitweak -l", if it works it shows all PCI devices.
Give me some time to find out how to look what we need.
 
  


Reply

Tags
powertop


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set deadeyes Linux - Server 14 07-29-2009 04:30 AM
not work: iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 3306 -j DROP abefroman Linux - Security 1 07-18-2007 08:19 AM
LXer: State by state, Microsoft responds to creeping threat LXer Syndicated Linux News 0 05-01-2007 07:16 AM
My KDE keeps idling and apps take forever to load. crashes on InitSystemServices too. Blinky Linux - Software 2 10-20-2006 01:49 AM
ssh becomes unresponsive after several minutes of idling k4zau Linux - Software 4 10-27-2004 09:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration