public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: michael_soulier@mitel.com
To: linux-kernel@vger.kernel.org
Cc: john_fodor@mitel.com
Subject: wait_event and preemption in 2.6
Date: Fri, 8 Oct 2004 13:45:10 -0400	[thread overview]
Message-ID: <20041008174510.GJ30977@e-smith.com> (raw)


I am sending this on behalf of a coworker who is unfortunate enough to
be using a crappy email client. We are not subscribed to the mailing
list, so please include us in your replies. 

---quote---
Dear kernel folks,

I'm writing a device driver for PPC Linux and I'm using wait_event. It
seems to me that there is a potential race condition in wait_event when
preemption is turned on (2.6 kernel).

The scenario goes something like this: After the waiting process is
woken up and returns from schedule it goes to the top of the loop and
prepares to wait again (despite the condition being true). Then it will
check the condition and break out of the loop. But what if in-kernel
preemption occurs while it's doing that and another process is
immediately scheduled to run? Does the process sleep forever? Assume
that the event (say interrupt) that caused the original wakeup is a one
shot.

I'm probably missing something. I've googled for an answer and asked
some of my Linux friends but it's not clear. Thanks for any replies.
Please cc me.

John
---end---

Thank you,
Mike

--
Michael P. Soulier <michael_soulier@mitel.com>
6000/6010/60* Development, Mitel Networks Corporation
"...the word HACK is used as a verb to indicate a massive amount of nerd-like
effort." -Harley Hahn, A Student's Guide to Unix

             reply	other threads:[~2004-10-08 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08 17:45 michael_soulier [this message]
2004-10-08 20:14 ` wait_event and preemption in 2.6 Robert Love
2004-10-08 20:24 ` Joe Korty

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=20041008174510.GJ30977@e-smith.com \
    --to=michael_soulier@mitel.com \
    --cc=john_fodor@mitel.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