kernel-fxtec-pro1x/drivers/acpi
Alexey Starikovskiy 5f7748cf91 Execute AML Notify() requests on stack.
HP nx6125/nx6325/... machines have a _GPE handler with an infinite
loop sending Notify() events to different ACPI subsystems.

The notify handler in the ACPI thermal driver is a C-routine,
which may invoke the ACPI interpreter again to get access
to some ACPI variables such as temperature.  (acpi_evaluate_xxx)
On these HP machines such an evaluation changes state of an ASL variable
and lets the loop above break.

In the current ACPI implementation, Notify requests are being deferred
to the same kacpid workqueue on which the above GPE handler with
infinite loop is executing. Thus we have a deadlock -- loop will
continue to spin, sending notify events, and at the same time
preventing these notify events from being run on a workqueue. All
notify events are deferred, thus we see explosion in memory consumption.

Also as GPE handling is blocked, machines overheat because ACPI-based
fan control is stalled.  Eventually by external poll of the same
acpi_evaluate, kacpid is released and all the queued notify events are
free to run, thus 100% CPU utilization by kacpid for several seconds
or more.

To prevent this failure,  Linux must not send notify events to the
kacpid workqueue -- either executing them immediately or putting them
on some other thread.

The first attempt to create a new thread was done by Peter Wainwright
He created a bunch of threads, which were stealing work from a kacpid
workqueue.
This patch appeared in 2.6.15-based kernel shipped with Ubuntu 6.06 LTS.

Second attempt was done by Alexey Starikovskiy, who created a new thread
for each Notify event. This worked OK on HP nx machines,
but broke Linus' Compaq n620c, by producing threads with a speed what
they stopped the machine completely.
Thus this patch was reverted from 2.6.18-rc2.

Alexey re-made the patch to create second workqueue just for notify events,
thus hopping it will not break Linus' machine. Patch was tested on the
same HP nx machines in #5534 and #7122, but this broke Linus' machine
also and was reverted from 2.6.19-rc with much fanfair.

The 4th patch inserted schedule_timeout(1) into deferred
execution of kacpid, if we had any notify requests pending, but Linus
decided that it was too complex (involved either changes to workqueue
to see if it's empty or atomic inc/dec).  Then a 5th attempt did a
yield() to every GPE execution.

Finally, this 6th generation patch simply executes the notify handler
on the stack.  Previous attempts to do this simple solution failed
because of issues in AML mutex re-entrancy which are now fixed
by the previous patch in this series.

http://bugzilla.kernel.org/show_bug.cgi?id=5534

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-15 16:13:51 -05:00
..
dispatcher ACPICA: fix AML mutex re-entrancy 2007-02-15 16:13:16 -05:00
events Execute AML Notify() requests on stack. 2007-02-15 16:13:51 -05:00
executer ACPICA: fix AML mutex re-entrancy 2007-02-15 16:13:16 -05:00
hardware ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
namespace [PATCH] x86: fix laptop bootup hang in init_acpi() 2007-02-13 13:26:24 +01:00
parser ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
resources ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
sleep [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
tables ACPICA: reduce table header messages to fit within 80 columns 2007-02-06 15:28:23 -05:00
utilities ACPICA: fix AML mutex re-entrancy 2007-02-15 16:13:16 -05:00
ac.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
acpi_memhotplug.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
asus_acpi.c ACPICA: minimal patch to integrate new tables into Linux 2007-02-02 21:14:22 -05:00
battery.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
bay.c [PATCH] wrong order of kzalloc arguments 2007-02-09 08:28:48 -08:00
blacklist.c ACPICA: Miscellaneous table manager updates and optimizations 2007-02-02 21:14:29 -05:00
bus.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
button.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
cm_sbs.c [PATCH] acpi NULL noise removal 2006-10-10 15:37:22 -07:00
container.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
debug.c ACPI: add ACPI debug attribute in sysfs 2007-01-28 22:33:36 -05:00
dock.c ACPI: dock: check if parent is on dock 2007-02-03 01:11:17 -05:00
ec.c ACPICA: Remove duplicate table definitions (non-conflicting), cont 2007-02-02 21:14:29 -05:00
event.c ACPI: add 'const' to several ACPI file_operations 2006-07-10 00:04:29 -04:00
fan.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
glue.c ACPI: Optimize acpi_get_pci_rootbridge_handle() to boot faster 2007-01-16 16:41:56 -05:00
hotkey.c ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi 2006-10-14 01:51:07 -04:00
i2c_ec.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
i2c_ec.h ACPI: add support for Smart Battery 2006-07-01 16:36:14 -04:00
ibm_acpi.c Revert "ACPI: ibm-acpi: make non-generic bay support optional" 2007-01-11 02:58:15 -05:00
Kconfig Pull trivial into test branch 2007-02-03 01:39:07 -05:00
Makefile Pull motherboard into test branch 2007-02-03 01:38:16 -05:00
numa.c ACPICA: Remove duplicate table definitions (non-conflicting), cont 2007-02-02 21:14:29 -05:00
osl.c Pull motherboard into test branch 2007-02-03 01:38:16 -05:00
pci_bind.c ACPI: fix Supermicro X7DB8+ Boot regression 2006-12-21 03:07:37 -05:00
pci_irq.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
pci_link.c ACPICA: use new ACPI headers. 2007-02-02 21:14:28 -05:00
pci_root.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
power.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
processor_core.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
processor_idle.c ACPICA: fix gcc build warnings 2007-02-02 23:08:40 -05:00
processor_perflib.c ACPICA: use new ACPI headers. 2007-02-02 21:14:28 -05:00
processor_thermal.c ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi 2006-10-14 01:51:07 -04:00
processor_throttling.c ACPICA: use new ACPI headers. 2007-02-02 21:14:28 -05:00
sbs.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
scan.c Pull trivial into test branch 2007-02-03 01:39:07 -05:00
system.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
tables.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
thermal.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
toshiba_acpi.c [PATCH] fix the toshiba_acpi write_lcd return value 2007-01-05 23:55:29 -08:00
utils.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
video.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00