Bug 6944

Summary: kacpid eats 80%-100% CPU.
Product: ACPI Reporter: miraj_shah (miraj)
Component: ACPICA-CoreAssignee: acpi_aml-interpreter
Status: REJECTED INVALID    
Severity: normal CC: acpi-bugzilla, akkzilla
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.17-gentoo-r4 Subsystem:
Regression: --- Bisected commit-id:
Attachments: output from acpidump
output of dmesg -s40000
output from dmidecode.txt
output from proc/interrupts
output of lspci
update AC state after a resume

Description miraj_shah 2006-08-02 08:49:51 UTC
Most recent kernel where this bug did not occur:
Distribution:Gentoo Linux.

Hardware Environment:HP-Compaq nx6110 Notebook

Software Environment:
uname -a
Linux scrat 2.6.17-gentoo-r4 #3 SMP Wed Aug 2 16:58:15 EAT 2006 i686 Intel(R)
Pentium(R) M processor 1.60GHz GNU/Linux



Problem Description:
kacpid runs at 100% cpu usage. Computer Overheats (can almost fry an egg :-p )

Output from top:
Tasks:  85 total,   7 running,  78 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.0% us, 99.0% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:    248024k total,   236008k used,    12016k free,    10980k buffers
Swap:   498952k total,      280k used,   498672k free,   101492k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
   10 root      20  -5     0    0    0 R 98.6  0.0  26:15.18 kacpid
 1443 root      15   0 23112  14m 6580 R  1.0  6.1   0:25.67 X
10107 miraj     15   0  2120 1104  840 R  0.3  0.4   0:00.02 top
    1 root      15   0  1484  512  444 S  0.0  0.2   0:01.51 init
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    3 root      34  19     0    0    0 R  0.0  0.0   0:00.00 ksoftirqd/0
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
    5 root      10  -5     0    0    0 S  0.0  0.0   0:01.54 events/0
    6 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
    7 root      13  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
    9 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/0
  101 root      10  -5     0    0    0 S  0.0  0.0   0:00.04 kseriod
  104 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khubd
  157 root      15   0     0    0    0 S  0.0  0.0   0:00.06 pdflush
  158 root      15   0     0    0    0 S  0.0  0.0   0:00.02 pdflush
  159 root      15   0     0    0    0 S  0.0  0.0   0:00.25 kswapd0
  160 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0
  777 root      12  -5     0    0    0 S  0.0  0.0   0:00.00 kpsmoused
 1610 root      15   0     0    0    0 S  0.0  0.0   0:00.00 khpsbpkt
 1682 root      15   0     0    0    0 S  0.0  0.0   0:00.00 knodemgrd_0
 2064 root      10  -5     0    0    0 S  0.0  0.0   0:00.18 kjournald
 2754 root      13  -4  1712  532  332 S  0.0  0.2   0:00.43 udevd
 8010 root      24   0     0    0    0 S  0.0  0.0   0:00.00 pccardd
 9757 root      15   0  1724  580  420 S  0.0  0.2   0:00.01 syslog-ng
 9797 root      25   0  1472  476  408 S  0.0  0.2   0:00.00 acpid



Steps to reproduce:
Compile ACPI in kernel, reboot, compile anything else...
Remove ACPI and problem goes away.
Comment 1 Diego Calleja 2006-08-02 12:14:38 UTC
More info is needed:

"please include the following:
    * The output from dmesg -s40000 or the serial console log
    * The output from dmidecode, available in /usr/sbin/ or at
savannah.nongnu.org or at kernel.org
    * The output from acpidump, available in /usr/sbin/ or in the PM Tools at
kernel.org
    * Please attach the output from lspci -vv and cat /proc/interrupts"
