lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 6 May 2009 12:12:11 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	David Rientjes <rientjes@...gle.com>
Cc:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [patch] sched: emit thread info flags with stack trace


* David Rientjes <rientjes@...gle.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@...gle.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