From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, Jamie Lokier <jamie@shareable.org>,
vapier@gentoo.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Mark thread stack correctly in proc/<pid>/maps
Date: Fri, 24 Feb 2012 11:14:57 -0500 [thread overview]
Message-ID: <4F47B781.2050300@gmail.com> (raw)
In-Reply-To: <CAAHN_R2Awa5X3B09541grAPLkm9RzL9DnixUKFJXpz=1ZkPTFg@mail.gmail.com>
>> Sigh. No, I missed one thing. If application use
>> makecontext()/swapcontext() pair,
>> ESP is not reliable way to detect pthread stack. At that time the
>> stack is still marked
>> as anonymous memory.
>
> This is not wrong, because it essentially gives the correct picture of
> the state of that task -- the task is using another vma as a stack
> during that point and not the one it was allotted by pthreads during
> thread creation.
>
> I don't think we can successfully stick to the idea of trying to mark
> stack space allocated by pthreads but not used by any task *currently*
> as stack as long as the allocation happens outside the kernel space.
> The only way to mark this is either by marking the stack as
> VM_GROWSDOWN (which will make the stack grow and break some pthreads
> functions) or create a new flag, which a simple display such as this
> does not deserve. So it's best that this sticks to what the kernel
> *knows* is being used as stack.
Oh, maybe generically you are right. but you missed one thing. Before
your patch, stack or not stack are address space property. thus, using
/proc/pid/maps makes sense. but after your patch, it's no longer memory
property. applications can use heap or mapped file as a stack. then, at
least, current your code is wrong. the code assume each memory property
are exclusive.
Moreover, if pthread stack is unimportant, I wonder why we need this patch
at all. Which application does need it? and When?
WARNING: multiple messages have this Message-ID (diff)
From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, Jamie Lokier <jamie@shareable.org>,
vapier@gentoo.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Mark thread stack correctly in proc/<pid>/maps
Date: Fri, 24 Feb 2012 11:14:57 -0500 [thread overview]
Message-ID: <4F47B781.2050300@gmail.com> (raw)
In-Reply-To: <CAAHN_R2Awa5X3B09541grAPLkm9RzL9DnixUKFJXpz=1ZkPTFg@mail.gmail.com>
>> Sigh. No, I missed one thing. If application use
>> makecontext()/swapcontext() pair,
>> ESP is not reliable way to detect pthread stack. At that time the
>> stack is still marked
>> as anonymous memory.
>
> This is not wrong, because it essentially gives the correct picture of
> the state of that task -- the task is using another vma as a stack
> during that point and not the one it was allotted by pthreads during
> thread creation.
>
> I don't think we can successfully stick to the idea of trying to mark
> stack space allocated by pthreads but not used by any task *currently*
> as stack as long as the allocation happens outside the kernel space.
> The only way to mark this is either by marking the stack as
> VM_GROWSDOWN (which will make the stack grow and break some pthreads
> functions) or create a new flag, which a simple display such as this
> does not deserve. So it's best that this sticks to what the kernel
> *knows* is being used as stack.
Oh, maybe generically you are right. but you missed one thing. Before
your patch, stack or not stack are address space property. thus, using
/proc/pid/maps makes sense. but after your patch, it's no longer memory
property. applications can use heap or mapped file as a stack. then, at
least, current your code is wrong. the code assume each memory property
are exclusive.
Moreover, if pthread stack is unimportant, I wonder why we need this patch
at all. Which application does need it? and When?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-02-24 16:14 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-14 12:35 [PATCH] Mark thread stack correctly in proc/<pid>/maps Siddhesh Poyarekar
2012-01-14 12:35 ` Siddhesh Poyarekar
2012-01-16 11:28 ` Jamie Lokier
2012-01-16 11:28 ` Jamie Lokier
2012-01-16 13:08 ` Siddhesh Poyarekar
2012-01-16 13:08 ` Siddhesh Poyarekar
2012-01-16 16:31 ` Jamie Lokier
2012-01-16 16:31 ` Jamie Lokier
2012-01-16 17:01 ` Siddhesh Poyarekar
2012-01-16 17:01 ` Siddhesh Poyarekar
[not found] ` <20120116163106.GC7180-DqlFc3psUjeg7Qil/0GVWOc42C6kRsbE@public.gmane.org>
2012-01-17 4:54 ` Siddhesh Poyarekar
2012-01-17 4:54 ` Siddhesh Poyarekar
2012-01-17 4:54 ` Siddhesh Poyarekar
2012-02-02 6:24 ` [RESEND][PATCH] " Siddhesh Poyarekar
2012-02-02 6:24 ` Siddhesh Poyarekar
2012-02-02 21:40 ` KOSAKI Motohiro
2012-02-02 21:40 ` KOSAKI Motohiro
2012-02-03 7:09 ` Siddhesh Poyarekar
2012-02-03 7:09 ` Siddhesh Poyarekar
2012-02-03 8:01 ` KOSAKI Motohiro
2012-02-03 8:01 ` KOSAKI Motohiro
2012-02-03 9:49 ` Siddhesh Poyarekar
2012-02-03 9:49 ` Siddhesh Poyarekar
[not found] ` <CAHGf_=qA6EFue2-mNUg9udWV4xSx86XQsnyGV07hfZOUx6_egw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-03 10:29 ` Mike Frysinger
2012-02-03 10:29 ` Mike Frysinger
2012-02-03 18:34 ` Siddhesh Poyarekar
2012-02-03 18:34 ` Siddhesh Poyarekar
2012-02-03 18:34 ` Siddhesh Poyarekar
2012-02-08 4:00 ` Siddhesh Poyarekar
2012-02-08 4:00 ` Siddhesh Poyarekar
2012-02-08 17:57 ` KOSAKI Motohiro
2012-02-08 17:57 ` KOSAKI Motohiro
[not found] ` <4F32B776.6070007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-11 10:19 ` Siddhesh Poyarekar
2012-02-11 10:19 ` Siddhesh Poyarekar
2012-02-11 10:19 ` Siddhesh Poyarekar
2012-02-11 15:03 ` [PATCH] " Siddhesh Poyarekar
2012-02-11 15:03 ` Siddhesh Poyarekar
2012-02-21 4:24 ` [RESEND][PATCH] " Siddhesh Poyarekar
2012-02-21 4:24 ` Siddhesh Poyarekar
2012-02-22 23:00 ` Andrew Morton
2012-02-22 23:00 ` Andrew Morton
2012-02-23 4:03 ` [PATCH] " Siddhesh Poyarekar
2012-02-23 4:03 ` Siddhesh Poyarekar
2012-02-23 20:22 ` Andrew Morton
2012-02-23 20:22 ` Andrew Morton
2012-02-24 13:05 ` Siddhesh Poyarekar
2012-02-24 13:05 ` Siddhesh Poyarekar
2012-02-26 16:17 ` [PATCH] x86_64: Record stack pointer before task execution begins Siddhesh Poyarekar
2012-02-27 6:17 ` [tip:x86/process] " tip-bot for Siddhesh Poyarekar
2012-02-23 23:47 ` [PATCH] Mark thread stack correctly in proc/<pid>/maps Mike Frysinger
2012-02-24 5:47 ` Siddhesh Poyarekar
2012-02-24 5:47 ` Siddhesh Poyarekar
2012-02-24 16:12 ` Mike Frysinger
2012-02-24 18:23 ` Siddhesh Poyarekar
2012-02-24 18:23 ` Siddhesh Poyarekar
2012-03-01 5:20 ` [PATCH 1/2] Take rcu read lock when iterating through thread group Siddhesh Poyarekar
2012-03-01 5:20 ` [PATCH 2/2] procfs: Mark stack vma with pid of the owning task Siddhesh Poyarekar
2012-03-01 23:17 ` Andrew Morton
2012-03-01 16:51 ` [PATCH 1/2] Take rcu read lock when iterating through thread group Oleg Nesterov
2012-03-01 23:21 ` Andrew Morton
2012-03-04 20:04 ` Siddhesh Poyarekar
2012-02-23 23:17 ` [PATCH] Mark thread stack correctly in proc/<pid>/maps KOSAKI Motohiro
2012-02-23 23:17 ` KOSAKI Motohiro
2012-02-24 0:49 ` KOSAKI Motohiro
2012-02-24 0:49 ` KOSAKI Motohiro
2012-02-24 5:29 ` Siddhesh Poyarekar
2012-02-24 5:29 ` Siddhesh Poyarekar
2012-02-24 16:14 ` KOSAKI Motohiro [this message]
2012-02-24 16:14 ` KOSAKI Motohiro
2012-02-24 18:58 ` Siddhesh Poyarekar
2012-02-24 18:58 ` Siddhesh Poyarekar
-- strict thread matches above, loose matches on Subject: below --
2012-02-28 17:04 + procfs-mark-thread-stack-correctly-in-proc-pid-maps.patch added to -mm tree Oleg Nesterov
2012-02-28 17:18 ` Siddhesh Poyarekar
2012-02-28 17:40 ` Oleg Nesterov
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=4F47B781.2050300@gmail.com \
--to=kosaki.motohiro@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jamie@shareable.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=siddhesh.poyarekar@gmail.com \
--cc=vapier@gentoo.org \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.