lkml.org 
[lkml]   [2020]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 4/4] sched/idle: Add debugging bits to validate inconsistency in latency sensitive task calculations
Date
We monitor the task entering/exiting the scheduler, but there might be
unhandled situations which can lead to inconsistent value of the
nr_lat_sensitive counter. This may lead to restricting the use of IDLE
states despite absence of any latency sensitive workload.
Hence, add pr_info() if a negative value of nr_lat_sensitive value is found.

Signed-off-by: Parth Shah <parth@linux.ibm.com>
---
kernel/sched/idle.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 85d72a6e2521..7aa0775e69c0 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -231,6 +231,11 @@ static void cpuidle_idle_call(void)
static void do_idle(void)
{
int cpu = smp_processor_id();
+ int pm_disabled = per_cpu(nr_lat_sensitive, cpu);
+
+ if (pm_disabled < 0)
+ pr_info("Inconsistent value of nr_lat_sensitive counter\n");
+
/*
* If the arch has a polling bit, we maintain an invariant:
*
@@ -263,7 +268,7 @@ static void do_idle(void)
* idle as we know that the IPI is going to arrive right away.
*/
if (cpu_idle_force_poll || tick_check_broadcast_expired() ||
- per_cpu(nr_lat_sensitive, cpu)) {
+ pm_disabled) {
tick_nohz_idle_restart_tick();
cpu_idle_poll();
} else {
--
2.17.2
\
 
 \ /
  Last update: 2020-05-07 15:39    [W:0.199 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site