Comment 2 Len Brown 2006-08-02 18:41:22 UTC
please try CONFIG_ACPI_THERMAL=n and see if you can still reproduce this issue.
Comment 3 miraj_shah 2006-08-03 02:34:57 UTC
Created attachment 8686 [details]
output from acpidump
Comment 4 miraj_shah 2006-08-03 03:09:47 UTC
Created attachment 8687 [details]
output of dmesg -s40000
Comment 5 miraj_shah 2006-08-03 03:11:08 UTC
Created attachment 8688 [details]
output from dmidecode.txt
Comment 6 miraj_shah 2006-08-03 03:12:18 UTC
Created attachment 8689 [details]
output from proc/interrupts
Comment 7 miraj_shah 2006-08-03 03:14:15 UTC
Created attachment 8690 [details]
output of lspci
Comment 8 miraj_shah 2006-08-03 03:22:45 UTC
ill try CONFIG_ACPI_THERMAL=n; and shall revert back to you later.

i recompiled the kernel like this and it has not given me problems. its probably
one of the modules thats causing this. thanks for all the help though...

miraj.

#
# ACPI (Advanced Configuration and Power Interface) Support
#
CONFIG_ACPI=y
# CONFIG_ACPI_AC is not set
# CONFIG_ACPI_BATTERY is not set
CONFIG_ACPI_BUTTON=m
# CONFIG_ACPI_VIDEO is not set
# CONFIG_ACPI_HOTKEY is not set
# CONFIG_ACPI_FAN is not set
# CONFIG_ACPI_PROCESSOR is not set
# CONFIG_ACPI_ASUS is not set
# CONFIG_ACPI_IBM is not set
# CONFIG_ACPI_TOSHIBA is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_X86_PM_TIMER is not set
# CONFIG_ACPI_CONTAINER is not set

Comment 9 miraj_shah 2006-08-03 04:41:22 UTC
No guys, CONFIG_ACPI_THERMAL=n has not helped...

it actually acts up when i start compiling anything else. it still runs at those
cpu %ages even after whatever im compiling finishes...

my mistake, also happens in the previous config i posted earlier. 

Comment 10 miraj_shah 2006-08-07 06:02:16 UTC
Hi All. I dont know what ive done. but it seems to be behaving now. i installed
quite a number of applications and it seems to be working, like
gnome-power-manager, acpid and laptop-mode-tools and many others not sure which
one actually worked... hmmmmm, how can i file this as a problem between the
computer and the chair? :-P

I shall monitor this for a while. its been almost an hour since it has not gone
gaga on me.

Thanks for your help.

Miraj.
Comment 11 Lukasz Andrzejak 2007-01-08 07:57:58 UTC
Problem still valid, reproduced under
Linux integral 2.6.19.1 #1 PREEMPT Thu Jan 4 23:16:06 CET 2007 i686 GNU/Linux
Same notebook model (just under debian - etch).

Used to happen under 2.6.16, 2.6.18 and 2.6.17.
It starts acting up whenever doing a cpu intensive task, keeps going for a good
while and stops without any apparent reason.
A reboot fixes the problem (temporarly), as does disabling acpi on boot (this
fixes it for good, but obvoiusly doesnt count as a fix, does it ? :) ).
Bugfixes suggested in this report dont help.

Requesting this bug to be reopened, or a working description of a configuration
change be provided (since its marked 'invalid' i assume this is not a true bug,
and there is a solution available somewhere).
Comment 12 Alexey Starikovskiy 2007-01-08 08:20:07 UTC
please try patch from bug #5534
Comment 13 Lukasz Andrzejak 2007-01-08 10:51:55 UTC
Thanks for the quick reply Alexey, this looks like it might do the trick.
But it doesnt compile with 2.6.19.1 with:

drivers/acpi/osl.c: In function 'acpi_os_execute_notify':
drivers/acpi/osl.c:589: error: 'struct acpi_os_dpc' has no member named 'work'
drivers/acpi/osl.c:589: warning: type defaults to 'int' in declaration of '__mptr'
drivers/acpi/osl.c:589: warning: initialization from incompatible pointer type
drivers/acpi/osl.c:589: error: 'struct acpi_os_dpc' has no member named 'work'
drivers/acpi/osl.c:668:50: error: macro "INIT_WORK" requires 3 arguments, but
only 2 given
drivers/acpi/osl.c: In function 'acpi_os_execute':
drivers/acpi/osl.c:668: error: 'INIT_WORK' undeclared (first use in this function)
drivers/acpi/osl.c:668: error: (Each undeclared identifier is reported only once
drivers/acpi/osl.c:668: error: for each function it appears in.)
drivers/acpi/osl.c:669: error: 'struct acpi_os_dpc' has no member named 'work'
drivers/acpi/osl.c:674:52: error: macro "INIT_WORK" requires 3 arguments, but
only 2 given
drivers/acpi/osl.c:675: error: 'struct acpi_os_dpc' has no member named 'work'
drivers/acpi/osl.c:620: warning: unused variable 'task'

