public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Glauber <jan.glauber@gmail.com>
To: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Ambigiuous thread stack annotation in /proc/pid/[s]maps
Date: Thu, 27 Jun 2013 18:02:37 +0200	[thread overview]
Message-ID: <20130627160232.GA1748@hal> (raw)
In-Reply-To: <CAAHN_R1LyhSJE5bAisx39sOyFfRTXQGpCx=CrwQYHWZHSTnOcw@mail.gmail.com>

On Wed, Jun 26, 2013 at 10:05:41PM +0530, Siddhesh Poyarekar wrote:
> On 26 June 2013 17:13, Jan Glauber <jan.glauber@gmail.com> wrote:
> > Any ideas how that can be fixed? The only solution that comes to my mind
> > is to prevent merging vma's that are used for thread stacks. There is already a
> > flag (MAP_STACK) which is set by the libc for mmap'ing thread stacks but the
> > kernel currently does not care. If the kernel gets an mmap request with
> > MAP_STACK set we could mark the VMA and avoid merging it with others.
> >
> > Unfortunately there seems to be no bit left in the vm_flags to store the
> > MAP_STACK information...
> 
> The annotations essentially point out that the vma contains the stack
> and not that the vma *is* the stack.  We'd get similar output with

But isn't that confusing to the user? At least it is to me. Imagine someone
who uses the maps or smaps output to determine the size of code, data and
stack of a process. Maybe it would be better to not print the stack:tid data
at all if the kernel cannot distinguish the vma's?
Is that behaviour documented anywhere?

> makecontext/getcontext, where the stack may just be a portion of
> memory in another vma.  I don't remember if I had explicitly mentioned
> that during the original discussion.

Never seen that makecontext stuff before. Do you have an example output how
the maps would look like if that is used?

--Jan
 
> Siddhesh
> --
> http://siddhesh.in

  reply	other threads:[~2013-06-27 16:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 11:43 Ambigiuous thread stack annotation in /proc/pid/[s]maps Jan Glauber
2013-06-26 16:35 ` Siddhesh Poyarekar
2013-06-27 16:02   ` Jan Glauber [this message]
2013-06-27 16:30     ` Siddhesh Poyarekar
2013-07-02  9:11       ` Jan Glauber

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=20130627160232.GA1748@hal \
    --to=jan.glauber@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=siddhesh.poyarekar@gmail.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