lkml.org 
[lkml]   [2009]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] proc: remove /proc/*/status "Stack usage:"
On Mon, Nov 02, 2009 at 12:32:08AM +0100, Stefani Seibold wrote:
> Am Sonntag, den 01.11.2009, 18:53 +0300 schrieb Alexey Dobriyan:
> > On Sun, Nov 01, 2009 at 03:39:57PM +0100, Stefani Seibold wrote:
> > > Am Sonntag, den 01.11.2009, 16:15 +0300 schrieb Alexey Dobriyan:
> > > > We have /proc/*/pagemap to determine how much stack was consumed.
> > > > Leave "threadstack" though.
> > > >
> > >
> > > Stop! /proc/*/pagemap is not a real substitute for the stackm usage
> > > patch. If you have problems with this patch i will have a look on it.
> >
> > Why?
> >
> > You grab thread stack start from /proc/*/stat, then for every page of
> > stack VMA, you lookup state of page, which is exactly what you're doing
> > by employing page walker.
>
> First, as you figured out there is currently no way to get the stack
> start of a thread. But i currently check this and hope to find a
> solution in the next 24 hours.
>
> Second, this patch aims to the embedded world and there is normally no
> tools available when you need it, but /proc is always there. Especially
> outside in the field.

Poor embedded people!

There is even Documentation/vm/page-types.c which is trivially adapted
to show stack pages state.

> Like Dr Frank. N. Furter in the "Rocky Horror Picture Show" says: remove
> the cause but NOT the symptoms!

The root of the problem is that you're measuring badly defined value.

Kernel doesn't know SP register of a running task until it stops it.
Even if task is stopped or inside kernel, kernel doesn't know where
userpace stack starts, because, in theory, application can move it's
stack to anywhere.

> And the cause is the miss implemented KSTK_ESP in a x86_64. I also
> checked all other architekture depended KSTK_ESP definitions and this
> definitions looks okay for me.


\
 
 \ /
  Last update: 2009-11-02 06:59    [W:0.870 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site