public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: David Rientjes <rientjes@google.com>
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [patch] sched: emit thread info flags with stack trace
Date: Wed, 6 May 2009 12:12:11 +0200	[thread overview]
Message-ID: <20090506101211.GD15323@elte.hu> (raw)
In-Reply-To: <alpine.DEB.2.00.0905040136390.15831@chino.kir.corp.google.com>


* 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

  reply	other threads:[~2009-05-06 10:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04  8:38 [patch] sched: emit thread info flags with stack trace David Rientjes
2009-05-06 10:12 ` Ingo Molnar [this message]
2009-05-06 10:25 ` [tip:sched/core] " tip-bot for David Rientjes
2009-05-07  7:39 ` tip-bot for David Rientjes

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=20090506101211.GD15323@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox