Skip to content

improve handling of errors returned by kthread_park()

Ulrich Obergfell lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5watchdog: fix error handling in proc_watchdog_thresh()kernel/watchdog.c+4 -31 reply
2/5watchdog: move watchdog_disable_all_cpus() outside of ifdefkernel/watchdog.c+5 -32 replies
3/5watchdog: implement error handling in update_watchdog_all_cpus() and callerskernel/watchdog.c+23 -71 reply
4/5watchdog: implement error handling in lockup_detector_suspend()kernel/watchdog.c+5 -01 reply
5/5watchdog: do not unpark threads in watchdog_park_threads() on errorkernel/watchdog.c+6 -41 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAaron TomlinDon Zickus
SeriesA-b
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] improve handling of errors returned by kthread_park()

The original watchdog_park_threads() function that was introduced by commit 81a4beef91ba4a9e8ad6054ca9933dff7e25ff28 takes a very simple approach to handle errors returned by kthread_park(): It attempts to roll back all watchdog threads to the unparked state. However, this may be undesired behaviour from the perspective of the caller which may want to handle errors as appropriate in its specific context. Currently, there are two possible call chains:

- watchdog suspend/resume interface

lockup_detector_suspend
watchdog_park_threads

- write to parameters in /proc/sys/kernel

proc_watchdog_update
watchdog_enable_all_cpus
update_watchdog_all_cpus
watchdog_park_threads

Instead of 'blindly' attempting to unpark the watchdog threads if a kthread_park() call fails, the new approach is to disable the lockup detectors in the above call chains. Failure becomes visible to the user as follows:

- error messages from lockup_detector_suspend()
or watchdog_enable_all_cpus()

- the state that can be read from /proc/sys/kernel/watchdog_enabled

- the 'write' system call in the latter call chain returns an error

Ulrich Obergfell (5):
watchdog: fix error handling in proc_watchdog_thresh()
watchdog: move watchdog_disable_all_cpus() outside of ifdef
watchdog: implement error handling in update_watchdog_all_cpus() and
callers
watchdog: implement error handling in lockup_detector_suspend()
watchdog: do not unpark threads in watchdog_park_threads() on error

 kernel/watchdog.c | 60 +++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 43 insertions(+), 17 deletions(-)
Signature · 1 line
1.7.11.7