From: Joe Korty <joe.korty@ccur.com>
To: Robert Love <rml@tech9.net>
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: Mon, 14 Apr 2003 18:27:51 -0400 [thread overview]
Message-ID: <20030414222750.GA19050@rudolph.ccur.com> (raw)
In-Reply-To: <1050357642.3664.89.camel@localhost>
On Mon, Apr 14, 2003 at 06:00:42PM -0400, Robert Love wrote:
> 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
I see. It is because the 'goto pick_next_task' skips the
'deactivate_task' call. Therefore the previous task remains on the
run queue in spite of its TASK_UNINTERRUPTIBLE state. Clever!
Joe
next prev parent reply other threads:[~2003-04-14 22:16 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
2003-04-14 22:27 ` Joe Korty [this message]
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=20030414222750.GA19050@rudolph.ccur.com \
--to=joe.korty@ccur.com \
--cc=akpm@digeo.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@tech9.net \
/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