mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rc2-mm2: unneeded cli/sti in fix-preemption-race patch
@ 2005-01-31 13:24 Oleg Nesterov
  2005-01-31 13:22 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2005-01-31 13:24 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, Ingo Molnar, Andrew Morton

Hello.

Thomas Gleixner wrote:
>
> The patch prevents this by leaving interrupts disabled and calling
> a seperate function preempt_schedule_irq().

sched-fix-preemption-race-core-i386.patch:
>
>	+++ 25-akpm/arch/i386/kernel/entry.S
>	@@ -189,6 +189,7 @@ ENTRY(resume_userspace)
>	 
>	 #ifdef CONFIG_PREEMPT
>	 ENTRY(resume_kernel)
>	+	cli

I think this 'cli' is unneeded. resume_kernel: is used on
return path from do_IRQ() which leaves interrupts disabled.
irq_desc->handler->end() should not enable interrupts, yes?

And we have preempt_stop==cli in ret_from_exception: case,
before ret_from_intr.

>	+++ 25-akpm/kernel/sched.c
>	@@ -2872,6 +2872,48 @@ need_resched:
>	...
>	+asmlinkage void __sched preempt_schedule_irq(void)
>	+{
>	...
>	+	local_irq_enable();
>	+	schedule();

It is ok to enter schedule() with interrupts disabled, so this
'sti' seems to be unneeded too.

Am I missed something?

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.11-rc2-mm2/arch/i386/kernel/entry.S~	Mon Jan 31 14:09:37 2005
+++ 2.6.11-rc2-mm2/arch/i386/kernel/entry.S	Mon Jan 31 14:55:25 2005
@@ -189,7 +189,6 @@ ENTRY(resume_userspace)
 
 #ifdef CONFIG_PREEMPT
 ENTRY(resume_kernel)
-	cli
 	cmpl $0,TI_preempt_count(%ebp)	# non-zero preempt_count ?
 	jnz restore_all
 need_resched:
--- 2.6.11-rc2-mm2/kernel/sched.c~	Mon Jan 31 14:09:54 2005
+++ 2.6.11-rc2-mm2/kernel/sched.c	Mon Jan 31 14:57:44 2005
@@ -2971,7 +2971,6 @@ need_resched:
 	saved_lock_depth = task->lock_depth;
 	task->lock_depth = -1;
 #endif
-	local_irq_enable();
 	schedule();
 	local_irq_disable();
 #ifdef CONFIG_PREEMPT_BKL

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-31 13:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-31 13:24 [PATCH] rc2-mm2: unneeded cli/sti in fix-preemption-race patch Oleg Nesterov
2005-01-31 13:22 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®