From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Strange delay on PCI-DMA-transfer completion by wait_event_interruptible()
Date: Tue, 13 Dec 2005 20:13:17 -0600 [thread overview]
Message-ID: <439F7FBD.60300@shaw.ca> (raw)
In-Reply-To: <5jnfV-2xy-577@gated-at.bofh.it>
linux-os (Dick Johnson) wrote:
> Every time somebody wants to rewrite a macro, they declare that the
> previous one had some race condition. If, in fact, you have only
> one DMA occurring from your device then no race is possible with
> interruptible_sleep_on(). wait_event_interruptible() is the same thing
> but with an additional access to some memory variable, possibly
> causing a cache refill which means it might take more time.
This is not correct. Using interruptible_sleep_on, there is no way to
prevent the race where the condition being waited on happens between the
test to see if it has become true and calling interruptible_sleep_on.
wait_event_interruptible puts the caller into the wait queue before
testing the condition, which prevents the race.
interruptible_sleep_on is, with good reason, no longer recommended for use.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2005-12-14 2:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5jeNG-740-1@gated-at.bofh.it>
[not found] ` <5jnfV-2xy-577@gated-at.bofh.it>
2005-12-14 2:13 ` Robert Hancock [this message]
[not found] <5jzIB-3pY-5@gated-at.bofh.it>
2005-12-15 1:22 ` Strange delay on PCI-DMA-transfer completion by wait_event_interruptible() Robert Hancock
2005-12-14 7:59 Burkhard Schölpen
2005-12-14 14:12 ` linux-os (Dick Johnson)
-- strict thread matches above, loose matches on Subject: below --
2005-12-13 9:29 Burkhard Schölpen
2005-12-13 14:27 ` linux-os (Dick Johnson)
2005-12-12 18:14 Burkhard Schölpen
2005-12-12 20:14 ` linux-os (Dick Johnson)
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=439F7FBD.60300@shaw.ca \
--to=hancockr@shaw.ca \
--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