All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Touch kernel watchdog with sched count
@ 2020-10-20 20:57 Xi Wang
  2020-10-20 20:57 ` [PATCH v2 1/1] sched: watchdog: " Xi Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Xi Wang @ 2020-10-20 20:57 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: Thomas Gleixner, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Josh Don, linux-kernel, Xi Wang

The main purpose of kernel watchdog is to test whether scheduler can
still schedule tasks on a cpu. In order to reduce latency / jitter
from periodically invoking watchdog reset in thread context, we can
simply test if pick_next_task can run. This is done by forcing resched
and checking rq->sched_count. Compared to actually resetting watchdog
from cpu stop / migration threads, we lose coverage on: a migration
thread actually get picked and we actually context switch to the
migration thread. These steps are unlikely to silently fail. The
change would provide nearly the same level of protection with less
overhead.

With this patch we can still switch back to the old method with the
boot option watchdog_touch_with_thread. However code for the old
method can be completely removed in the future.


v2:
 - Use sched_count instead of having sched calling into watchdog code
 - Remove the sysctl and add a boot option, which can be removed later
 - Changed the subject line
  


Xi Wang (1):
  sched: watchdog: Touch kernel watchdog with sched count

 include/linux/sched.h |  4 ++++
 kernel/sched/core.c   | 23 ++++++++++++++++++++--
 kernel/sched/sched.h  |  6 +++++-
 kernel/watchdog.c     | 44 +++++++++++++++++++++++++++++++++++++------
 4 files changed, 68 insertions(+), 9 deletions(-)

-- 
2.29.0.rc1.297.gfa9743e501-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-10-21 23:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 20:57 [PATCH v2 0/1] Touch kernel watchdog with sched count Xi Wang
2020-10-20 20:57 ` [PATCH v2 1/1] sched: watchdog: " Xi Wang
2020-10-21  9:59   ` Peter Zijlstra
2020-10-21 10:12   ` Peter Zijlstra
2020-10-21 10:24     ` Peter Zijlstra
2020-10-21 11:11       ` Peter Zijlstra
2020-10-21 23:48     ` Xi Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.