Messages in this thread | | | Date | Fri, 19 Aug 2011 17:07:12 -0300 | From | Henrique de Moraes Holschuh <> | Subject | Re: [PATCH 04/16] freezer: implement and use kthread_freezable_should_stop() |
| |
On Fri, 19 Aug 2011, Tejun Heo wrote: > Writeback and thinkpad_acpi have been using thaw_process() to prevent > deadlock between the freezer and kthread_stop(); unfortunately, this > is inherently racy - nothing prevents freezing from happening between > thaw_process() and kthread_stop(). > > This patch implements kthread_freezable_should_stop() which enters > refrigerator if necessary but is guaranteed to return if > kthread_stop() is invoked. Both thaw_process() users are converted to > use the new function. > > Note that this deadlock condition exists for many of freezable > kthreads. They need to be converted to use the new should_stop or > freezable workqueue. > > Tested with synthetic test case. > > Signed-off-by: Tejun Heo <tj@kernel.org> > Cc: Jens Axboe <axboe@kernel.dk> > Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
For the thinkpad-acpi bits: Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
-- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh
| |