[PATCH] Fix preemption off of irq context on x86-64 with PREEMPT_BKL

Christophe Saout
2005-03-27T00:19:20Z

[-- Attachment #1: Type: text/plain, Size: 989 bytes --]

Hi,

> x86_64-fix-config_preempt.patch
> x86_64: Fix CONFIG_PREEMPT

This patch causes another bug to show up some lines below with
CONFIG_PREEMPT_BKL. schedule releases the BKL which it shouldn't do.

Call preempt_schedule_irq instead (like for i386). This seems to fix the
easily reproducible filesystem errors I've seen (with reiserfs, which
heavily relies on the BKL).

Signed-off-by: Christophe Saout <christophe@saout.de>

--- linux-2.6.12-rc1-mm2.orig/arch/x86_64/kernel/entry.S 2005-03-24 17:32:22.000000000 +0100
+++ linux-2.6.12-rc1-mm2/arch/x86_64/kernel/entry.S 2005-03-26 23:40:30.000000000 +0100
@@ -517,12 +517,7 @@
jnc retint_restore_args
bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */
jnc retint_restore_args
- movl $PREEMPT_ACTIVE,threadinfo_preempt_count(%rcx)
- sti
- call schedule
- cli
- GET_THREAD_INFO(%rcx)
- movl $0,threadinfo_preempt_count(%rcx)
+ call preempt_schedule_irq
jmp exit_intr
#endif
CFI_ENDPROC

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]