Skip to content

sched: Diagnostic checks for missing rq clock updates

Matt Fleming linux-next linuxppc-dev lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 33 repliesIn review
  2. v1 RFC5 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Add a check for missing update_rq_clock() before rq_clock_task().

- Address review comments from Yuyang where I messed up the __schedule() ::clock_update_flags manipulation

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7sched/fair: Update the rq clock before detaching taskskernel/sched/fair.c+4 -13 replies
2/7sched/fair: Update rq clock before waking up new taskkernel/sched/fair.c+4 -10 replies
3/7sched/fair: Update rq clock in task_hot()kernel/sched/fair.c+1 -00 replies
4/7sched: Add wrappers for lockdep_(un)pin_lock()kernel/sched/core.c kernel/sched/deadline.c kernel/sched/fair.c +4 more+76 -610 replies
5/7sched/core: Reset RQCF_ACT_SKIP before unpinning rq->lockkernel/sched/core.c+4 -10 replies
6/7sched/fair: Push rq lock pin/unpin into idle_balance()kernel/sched/fair.c+15 -120 replies
7/7sched/core: Add debug code to catch missing update_rq_clock()kernel/sched/core.c kernel/sched/sched.h+77 -1030 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchMatt FlemingBorislav PetkovWanpeng Li
1/7
2/7
3/7
4/7
5/7
6/7
7/7R-b T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/7] sched: Diagnostic checks for missing rq clock updates

There are currently no runtime diagnostic checks for detecting when we have inadvertently missed a call to update_rq_clock() before accessing rq_clock() or rq_clock_task().

The idea in these patches, which came from Peter, is to piggyback on the rq->lock pin/unpin context to detect when we expected (and failed) to see an update to the rq clock. They've already caught a couple of
bugs: see commit b52fad2db5d7 ("sched/fair: Update rq clock before updating nohz CPU load").

All the diagnostic code is guarded by CONFIG_SCHED_DEBUG, but there are minimal changes to __schedule() in patch 5 for the !SCHED_DEBUG case.

Jan and Sergey, Petr asked that you be Cc'd on this series because of the recent issues with using WARN_ON() in the async printk work.

Changes in v2:

- Add a check for missing update_rq_clock() before rq_clock_task().

- Address review comments from Yuyang where I messed up the __schedule() ::clock_update_flags manipulation

Matt Fleming (7):
sched/fair: Update the rq clock before detaching tasks sched/fair: Update rq clock before waking up new task sched/fair: Update rq clock in task_hot()
sched: Add wrappers for lockdep_(un)pin_lock() sched/core: Reset RQCF_ACT_SKIP before unpinning rq->lock sched/fair: Push rq lock pin/unpin into idle_balance() sched/core: Add debug code to catch missing update_rq_clock()

 kernel/sched/core.c      |  92 +++++++++++++++++++++-------------------
 kernel/sched/deadline.c  |  10 ++---
 kernel/sched/fair.c      |  40 +++++++++++-------
 kernel/sched/idle_task.c |   2 +-
 kernel/sched/rt.c        |   6 +--
 kernel/sched/sched.h     | 107 ++++++++++++++++++++++++++++++++++++++++-------
 kernel/sched/stop_task.c |   2 +-
 7 files changed, 177 insertions(+), 82 deletions(-)
Signature · 1 line
2.9.3