Skip to contentSkip to conversation

avr32: Fixup kprobes preemption handling.

PATCH In review Paul Mundt 2 participants 3 messages Dec 1, 2006

lore
Share & tools
lore

Paul Mundt

author
#0 lore raw

PATCH 1/1 avr32: Fixup kprobes preemption handling.

While working on SH kprobes, I noticed that avr32 got the preemption handling wrong in the no probe case. The idea is that upon entry of kprobe_handler() preemption is disabled outright across the life of the kprobe, only to be re-enabled in post_kprobe_handler().

However, in the event that the probe is never activated, there's never any chance of hitting the post probe handler, which allows for the current avr32 implementation to disable preemption indefinitely, as it's currently missing a re-enable when no probe is activated.

Patch follows.

--

arch/avr32/kernel/kprobes.c +1 -0
index ca41fc1..d0abbca 100644
@@ -154,6 +154,7 @@ ss_probe:
 	return 1;
 
 no_kprobe:
+	preempt_enable_no_resched();
 	return ret;
 }
author
#1 lore raw
Quoted 5 lines · Paul Mundt

While working on SH kprobes, I noticed that avr32 got the preemption handling wrong in the no probe case. The idea is that upon entry of kprobe_handler() preemption is disabled outright across the life of the kprobe, only to be re-enabled in post_kprobe_handler().

Quoted 7 lines

However, in the event that the probe is never activated, there's never any chance of hitting the post probe handler, which allows for the current avr32 implementation to disable preemption indefinitely, as it's currently missing a re-enable when no probe is activated.

Patch follows.

And that's of course..

#2 lore raw
In reply to Paul Mundt
Quoted 9 lines · On Fri, 1 Dec 2006 16:50:50 +0900 Paul Mundt <[email protected]> wrote:

While working on SH kprobes, I noticed that avr32 got the preemption handling wrong in the no probe case. The idea is that upon entry of kprobe_handler() preemption is disabled outright across the life of the kprobe, only to be re-enabled in post_kprobe_handler().

However, in the event that the probe is never activated, there's never any chance of hitting the post probe handler, which allows for the current avr32 implementation to disable preemption indefinitely, as it's currently missing a re-enable when no probe is activated.

You're absolutely right. Thanks for the patch, I've added it to my tree.

Håvard