[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210401133917.171523833@infradead.org>
Date: Thu, 01 Apr 2021 15:10:14 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: joel@...lfernandes.org, chris.hyser@...cle.com, joshdon@...gle.com,
mingo@...nel.org, vincent.guittot@...aro.org,
valentin.schneider@....com, mgorman@...e.de
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org, tj@...nel.org,
tglx@...utronix.de
Subject: [PATCH 2/9] sched: Implement core-sched assertions
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
kernel/sched/core.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -268,18 +268,24 @@ static void __sched_core_flip(bool enabl
cpus_read_unlock();
}
-static void __sched_core_enable(void)
+static void sched_core_assert_empty(void)
{
- // XXX verify there are no cookie tasks (yet)
+ int cpu;
+
+ for_each_possible_cpu(cpu)
+ WARN_ON_ONCE(!RB_EMPTY_ROOT(&cpu_rq(cpu)->core_tree));
+}
+static void __sched_core_enable(void)
+{
static_branch_enable(&__sched_core_enabled);
__sched_core_flip(true);
+ sched_core_assert_empty();
}
static void __sched_core_disable(void)
{
- // XXX verify there are no cookie tasks (left)
-
+ sched_core_assert_empty();
__sched_core_flip(false);
static_branch_disable(&__sched_core_enabled);
}
Powered by blists - more mailing lists