linux/include/acpi
Thomas Gleixner 0a7992c908 acpi: fix bogus preemption logic
The ACPI_PREEMPTION_POINT() logic was introduced in commit 8bd108d
(ACPICA: add preemption point after each opcode parse).  The follow up
commits abe1dfab6, 138d15692, c084ca70 tried to fix the preemption logic
back and forth, but nobody noticed that the usage of
in_atomic_preempt_off() in that context is wrong.

The check which guards the call of cond_resched() is:

    if (!in_atomic_preempt_off() && !irqs_disabled())

in_atomic_preempt_off() is not intended for general use as the comment
above the macro definition clearly says:

 * Check whether we were atomic before we did preempt_disable():
 * (used by the scheduler, *after* releasing the kernel lock)

On a CONFIG_PREEMPT=n kernel the usage of in_atomic_preempt_off() works by
accident, but with CONFIG_PREEMPT=y it's just broken.

The whole purpose of the ACPI_PREEMPTION_POINT() is to reduce the latency
on a CONFIG_PREEMPT=n kernel, so make ACPI_PREEMPTION_POINT() depend on
CONFIG_PREEMPT=n and remove the in_atomic_preempt_off() check.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16210

[akpm@linux-foundation.org: fix build]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Len Brown <lenb@kernel.org>
Cc: Francois Valenduc <francois.valenduc@tvcablenet.be>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:29 -07:00
..
platform acpi: fix bogus preemption logic 2010-08-12 08:43:29 -07:00
acexcep.h ACPICA: Fix namestring associated with AE_NO_HANDLER exception 2010-06-12 00:54:36 -04:00
acnames.h ACPICA: Update all ACPICA copyrights and signons to 2010 2010-01-22 12:30:05 -05:00
acoutput.h ACPICA: Update debug output components 2010-07-06 22:34:27 -04:00
acpi_bus.h ACPI: pci_root: save downstream bus range 2010-04-04 00:29:41 -04:00
acpi_drivers.h ACPI: pci_root: pass acpi_pci_root to arch-specific scan 2010-04-04 00:29:53 -04:00
acpi_numa.h ACPI: misc cleanups 2008-02-07 03:33:23 -05:00
acpi.h ACPICA: Update all ACPICA copyrights and signons to 2010 2010-01-22 12:30:05 -05:00
acpiosxf.h ACPICA: Update/clarify some parameter names associated with acpi_handle 2010-05-06 03:05:54 -04:00
acpixf.h ACPI / ACPICA: Do not execute _PRW methods during initialization 2010-07-12 14:17:39 -04:00
acrestyp.h ACPICA: Remove obsolete ACPI_INTEGER (acpi_integer) type 2010-01-22 12:30:06 -05:00
actbl1.h ACPICA: Update all ACPICA copyrights and signons to 2010 2010-01-22 12:30:05 -05:00
actbl2.h ACPICA: Add support for WDDT - Watchdog Descriptor Table 2010-07-06 22:34:27 -04:00
actbl.h ACPICA: Update all ACPICA copyrights and signons to 2010 2010-01-22 12:30:05 -05:00
actypes.h ACPICA: Drop acpi_set_gpe 2010-07-06 22:34:27 -04:00
apei.h ACPI, APEI, Error Record Serialization Table (ERST) support 2010-05-19 22:41:31 -04:00
atomicio.h ACPI, IO memory pre-mapping and atomic accessing 2010-05-19 11:40:03 -04:00
button.h ACPI: make ACPI button funcs no-ops if not built in 2009-09-17 14:48:23 -07:00
container.h [ACPI] Lindent all ACPI files 2005-08-05 00:45:14 -04:00
hed.h ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
pdc_intel.h ACPI: Enable bit 11 in _PDC to advertise hw coord 2009-02-07 00:41:14 -05:00
processor.h ACPI: skip checking BM_STS if the BIOS doesn't ask for it 2010-07-22 16:54:27 -04:00
reboot.h Add the ability to reset the machine using the RESET_REG in ACPI's FADT table. 2008-07-16 23:27:08 +02:00
video.h ACPI: Export EDID blocks to the kernel 2010-04-19 15:56:32 -04:00