Messages in this thread | | | Date | Tue, 3 Feb 2015 23:56:42 +0100 | From | Joerg Roedel <> | Subject | Re: [PATCH] iommu/amd: Fix amd_iommu_free_device() |
| |
Hi Linus,
On Tue, Feb 03, 2015 at 11:23:44AM -0800, Linus Torvalds wrote: > The linux wakeup model has always been that there can be multiple > sources of wakeup events, and the proper way to wait for something is > generally a variation of > > prepare_to_wait(..); > for (;;) { > set_task_state(..); > .. test for condition and break out .. > schedule() > } > finish_wait() > > although obviously these days we *heavily* favor the "wait_event()" > interfaces that encapsulate something that looks like that loop and > makes for a much simpler programming model. We should basically never > favor the open-coded version, because it's so easy to get it wrong.
Thanks for your explanations. I was aware that there could be spurious wakeups for TASK_INTERRUPTIBLE sleeps, but thought that this couldn't happen for TASK_UNINTERRUPTIBLE. I didn't know about the lockless wakeups and their implications, but now the Peters patch makes total sense.
That these spurious wakeup situations are so unlikely also explains why they were not yet reported to me :)
Joerg
| |