Skip to contentSkip to conversation

Strange delay on PCI-DMA-transfer completion by wait_event_interruptible()

DISCUSSION Robert Hancock 1 participant 1 message Dec 14, 2005 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 6 lines · linux-os (Dick Johnson)

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.

Signature · 3 lines
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/