Re: [PATCH RESEND 2/3 v2.6.39-rc7] block: make disk_block_events()properly wait for work cancellation
From: Linus Torvalds
Date: Tue May 17 2011 - 11:16:39 EST
On Tue, May 17, 2011 at 8:11 AM, Tejun Heo <tj@xxxxxxxxxx> 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...
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?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/