* [patch] sched: emit thread info flags with stack trace
@ 2009-05-04 8:38 David Rientjes
2009-05-06 10:12 ` Ingo Molnar
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: David Rientjes @ 2009-05-04 8:38 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel
When a thread is oom killed and fails to exit, it's helpful to know which
threads have access to memory reserves if the machine livelocks. This is
done by testing for the TIF_MEMDIE thread info flag and should be
displayed alongside stack traces to identify tasks that have access to
such reserves but are still stuck allocating pages, for instance.
It would probably be helpful in other cases as well, so all thread info
flags are emitted when showing a task.
Signed-off-by: David Rientjes <rientjes@google.com>
---
kernel/sched.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6490,8 +6490,9 @@ void sched_show_task(struct task_struct *p)
#ifdef CONFIG_DEBUG_STACK_USAGE
free = stack_not_used(p);
#endif
- printk(KERN_CONT "%5lu %5d %6d\n", free,
- task_pid_nr(p), task_pid_nr(p->real_parent));
+ printk(KERN_CONT "%5lu %5d %6d 0x%08x\n", free,
+ task_pid_nr(p), task_pid_nr(p->real_parent),
+ task_thread_info(p)->flags);
show_stack(p, NULL);
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] sched: emit thread info flags with stack trace
2009-05-04 8:38 [patch] sched: emit thread info flags with stack trace David Rientjes
@ 2009-05-06 10:12 ` Ingo Molnar
2009-05-06 10:25 ` [tip:sched/core] " tip-bot for David Rientjes
2009-05-07 7:39 ` tip-bot for David Rientjes
2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2009-05-06 10:12 UTC (permalink / raw)
To: David Rientjes; +Cc: linux-kernel, Peter Zijlstra
* David Rientjes <rientjes@google.com> wrote:
> When a thread is oom killed and fails to exit, it's helpful to know which
> threads have access to memory reserves if the machine livelocks. This is
> done by testing for the TIF_MEMDIE thread info flag and should be
> displayed alongside stack traces to identify tasks that have access to
> such reserves but are still stuck allocating pages, for instance.
>
> It would probably be helpful in other cases as well, so all thread info
> flags are emitted when showing a task.
>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
> kernel/sched.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -6490,8 +6490,9 @@ void sched_show_task(struct task_struct *p)
> #ifdef CONFIG_DEBUG_STACK_USAGE
> free = stack_not_used(p);
> #endif
> - printk(KERN_CONT "%5lu %5d %6d\n", free,
> - task_pid_nr(p), task_pid_nr(p->real_parent));
> + printk(KERN_CONT "%5lu %5d %6d 0x%08x\n", free,
> + task_pid_nr(p), task_pid_nr(p->real_parent),
> + task_thread_info(p)->flags);
>
> show_stack(p, NULL);
> }
ok. We just seem to have enough space to do that with
printk-timestamps enabled, without wrapping the line:
Before:
[62034.343909] as R running task 6240 27598 27596
After:
[62034.343909] as R running task 6240 27598 27596 0x12345678
Applied to tip/sched/core, thanks David!
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:sched/core] sched: emit thread info flags with stack trace
2009-05-04 8:38 [patch] sched: emit thread info flags with stack trace David Rientjes
2009-05-06 10:12 ` Ingo Molnar
@ 2009-05-06 10:25 ` tip-bot for David Rientjes
2009-05-07 7:39 ` tip-bot for David Rientjes
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for David Rientjes @ 2009-05-06 10:25 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, a.p.zijlstra, tglx, rientjes, mingo
Commit-ID: 12b5c43486202dd4ff3cfd59a190984a0dd7f6fd
Gitweb: http://git.kernel.org/tip/12b5c43486202dd4ff3cfd59a190984a0dd7f6fd
Author: David Rientjes <rientjes@google.com>
AuthorDate: Mon, 4 May 2009 01:38:05 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 6 May 2009 12:09:30 +0200
sched: emit thread info flags with stack trace
When a thread is oom killed and fails to exit, it's helpful to know which
threads have access to memory reserves if the machine livelocks. This is
done by testing for the TIF_MEMDIE thread info flag and should be
displayed alongside stack traces to identify tasks that have access to
such reserves but are still stuck allocating pages, for instance.
It would probably be helpful in other cases as well, so all thread info
flags are emitted when showing a task.
[ Impact: extend debug printout info ]
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <alpine.DEB.2.00.0905040136390.15831@chino.kir.corp.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 2a43a58..dfe2583 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6610,8 +6610,9 @@ void sched_show_task(struct task_struct *p)
#ifdef CONFIG_DEBUG_STACK_USAGE
free = stack_not_used(p);
#endif
- printk(KERN_CONT "%5lu %5d %6d\n", free,
- task_pid_nr(p), task_pid_nr(p->real_parent));
+ printk(KERN_CONT "%5lu %5d %6d 0x%08x\n", free,
+ task_pid_nr(p), task_pid_nr(p->real_parent),
+ task_thread_info(p)->flags);
show_stack(p, NULL);
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [tip:sched/core] sched: emit thread info flags with stack trace
2009-05-04 8:38 [patch] sched: emit thread info flags with stack trace David Rientjes
2009-05-06 10:12 ` Ingo Molnar
2009-05-06 10:25 ` [tip:sched/core] " tip-bot for David Rientjes
@ 2009-05-07 7:39 ` tip-bot for David Rientjes
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for David Rientjes @ 2009-05-07 7:39 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, a.p.zijlstra, sfr, tglx, rientjes,
mingo
Commit-ID: aa47b7e0f89b9998dad4d1667447e8cb7703ff4e
Gitweb: http://git.kernel.org/tip/aa47b7e0f89b9998dad4d1667447e8cb7703ff4e
Author: David Rientjes <rientjes@google.com>
AuthorDate: Mon, 4 May 2009 01:38:05 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 7 May 2009 09:36:28 +0200
sched: emit thread info flags with stack trace
When a thread is oom killed and fails to exit, it's helpful to know which
threads have access to memory reserves if the machine livelocks. This is
done by testing for the TIF_MEMDIE thread info flag and should be
displayed alongside stack traces to identify tasks that have access to
such reserves but are still stuck allocating pages, for instance.
It would probably be helpful in other cases as well, so all thread info
flags are emitted when showing a task.
( v2: fix warning reported by Stephen Rothwell )
[ Impact: extend debug printout info ]
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
LKML-Reference: <alpine.DEB.2.00.0905040136390.15831@chino.kir.corp.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 2a43a58..5aa63f5 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6610,8 +6610,9 @@ void sched_show_task(struct task_struct *p)
#ifdef CONFIG_DEBUG_STACK_USAGE
free = stack_not_used(p);
#endif
- printk(KERN_CONT "%5lu %5d %6d\n", free,
- task_pid_nr(p), task_pid_nr(p->real_parent));
+ printk(KERN_CONT "%5lu %5d %6d 0x%08lx\n", free,
+ task_pid_nr(p), task_pid_nr(p->real_parent),
+ (unsigned long)task_thread_info(p)->flags);
show_stack(p, NULL);
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-07 7:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-04 8:38 [patch] sched: emit thread info flags with stack trace David Rientjes
2009-05-06 10:12 ` Ingo Molnar
2009-05-06 10:25 ` [tip:sched/core] " tip-bot for David Rientjes
2009-05-07 7:39 ` tip-bot for David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox