linux/drivers
Alexey Starikovskiy 88db5e1489 ACPI: created a dedicated workqueue for notify() execution
HP nx6125/nx6325/... machines have a _GPE handler with an infinite
loop sending Notify() events to different ACPI subsystems.

Notify handler in ACPI driver is a C-routine, which may call ACPI
interpreter again to get access to some ACPI variables
(acpi_evaluate_xxx).
On these HP machines such an evaluation changes state of some 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 increase in memory consumption
noticed by author of the thread. Also as GPE handling is bloked,
machines overheat. 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 all these horrors it's needed to not put notify events to
kacpid workqueue by either executing them immediately or putting them
on some other thread. It's dangerous to execute notify events in
place, as it will put several ACPI interpreter stacks on top of each
other (at least 4 in case of nx6125), thus causing kernel  stack
overflow.

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 kernel shipped with Ubuntu 6.06 LTS.

Second attempt was done by me, I 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 18-rc2 as I remember.
I 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 I did not received reply
from Linus on a test patch sent to him.
Patch went to 19-rc and was rejected with much fanfare again.
There was 4th patch, which 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).
Now you see last variant which adds yield() to every GPE execution.

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

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-09 23:31:03 -04:00
..
acorn [ARM] Acorn: move the i2c bus driver into drivers/i2c 2007-03-04 20:40:50 +00:00
acpi ACPI: created a dedicated workqueue for notify() execution 2007-05-09 23:31:03 -04:00
amba uevent: use add_uevent_var() instead of open coding it 2007-04-27 10:57:29 -07:00
ata libata: fix kernel-doc parameters 2007-05-09 20:15:47 -04:00
atm PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
auxdisplay [PATCH] cfag12864b: fix crash when built-in and no parport present 2007-02-20 17:10:14 -08:00
base Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-05-09 12:54:17 -07:00
block Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-05-09 12:54:17 -07:00
bluetooth [Bluetooth] Correct SCO buffer for another Broadcom based dongle 2007-05-05 00:36:22 +02:00
cdrom mm: remove destroy_dirty_buffers from invalidate_bdev() 2007-05-07 12:12:55 -07:00
char Merge git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2007-05-09 13:38:45 -07:00
clocksource ACPI: correct pathname in comment 2007-04-25 14:27:06 -04:00
connector [NETLINK]: Switch cb_lock spinlock to mutex and allow to override it 2007-04-25 22:29:03 -07:00
cpufreq Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
crypto Fix trivial typos in Kconfig* files 2007-05-09 07:12:20 +02:00
dio [PATCH] hp300: fix driver_register() return handling, remove dio_module_init() 2006-03-25 08:22:53 -08:00
dma [PATCH] rm pointless dmaengine exports 2007-03-16 19:25:03 -07:00
edac Fix 82875 PCI setup 2007-05-08 11:15:07 -07:00
eisa virtual_eisa_root_init() should be __init 2007-05-08 11:15:02 -07:00
fc4 [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
firmware remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
hid header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
hwmon Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
i2c PM: Separate hibernation code from suspend code 2007-05-09 12:30:48 -07:00
ide Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6 2007-05-09 15:41:31 -07:00
ieee1394 Fix occurrences of "the the " 2007-05-09 08:57:56 +02:00
infiniband Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
input Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input 2007-05-08 11:51:43 -07:00
isdn misc doc and kconfig typos 2007-05-09 08:58:15 +02:00
kvm Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
leds fix file specification in comments 2007-05-09 08:58:16 +02:00
macintosh Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6 2007-05-09 15:41:31 -07:00
mca mca: add integrated device bus matching 2007-05-09 12:30:49 -07:00
md Revert "md: improve partition detection in md array" 2007-05-09 18:51:36 -07:00
media misc doc and kconfig typos 2007-05-09 08:58:15 +02:00
message misc doc and kconfig typos 2007-05-09 08:58:15 +02:00
mfd header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
misc disable socket power in adapter driver instead of media one 2007-05-08 22:41:47 +02:00
mmc mmc build fix 2007-05-09 12:30:44 -07:00
mtd Merge git://git.infradead.org/mtd-2.6 2007-05-09 13:10:11 -07:00
net Merge branch 'usb-move' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 2007-05-09 18:53:12 -07:00
nubus Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
oprofile [PATCH] oprofile: fix potential deadlock on oprofilefs_lock 2007-03-28 13:58:02 -07:00
parisc header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
parport parport_serial: fix PCI must_checks 2007-05-08 11:15:08 -07:00
pci Fix more "deprecated" spellos. 2007-05-09 07:19:14 +02:00
pcmcia fix hotplug for legacy platform drivers 2007-05-08 11:15:10 -07:00
pnp PNP: workaround HP BIOS defect that leaves SMCF010 device partly enabled 2007-05-08 11:15:23 -07:00
ps3 Merge branch 'linux-2.6' 2007-05-08 13:37:51 +10:00
rapidio [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
rtc Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6 2007-05-09 13:08:20 -07:00
s390 Fix occurrences of "the the " 2007-05-09 08:57:56 +02:00
sbus Fix misspellings collected by members of KJ list. 2007-05-09 07:14:03 +02:00
scsi Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6 2007-05-09 15:41:31 -07:00
serial Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-05-08 11:50:19 -07:00
sh [PATCH] Add superhyway_bus_type probe and remove methods 2006-01-13 11:26:09 -08:00
sn [PATCH] IOC3/IOC4: PCI mem space resources 2007-02-11 10:51:25 -08:00
spi atmel_spi: remove unnecessary (and wrong) #ifdefs 2007-05-09 12:30:50 -07:00
tc [PATCH] Fix build error on zs serial driver 2007-04-04 21:12:47 -07:00
telephony replace pci_find_device in drivers/telephony/ixj.c 2007-05-08 11:15:02 -07:00
usb Move USB network drivers to drivers/net/usb. 2007-05-09 21:31:55 -04:00
video Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-05-09 12:54:17 -07:00
w1 Driver for the Maxim DS1WM, a 1-wire bus master ASIC core 2007-05-08 11:15:14 -07:00
zorro Amiga Zorro bus: kill resource_size_t warnings 2007-05-04 17:59:08 -07:00
Kconfig [PATCH] drivers: add LCD support 2007-02-11 10:51:24 -08:00
Makefile i2c: Add i2c_board_info and i2c_new_device() 2007-05-01 23:26:31 +02:00