linux/drivers/acpi/apei
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
..
apei-base.c acpi: update gfp/slab.h includes 2010-06-28 10:19:19 +10:00
apei-internal.h ACPI, APEI, UEFI Common Platform Error Record (CPER) header 2010-05-19 22:41:05 -04:00
cper.c ACPI, APEI, UEFI Common Platform Error Record (CPER) header 2010-05-19 22:41:05 -04:00
einj.c ACPI, APEI, EINJ injection parameters support 2010-05-19 22:42:08 -04:00
erst.c acpi: fix bogus preemption logic 2010-08-12 08:43:29 -07:00
ghes.c ACPI, APEI, Generic Hardware Error Source memory error support 2010-05-19 22:41:16 -04:00
hest.c
Kconfig ACPI, APEI, Generic Hardware Error Source memory error support 2010-05-19 22:41:16 -04:00
Makefile ACPI, APEI, Error Record Serialization Table (ERST) support 2010-05-19 22:41:31 -04:00