All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	RT-users <linux-rt-users@vger.kernel.org>,
	Carsten Emde <C.Emde@osadl.org>
Subject: [patch RT 4/7] Latency histograms: Detect another yet overlooked sharedprio condition
Date: Wed, 11 Jul 2012 22:05:19 -0000	[thread overview]
Message-ID: <20120711215611.943318314@linutronix.de> (raw)
In-Reply-To: 20120711214552.036760674@linutronix.de

[-- Attachment #1: latency-histograms-detect-another-yet-overlooked-sharedprio-condition.patch --]
[-- Type: text/plain, Size: 1109 bytes --]

While waiting for an RT process to be woken up, the previous process may
go to wait and switch to another one with the same priority which then
becomes current. This condition was not correctly recognized and led to
erroneously high latency recordings during periods of low CPU load.

This patch correctly marks such latencies as sharedprio and prevents
them from being recorded as actual system latency. 

Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 kernel/trace/latency_hist.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-3.4.2-rt10-64+/kernel/trace/latency_hist.c
===================================================================
--- linux-3.4.2-rt10-64+.orig/kernel/trace/latency_hist.c
+++ linux-3.4.2-rt10-64+/kernel/trace/latency_hist.c
@@ -935,6 +935,9 @@ static notrace void probe_wakeup_latency
 		goto out;
 	}
 
+	if (current->prio == cpu_wakeup_task->prio)
+		per_cpu(wakeup_sharedprio, cpu) = 1;
+
 	/*
 	 * The task we are waiting for is about to be switched to.
 	 * Calculate latency and store it in histogram.






  parent reply	other threads:[~2012-07-11 22:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 22:05 [patch RT 0/7] Various fixes for the stable RT series - part I Thomas Gleixner
2012-07-11 22:05 ` [patch RT 1/7] Latency histogramms: Cope with backwards running local trace clock Thomas Gleixner
2012-07-11 22:05 ` [patch RT 3/7] Disable RT_GROUP_SCHED in PREEMPT_RT_FULL Thomas Gleixner
2012-07-12  2:36   ` Mike Galbraith
2012-07-11 22:05 ` [patch RT 2/7] Latency histograms: Adjust timer, if already elapsed when programmed Thomas Gleixner
2012-07-11 22:05 ` [patch RT 5/7] slab: Prevent local lock deadlock Thomas Gleixner
2012-07-11 22:05 ` Thomas Gleixner [this message]
2012-07-11 22:05 ` [patch RT 6/7] fs, jbd: pull your plug when waiting for space Thomas Gleixner
2012-07-11 22:05 ` [patch RT 7/7] perf: Make swevent hrtimer run in irq instead of softirq Thomas Gleixner
2012-07-11 23:31 ` [patch RT 0/7] Various fixes for the stable RT series - part I Steven Rostedt
2012-07-12  8:49   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120711215611.943318314@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=C.Emde@osadl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.