linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Cc: Jamie Lokier <jamie@shareable.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-man@vger.kernel.org, Mike Frysinger <vapier@gentoo.org>
Subject: Re: [RESEND][PATCH] Mark thread stack correctly in proc/<pid>/maps
Date: Wed, 08 Feb 2012 12:57:10 -0500	[thread overview]
Message-ID: <4F32B776.6070007@gmail.com> (raw)
In-Reply-To: <CAAHN_R0N=3J4=VqvDsGB=_2Ln9yKBjOevW2=_UAMBK1pGepqvA@mail.gmail.com>

(2/7/12 11:00 PM), Siddhesh Poyarekar wrote:
> On Sat, Feb 4, 2012 at 12:04 AM, Siddhesh Poyarekar
> <siddhesh.poyarekar@gmail.com>  wrote:
>> On Fri, Feb 3, 2012 at 1:31 PM, KOSAKI Motohiro
>> <kosaki.motohiro@gmail.com>  wrote:
>>> The fact is, now process stack and pthread stack clearly behave
>>> different dance. libc don't expect pthread stack grow automatically.
>>> So, your patch will break userland. Just only change display thing.
> <snip>
>> I have also dropped an email on the libc-alpha list here to solicit
>> comments from libc maintainers on this:
>>
>> http://sourceware.org/ml/libc-alpha/2012-02/msg00036.html
>>
>
> Kosaki-san, your suggestion of adding an extra flag seems like the
> right way to go about this based on the discussion on libc-alpha,
> specifically, your point about pthread_getattr_np() -- it may not be a
> standard, but it's a breakage anyway. However, looking at the vm_flags
> options in mm.h, it looks like the entire 32-bit space has been
> exhausted for the flag value. The vm_flags is an unsigned long, so it
> ought to take 8 bytes on a 64-bit system, but 32-bit systems will be
> left behind.
>
> So there are two options for this:
>
> 1) make vm_flags 64-bit for all arches. This will cause ABI breakage
> on 32-bit systems, so any external drivers will have to be rebuilt

Several month ago, Linus NAKed this way.


> 2) Implement this patch for 64-bit only by defining the new flag only
> for 64-bit. 32-bit systems behave as is

No. That's bad than status quo. Enduser may get inconsistent and bad user
experience.

Now, we are using some bit saving hack. example,

1) use ifdef

#ifndef CONFIG_TRANSPARENT_HUGEPAGE
#define VM_MAPPED_COPY 0x01000000      /* T if mapped copy of data (nommu mmap) */
#else
#define VM_HUGEPAGE    0x01000000      /* MADV_HUGEPAGE marked this vma */
#endif

2) use bit combination

#define VM_STACK_INCOMPLETE_SETUP      (VM_RAND_READ | VM_SEQ_READ)


Maybe you can take a similar way. And of course, you can ban some useless flag
bits.

thanks.

> Which of these would be better? I prefer the latter because it looks
> like the path of least breakage.
>


  reply	other threads:[~2012-02-08 17:57 UTC|newest]

Thread overview: 42+ 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-16 11:28 ` Jamie Lokier
2012-01-16 13:08   ` Siddhesh Poyarekar
2012-01-16 16:31     ` Jamie Lokier
2012-01-16 17:01       ` Siddhesh Poyarekar
2012-01-17  4:54       ` Siddhesh Poyarekar
2012-02-02  6:24         ` [RESEND][PATCH] " Siddhesh Poyarekar
2012-02-02 21:40           ` KOSAKI Motohiro
2012-02-03  7:09             ` Siddhesh Poyarekar
2012-02-03  8:01               ` KOSAKI Motohiro
2012-02-03  9:49                 ` Siddhesh Poyarekar
2012-02-03 10:29                 ` Mike Frysinger
2012-02-03 18:34                 ` Siddhesh Poyarekar
2012-02-08  4:00                   ` Siddhesh Poyarekar
2012-02-08 17:57                     ` KOSAKI Motohiro [this message]
2012-02-11 10:19                       ` Siddhesh Poyarekar
2012-02-11 15:03                       ` [PATCH] " Siddhesh Poyarekar
2012-02-21  4:24                         ` [RESEND][PATCH] " Siddhesh Poyarekar
2012-02-22 23:00                           ` Andrew Morton
2012-02-23  4:03                             ` [PATCH] " Siddhesh Poyarekar
2012-02-23 20:22                               ` Andrew Morton
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 16:12                                   ` Mike Frysinger
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-24  0:49                           ` KOSAKI Motohiro
2012-02-24  5:29                           ` Siddhesh Poyarekar
2012-02-24 16:14                             ` KOSAKI Motohiro
2012-02-24 18:58                               ` Siddhesh Poyarekar
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=4F32B776.6070007@gmail.com \
    --to=kosaki.motohiro@gmail.com \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mtk.manpages@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).