[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110518110732.GW20624@htj.dyndns.org>
Date: Wed, 18 May 2011 13:07:32 +0200
From: Tejun Heo <tj@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Jens Axboe <axboe@...nel.dk>, Sitsofe Wheeler <sitsofe@...oo.com>,
Borislav Petkov <bp@...en8.de>, Meelis Roos <mroos@...ux.ee>,
Andrew Morton <akpm@...ux-foundation.org>,
Kay Sievers <kay.sievers@...y.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND 2/3 v2.6.39-rc7] block: make disk_block_events()
properly wait for work cancellation
On Wed, May 18, 2011 at 12:04:51PM +0200, Tejun Heo wrote:
> Yeap, the problem was unblock/check being allowed to be called without
> sleeping context, which isn't used anymore and was broken due to
> cancellation race. We can just enclose the whole thing inside per-ev
> mutex and everything should be simple and fine. I'll post patches
> soon.
Oops, spoke too soon. Converting to mutex creates a circular
dependency. disk_block_events() acquires ev->lock and waits for
ev->dwork to finish, but ev->dwork also needs to acquire ev->lock to
update event states. So, no matter how we twist this, we need two
locks or a lock and a completion. The mutex approach seems simple
enough, so I suggest leaving it like that.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists