public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@linux-foundation.org, uclinux-dev@uclinux.org,
	linux-kernel@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org,
	Mike Frysinger <vapier@gentoo.org>
Subject: Re: [PATCH] NOMMU: Add '[stack]' label to /proc/pid/maps output
Date: Fri, 4 Jun 2010 13:48:53 -0700	[thread overview]
Message-ID: <20100604134853.b6ca10f9.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100601185937.5188.77506.stgit@warthog.procyon.org.uk>

On Tue, 01 Jun 2010 19:59:37 +0100
David Howells <dhowells@redhat.com> wrote:

> From: Mike Frysinger <vapier@gentoo.org>
> 
> Add support to the NOMMU /proc/pid/maps file to show which mapping is the stack
> of the original thread after execve.  This is largely based on the MMU code.
> Subsidiary thread stacks are not indicated.
> 
> For FDPIC, we now get:
> 
> 	root:/> cat /proc/self/maps
> 	02064000-02067ccc rw-p 0004d000 00:01 22         /bin/busybox
> 	0206e000-0206f35c rw-p 00006000 00:01 295        /lib/ld-uClibc.so.0
> 	025f0000-025f6f0c r-xs 00000000 00:01 295        /lib/ld-uClibc.so.0
> 	02680000-026ba6b0 r-xs 00000000 00:01 297        /lib/libc.so.0
> 	02700000-0274d384 r-xs 00000000 00:01 22         /bin/busybox
> 	02816000-02817000 rw-p 00000000 00:00 0
> 	02848000-0284c0d8 rw-p 00000000 00:00 0
> 	02860000-02880000 rw-p 00000000 00:00 0          [stack]
> 
> The semi-downside here is that for FLAT, we get:
> 
> 	root:/> cat /proc/155/maps
> 	029f0000-029f9000 rwxp 00000000 00:00 0          [stack]
> 
> The reason being that FLAT combines a whole lot of stuff into one map
> (including the stack).  But this isn't any worse than the current output (which
> is nothing), so screw it.
> 

So it's a non-back-compatible change which can a) break nommu-only
userspace and b) unbreak mmu-tested userspace which gets run on nommu.

ho hum, we suck.  They can send us the bill.

> --- a/fs/proc/task_nommu.c
> +++ b/fs/proc/task_nommu.c
> @@ -122,11 +122,20 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
>  	return size;
>  }
>  
> +static void pad_len_spaces(struct seq_file *m, int len)
> +{
> +	len = 25 + sizeof(void*) * 6 - len;
> +	if (len < 1)
> +		len = 1;
> +	seq_printf(m, "%*c", len, ' ');
> +}

hm, copy-n-paste alert.



  parent reply	other threads:[~2010-06-04 21:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 18:59 [PATCH] NOMMU: Add '[stack]' label to /proc/pid/maps output David Howells
2010-06-01 19:07 ` Linus Torvalds
2010-06-01 20:52   ` [Uclinux-dist-devel] " Mike Frysinger
2010-06-01 21:05     ` Linus Torvalds
2010-06-04 20:48 ` Andrew Morton [this message]
2010-06-04 23:00   ` Mike Frysinger

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=20100604134853.b6ca10f9.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=uclinux-dev@uclinux.org \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox