From: Gregory Haskins <ghaskins@novell.com>
To: Chirag Jog <chirag@linux.vnet.ibm.com>
Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
rostedt@goodmis.org, dvhltc@us.ibm.com, dino@in.ibm.com
Subject: [PATCH] sched: add a stacktrace on enqueue_pushable error
Date: Wed, 01 Oct 2008 10:22:47 -0400 [thread overview]
Message-ID: <20081001142117.27846.83759.stgit@dev.haskins.net> (raw)
In-Reply-To: <20080930044320.GA4685@linux.vnet.ibm.com>
Hi Chirag,
Please apply this patch to your 26.5-rt9 tree for ppc64, enable
CONFIG_PROVE_LOCKING (which enables CONFIG_STACKTRACE) and give it a whirl.
If you get an oops, please post the console output.
Thanks!
-Greg
------------------
sched: add a stacktrace on enqueue_pushable error
NOT FOR INCLUSION!
This is to help debug an issue discovered by Chirag Jog in the thread
http://lkml.org/lkml/2008/9/25/189
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
---
include/linux/sched.h | 6 ++++++
kernel/sched_rt.c | 20 +++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 67da014..53e8a6a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -87,6 +87,7 @@ struct sched_param {
#include <linux/task_io_accounting.h>
#include <linux/kobject.h>
#include <linux/latencytop.h>
+#include <linux/stacktrace.h>
#include <asm/processor.h>
@@ -1170,6 +1171,11 @@ struct task_struct {
struct list_head tasks;
struct plist_node pushable_tasks;
+ struct {
+ unsigned long data[15];
+ struct stack_trace trace;
+ pid_t pid;
+ } pushable_stack;
/*
* ptrace_list/ptrace_children forms the list of my children
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 57a0c0d..0e6a88c 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -55,7 +55,25 @@ static void update_rt_migration(struct rq *rq)
static void enqueue_pushable_task(struct rq *rq, struct task_struct *p)
{
- plist_del(&p->pushable_tasks, &rq->rt.pushable_tasks);
+ if (plist_node_empty(&p->pushable_tasks)) {
+ struct stack_trace *trace = &p->pushable_stack.trace;
+
+ trace->nr_entries = 0;
+ trace->max_entries = sizeof(p->pushable_stack.data)/sizeof(p->pushable_stack.data[0]);
+ trace->entries = &p->pushable_stack.data[0];
+ trace->skip = 0;
+
+ save_stack_trace(trace);
+
+ p->pushable_stack.pid = current->pid;
+ } else {
+ printk(KERN_CRIT "redundant enqueue by %d detected\n",
+ p->pushable_stack.pid);
+ print_stack_trace(&p->pushable_stack.trace, 5);
+
+ BUG_ON(!plist_node_empty(&p->pushable_tasks));
+ }
+
plist_node_init(&p->pushable_tasks, p->prio);
plist_add(&p->pushable_tasks, &rq->rt.pushable_tasks);
}
next prev parent reply other threads:[~2008-10-01 14:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-25 12:32 [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang Chirag Jog
2008-09-29 18:13 ` Gregory Haskins
2008-09-29 21:18 ` Gregory Haskins
2008-09-29 21:34 ` Gregory Haskins
2008-09-29 22:00 ` Gregory Haskins
2008-09-30 4:43 ` Chirag Jog
2008-09-30 6:47 ` Gilles Carry
2008-10-01 14:22 ` Gregory Haskins [this message]
2008-10-02 9:42 ` [PATCH] sched: add a stacktrace on enqueue_pushable error Gilles Carry
2008-10-02 11:18 ` [BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang Gilles Carry
2008-10-03 12:42 ` [RT PATCH 0/2] fix for BUG_ON crash in 26.5-rt9 Gregory Haskins
2008-10-03 12:43 ` [PATCH 1/2] RT: Remove comment that is no longer true Gregory Haskins
2008-10-03 12:43 ` [PATCH 2/2] RT: remove "paranoid" limit in push_rt_task Gregory Haskins
2008-10-03 13:46 ` Gilles Carry
2008-10-03 15:45 ` Chirag Jog
2008-10-03 17:27 ` Gregory Haskins
2008-10-03 17:27 ` Gregory Haskins
2008-10-03 17:26 ` [RT PATCH v2 0/2] Series short description Gregory Haskins
2008-10-03 17:26 ` [RT PATCH v2 1/2] RT: Remove comment that is no longer true Gregory Haskins
2008-10-03 17:26 ` [RT PATCH v2 2/2] RT: remove "paranoid" limit in push_rt_task Gregory Haskins
2008-10-03 12:54 ` [RT PATCH 0/2] fix for BUG_ON crash in 26.5-rt9 Gregory Haskins
2008-10-06 15:14 ` [RT PATCH v3 0/2] Fix for "[BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang" Gregory Haskins
2008-10-06 15:14 ` [RT PATCH v3 1/2] RT: Remove comment that is no longer true Gregory Haskins
2008-10-06 15:14 ` [RT PATCH v3 2/2] RT: fix push_rt_task() to handle dequeue_pushable properly Gregory Haskins
2008-10-07 6:04 ` [RT PATCH v3 0/2] Fix for "[BUG][PPC64] BUG in 2.6.26.5-rt9 causing Hang" Gilles Carry
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=20081001142117.27846.83759.stgit@dev.haskins.net \
--to=ghaskins@novell.com \
--cc=chirag@linux.vnet.ibm.com \
--cc=dino@in.ibm.com \
--cc=dvhltc@us.ibm.com \
--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.