From: Thomas Gleixner <tglx@linutronix.de>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] rc2-mm2: unneeded cli/sti in fix-preemption-race patch
Date: Mon, 31 Jan 2005 14:22:25 +0100 [thread overview]
Message-ID: <1107177745.21196.333.camel@tglx.tec.linutronix.de> (raw)
In-Reply-To: <41FE319E.E265C599@tv-sign.ru>
On Mon, 2005-01-31 at 16:24 +0300, Oleg Nesterov wrote:
> 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.
Right. I missed the preempt_stop == cli.
> > +++ 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.
Makes sense.
tglx
> 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
prev parent reply other threads:[~2005-01-31 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-31 13:24 Oleg Nesterov
2005-01-31 13:22 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1107177745.21196.333.camel@tglx.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®