[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160921133813.31976-1-matt@codeblueprint.co.uk>
Date: Wed, 21 Sep 2016 14:38:06 +0100
From: Matt Fleming <matt@...eblueprint.co.uk>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>
Cc: Byungchul Park <byungchul.park@....com>,
Frederic Weisbecker <fweisbec@...il.com>,
Luca Abeni <luca.abeni@...tn.it>,
Rik van Riel <riel@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Wanpeng Li <wanpeng.li@...mail.com>,
Yuyang Du <yuyang.du@...el.com>,
Petr Mladek <pmladek@...e.com>, Jan Kara <jack@...e.cz>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
linux-kernel@...r.kernel.org,
Mel Gorman <mgorman@...hsingularity.net>,
Mike Galbraith <umgwanakikbuti@...il.com>,
Matt Fleming <matt@...eblueprint.co.uk>
Subject: [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(-)
--
2.9.3
Powered by blists - more mailing lists