From: Ingo Molnar <mingo@elte.hu>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 2.6.10-mm2] Use the new preemption code [2/3] Resend
Date: Mon, 10 Jan 2005 12:02:52 +0100 [thread overview]
Message-ID: <20050110110252.GA1605@elte.hu> (raw)
In-Reply-To: <1105351977.3058.2.camel@lap02.tec.linutronix.de>
* Thomas Gleixner <tglx@linutronix.de> wrote:
> > Are you sure ARM suffers from this race condition? It sets preempt count
> > before enabling IRQs and doesn't use preempt_schedule().
>
> There is no race for arm, but using the preempt_schedule() interface
> is the approach which Ingo suggested for common usage, but his x86
> implementation was racy, so I fixed this first before modifying arm to
> use the interface. Ingo pointed out that he will change it to
> preempt_schedule_irq, but I'm not religious about the name.
i wouldnt raise this issue if it was the name only, but there's more to
preempt_schedule_irq() than its name: it gets called with irqs off and
the scheduler returns with irqs off and with a guarantee that there is
no (irq-generated) pending preemption request for this task right now.
I.e. the checks for need_resched can be skipped, and interrupts dont
have to be disabled to do a safe return-to-usermode (as done on some
architectures).
as far as i can see do_preempt_schedule() doesnt have these properties:
what it guarantees is that it avoids the preemption recursion via the
lowlevel code doing the PREEMPT_ACTIVE setting.
lets agree upon a single, common approach. I went for splitting up
preempt_schedule() into two variants: the 'synchronous' one (called
preempt_schedule()) is only called from syscall level and has no
repeat-preemption and hence stack-recursion worries. The 'asynchronous'
one (called preempt_schedule_irq()) is called from asynchronous contexts
(hardirq events) and is fully ready to deal with all the reentrancy
situations that may occur. It's careful about not re-enabling
interrupts, etc.
Ingo
next prev parent reply other threads:[~2005-01-10 11:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-10 0:35 [PATCH 2.6.10-mm2] Fix preemption race [1/3] (Core) tglx
2005-01-10 0:53 ` [PATCH 2.6.10-mm2] Use the new preemption code [2/3] Thomas Gleixner
2005-01-10 1:06 ` Russell King
2005-01-10 1:18 ` [PATCH 2.6.10-mm2] Use the new preemption code [2/3] Resend Thomas Gleixner
2005-01-10 7:32 ` Andrew Morton
2005-01-10 10:57 ` Thomas Gleixner
2005-01-10 9:46 ` Russell King
2005-01-10 10:12 ` Thomas Gleixner
2005-01-10 11:02 ` Ingo Molnar [this message]
2005-01-10 13:46 ` Thomas Gleixner
2005-01-10 1:00 ` [PATCH 2.6.10-mm2] Use the new preemption code [3/3] Thomas Gleixner
2005-01-10 14:56 ` Tom Rini
2005-01-10 15:49 ` tglx
2005-01-10 9:15 ` [PATCH 2.6.10-mm2] Fix preemption race [1/3] (Core) Ingo Molnar
2005-01-10 10:14 ` Thomas Gleixner
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=20050110110252.GA1605@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).