Skip to contentSkip to conversation

Multi-threaded execution of ACPI control methods

RFC PATCH New Peter Wainwright 1 participant 1 message May 3, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 Multi-threaded execution of ACPI control methods

This patch enables multi-threaded execution of ACPI control methods.

Certain machines (e.g. the HP nx6125) require the concurrent execution of several ACPI control methods. Without multithreading, processing of ACPI events will be blocked, causing the machine to overheat and possible damage.

This patch enables, optionally, the multithreaded execution of control methods and fixes http://bugzilla.kernel.org/show_bug.cgi?id=5534.

The required code is compiled into the kernel unconditionally (whenever ACPI is enabled in the kernel config). However, it is only activated by the boot option acpi_pool_size=<positive integer> or echoing a positive integer to /proc/acpi/pool_size.

I would appreciate a review of this code. I have provided a boot time option and a /proc entry to configure this behaviour as an option, because
it surely needs testing before it becomes the default.
I believe it should become default behaviour for the kernel on all platforms,
however, since a careful reading of the ACPI
spec suggests that the behaviour of the nx6125 DSDT is in compliance with
this spec and that any BIOS may potentially require this feature.

Peter

Documentation/kernel-parameters.txt +7 -0
diff -u -r linux-2.6.16.11-prw2-old/Documentation/kernel-parameters.txt linux-2.6.16.11-prw2/Documentation/kernel-parameters.txt
@@ -168,6 +168,13 @@
 			override platform specific driver.
 			See also Documentation/acpi-hotkey.txt.
 
+	acpi_pool_size=	[HW,ACPI]
+			Format: <int>
+			Determines the maximum size of the pool of
+			kernel threads which execute ACPI control
+			methods.  After system has booted up, it can
+			be set via /proc/acpi/pool_size.
+
 	enable_timer_pin_1 [i386,x86-64]
 			Enable PIN 1 of APIC timer
 			Can be useful to work around chipset bugs
drivers/acpi/bus.c +3 -0
diff -u -r linux-2.6.16.11-prw2-old/drivers/acpi/bus.c linux-2.6.16.11-prw2/drivers/acpi/bus.c
@@ -664,6 +664,7 @@
 	int result = 0;
 	acpi_status status = AE_OK;
 	extern acpi_status acpi_os_initialize1(void);
+	extern acpi_status acpi_os_initialize2(void);
 
 	ACPI_FUNCTION_TRACE("acpi_bus_init");
 
@@ -727,6 +728,8 @@
 	 */
 	acpi_root_dir = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL);
 
+	status = acpi_os_initialize2();
+
 	return_VALUE(0);
 
 	/* Mimic structured exception handling */
drivers/acpi/osl.c +169 -2

201 lines not on this page · raw message