Also - the last chunk in the patch failed, and a most were moved.
But thats something minor that i can actually handle :)
To the point:
would it be too much if i asked for a working one ?
This is really bothersome, and forces me to reboot my laptop frequently.

Any help will be greatly appreciated (should you guys want to test anything on
this brand/model machine, just let me know, im fine with it as long as swsusp
works on that kernel :P).

Cheers,
Lukasz
Comment 14 Alexey Starikovskiy 2007-01-08 10:57:11 UTC
Latest patch in 5534 is for 2.6.20 kernel, for your 19 you should use patch 
from #180 commit, sorry for not telling you earlier :)
Comment 15 Lukasz Andrzejak 2007-01-08 11:12:46 UTC
Thx alot :D
Here goes... hopefully - something.
Patch applied, already running the patched kernel.
Ill get back once this happens again, or in a week if it doesnt (i expect it to
happen at least once every 24 hours, but lets be safe - im adding it to my
organizer now :) ).
Thanks again for the quick responce :)
Comment 16 Lukasz Andrzejak 2007-01-09 08:33:10 UTC
Well, still no love, it just happend again after waking the laptop from sleep
(induced by acpitool -S).
Something has changed thou:
kacpid is eating 60% of my resources, while kacpi_notify is chewing away happily
at the rest of them (cpu load is 90-100% again).
Sadly - the bug is not resolved(nor is it invalid).
Comment 17 miraj_shah 2007-01-09 09:48:51 UTC
hi, i made this invalid as it can be resolved without tinkering with the kernel. 

install laptop-mode-tools (and/or) laptop-detect for your distribution (apt-get
install laptop-mode-tools laptop-detect)?

i switched from gentoo linux to ubuntu (evolution-exchange is a better
experience on ubuntu from what i think) on the same laptop and this problem has
gone.

im currently on Linux kernel version 2.6.17-10.

let me know if this helps. oh.... the trickest part to install is the wireless
drivers. let me know if u need help.

miraj.
Comment 18 Alexey Starikovskiy 2007-01-09 10:06:13 UTC
Well, resume of your machine should be fixed in #7122.  
Comment 19 Lukasz Andrzejak 2007-01-12 14:54:51 UTC
Hi,
sadly - no love.
It just happend again with a kernel with the 7122 patches applied.
In fact, it seems to be happening faster after a wakeup the previously, and
happens almost every time.
Im thinking the pattern occurs when i put the laptop to sleep with the AC still
plugged in and wake it up without the AC.
laptop-mode and laptop-detect did nothing usefull.
I already have wifi via ndiswrapper, and it happens regardless if i have the
module loaded or not (i checked this a couple of times).

Ideas ? More info needed ? Should i start a new bug ? (its still the same
problem as i understand it).
Comment 20 Zhang Rui 2007-01-14 18:58:49 UTC
Created attachment 10082 [details]
update AC state after a resume

>Im thinking the pattern occurs when i put the laptop to sleep with the AC
>still plugged in and wake it up without the AC.
This sounds interesting.
Maybe update the AC state after a resume will make some difference.
Can you have a test with this patch? :)
Comment 21 Björn Lindqvist 2007-07-02 11:07:52 UTC
This problem just hit me after upgrading from Ubuntu Edgy (2.6.17) to Feisty (2.6.20-16-generic). The symptoms are the same, kacpid takes 2/3'ds of the cpu and kacpi_notify takes the rest.

There are lots of other Ubuntu users with the same problem:
http://ubuntuforums.org/showthread.php?t=462057
https://bugs.launchpad.net/ubuntu/+source/acpi/+bug/75174
Comment 22 Akkana Peck 2007-07-03 15:21:11 UTC
Since this bug report seems to have been rejected though there's clearly a bug here, head on over to bug 8274, which is still open and covers the same problem.