summaryrefslogtreecommitdiff
path: root/kernel/freezer.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-11-23 09:28:16 -0800
committerTejun Heo <tj@kernel.org>2011-11-23 09:28:16 -0800
commitadfa543e7314b36ac55a40019977de6e47946dd7 (patch)
treeff307bc785d28f77783676b117ae89559668bd4e /kernel/freezer.c
parentec012476af73a1a8a82565a915e9b48c2e337878 (diff)
downloadlwn-adfa543e7314b36ac55a40019977de6e47946dd7.tar.gz
lwn-adfa543e7314b36ac55a40019977de6e47946dd7.zip
dmatest: don't use set_freezable_with_signal()
Commit 981ed70d8e (dmatest: make dmatest threads freezable) made dmatest kthread use set_freezable_with_signal(); however, the interface is scheduled to be removed in the next merge window. The problem is that unlike userland tasks there's no default place which handles signal pending state and it isn't clear who owns and/or is responsible for clearing TIF_SIGPENDING. For example, in the current code, try_to_freeze() clears TIF_SIGPENDING but it isn't sure whether it actually owns the TIF_SIGPENDING nor is it race-free - ie. the task may continue to run with TIF_SIGPENDING set after the freezable section. Unfortunately, we don't have wait_for_completion_freezable_timeout(). This patch open codes it and uses wait_event_freezable_timeout() instead and removes timeout reloading - wait_event_freezable_timeout() won't return across freezing events (currently racy but fix scheduled) and timer doesn't decrement while the task is in freezer. Although this does lose timer-reset-over-freezing, given that timeout is supposed to be long enough and failure to finish inside is considered irrecoverable, I don't think this is worth the complexity. While at it, move completion to outer scope and explain that we're ignoring dangling pointer problem after timeout. This should give slightly better chance at avoiding oops after timeout. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Dan Williams <dan.j.williams@intel.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'kernel/freezer.c')
0 files changed, 0 insertions, 0 deletions