Messages in this thread | | | From | Linus Torvalds <> | Date | Tue, 17 May 2011 08:15:38 -0700 | Subject | Re: [PATCH RESEND 2/3 v2.6.39-rc7] block: make disk_block_events() properly wait for work cancellation |
| |
On Tue, May 17, 2011 at 8:11 AM, Tejun Heo <tj@kernel.org> wrote: > > Heh, okay. It's not a lock tho. It's multiple waiter waiting for a > single event - so either explicit waitqueue or completion. I was > doing a waitqueue but bit waitqueue didn't seem to add too much > complexity, so...
No.
Semantically what it is is a LOCK.
Turning it into something else just screws up everything. It just means you have to have ANOTHER lock to protect the things that the completion/waitqueue would use.
Don't f*&^ around. Just make it a lock, and don't do a "lock+completion " or something crazy.
If you can do it with a completion but with no locking, go ahead. I doubt you can. You want the locking for the whole "do I need to wait for the completion" thing anyway, so why mess things up?
Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |