Skip to contentSkip to conversation

kexec jump: fix for lockdep

PATCH In review Huang Ying 2 participants 5 messages Aug 8, 2008 – Aug 11, 2008

Subsystems (3)
lore
Share & tools
lore

Huang Ying

author
#0 lore raw

PATCH 6/8 kexec jump: fix for lockdep

Replace local_irq_disable() with raw_local_irq_disable() to prevent lockdep complain.

---
 arch/x86/kernel/machine_kexec_32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/machine_kexec_32.c +1 -1
@@ -123,7 +123,7 @@ void machine_kexec(struct kimage *image)
 	tracer_disable();
 
 	/* Interrupts aren't acceptable while we reboot */
-	local_irq_disable();
+	raw_local_irq_disable();
 
 	if (image->preserve_context) {
 #ifdef CONFIG_X86_IO_APIC

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 2 lines · Huang Ying

Replace local_irq_disable() with raw_local_irq_disable() to prevent lockdep complain.

Uhhm, please provide more information - just using raw_* to silence lockdep is generally the wrong thing to do.

Quoted 20 lines
---
 arch/x86/kernel/machine_kexec_32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/machine_kexec_32.c +1 -2
@@ -123,7 +123,7 @@ void machine_kexec(struct kimage *image)
 	tracer_disable();
 
 	/* Interrupts aren't acceptable while we reboot */
-	local_irq_disable();
+	raw_local_irq_disable();
 
 	if (image->preserve_context) {
 #ifdef CONFIG_X86_IO_APIC
 
 
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

author
#2 lore raw
Quoted 5 lines · Peter Zijlstra
Quoted 2 lines · Huang Ying

Replace local_irq_disable() with raw_local_irq_disable() to prevent lockdep complain.

Uhhm, please provide more information - just using raw_* to silence lockdep is generally the wrong thing to do.

In traditional kexec, the new kernel will replace current one, so the irq is simply disabled. But now jumping back from kexeced kernel is supported, so the irq should be enabled again.

The code sequence of irq during kexec jump is as follow:

local_irq_disable(); /* in kernel_kexec() */
local_irq_disable(); /* in machine_kexec() */
local_irq_enable(); /* in kernel_kexec() */

The disable and enable is not match. Maybe another method is to use local_irq_save(), local_irq_restore() pair in machine_kexec(), so the disable and enable is matched.

Best Regrards,
Huang Ying

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 13 lines · Huang Ying
Quoted 5 lines · Peter Zijlstra
Quoted 2 lines · Huang Ying

Replace local_irq_disable() with raw_local_irq_disable() to prevent lockdep complain.

Uhhm, please provide more information - just using raw_* to silence lockdep is generally the wrong thing to do.

In traditional kexec, the new kernel will replace current one, so the irq is simply disabled. But now jumping back from kexeced kernel is supported, so the irq should be enabled again.

The code sequence of irq during kexec jump is as follow:

Quoted 7 lines

local_irq_disable(); /* in kernel_kexec() */
local_irq_disable(); /* in machine_kexec() */
local_irq_enable(); /* in kernel_kexec() */

The disable and enable is not match. Maybe another method is to use local_irq_save(), local_irq_restore() pair in machine_kexec(), so the disable and enable is matched.

And its the machine kernel's lockdep instance that goes complain?

whichever annotation gets used - and I think I can agree that raw_* might be approriate there, this should be accompanied with a rather elaborate changelog and preferably a comment in the code too. Without such we'll be wondering in the years to come WTH happens here.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

author
#4 lore raw
Quoted 22 lines · Peter Zijlstra
Quoted 13 lines · Huang Ying
Quoted 5 lines · Peter Zijlstra
Quoted 2 lines · Huang Ying

Replace local_irq_disable() with raw_local_irq_disable() to prevent lockdep complain.

Uhhm, please provide more information - just using raw_* to silence lockdep is generally the wrong thing to do.

In traditional kexec, the new kernel will replace current one, so the irq is simply disabled. But now jumping back from kexeced kernel is supported, so the irq should be enabled again.

The code sequence of irq during kexec jump is as follow:

Quoted 7 lines

local_irq_disable(); /* in kernel_kexec() */
local_irq_disable(); /* in machine_kexec() */
local_irq_enable(); /* in kernel_kexec() */

The disable and enable is not match. Maybe another method is to use local_irq_save(), local_irq_restore() pair in machine_kexec(), so the disable and enable is matched.

Quoted 6 lines

And its the machine kernel's lockdep instance that goes complain?

whichever annotation gets used - and I think I can agree that raw_* might be approriate there, this should be accompanied with a rather elaborate changelog and preferably a comment in the code too. Without such we'll be wondering in the years to come WTH happens here.

Sorry, I find there is no complain from lockdep. Un-paired irq disable/enable has no problem with lockdep, just increase something such as "redundant_hardirqs_off". Please ignore this thread.

Best Regards,
Huang Ying

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec