From: Robert Love <rml@tech9.net>
To: Joe Korty <joe.korty@ccur.com>
Cc: Andrew Morton <akpm@digeo.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] 2.5 TASK_INTERRUPTIBLE preemption race
Date: 14 Apr 2003 18:00:42 -0400 [thread overview]
Message-ID: <1050357642.3664.89.camel@localhost> (raw)
In-Reply-To: <20030414215410.GA18922@rudolph.ccur.com>
On Mon, 2003-04-14 at 17:54, Joe Korty wrote:
> Is this analysis correct? If it is, perhaps there is an alternative
> to fixing these cases individually: make the TASK_INTERRUPTIBLE/
> TASK_UNINTERRUPTIBLE states block preemption. In which case the
> 'set_current_state(TASK_RUNNING)' macro would need to include the
> same preemption check as 'preemption_enable'.
Thankfully you are wrong or we would have some serious problems :)
See kernel/sched.c :: preempt_schedule() where we set p->preempt_count
to PREEMPT_ACTIVE.
Then see kernel/sched.c :: schedule() where we short-circuit the
remove-from-runqueue code if PREEMPT_ACTIVE is set.
Thus, it is safe to preempt regardless of the task's state. It will
eventually reschedule.
Robert Love
next prev parent reply other threads:[~2003-04-14 21:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-14 21:54 [RFC] 2.5 TASK_INTERRUPTIBLE preemption race Joe Korty
2003-04-14 22:00 ` Robert Love [this message]
2003-04-14 22:27 ` Joe Korty
2003-04-14 22:30 ` Robert Love
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=1050357642.3664.89.camel@localhost \
--to=rml@tech9.net \
--cc=akpm@digeo.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=joe.korty@ccur.com \
--cc=linux-kernel@vger.kernel.org \
/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