linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: badari <pbadari@us.ibm.com>
To: "Martin J. Bligh" <mbligh@aracnet.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm mailing list <linux-mm@kvack.org>,
	Andrew Morton <akpm@digeo.com>
Subject: Re: TASK_UNMAPPED_BASE & stack location
Date: Fri, 25 Apr 2003 16:52:05 -0700	[thread overview]
Message-ID: <3EA9CA25.E140A02C@us.ibm.com> (raw)
In-Reply-To: 459930000.1051302738@[10.10.2.4]

Martin,

Only problem with moving TASK_UNMAPPED_BASE right above
text would be - limiting the malloc() space. malloc() is clever enough
to mmap() and do the right thing. Once I moved TASK_UNMAPPED_BASE
to 0x10000000 and I could not run some of the programs with large
data segments.

Moving stacks below text would be tricky. pthread library knows
the placement of stack. It uses this to distinguish between
threads and pthreads manager.

I don't know what other librarys/apps depend on this kind of stuff.

Thanks,
Badari

static inline pthread_descr thread_self (void)
{
#ifdef THREAD_SELF
  return THREAD_SELF;
#else
  char *sp = CURRENT_STACK_FRAME;
  if (sp >= __pthread_initial_thread_bos)
    return &__pthread_initial_thread;
  else if (sp >= __pthread_manager_thread_bos
           && sp < __pthread_manager_thread_tos)
    return &__pthread_manager_thread;
  else if (__pthread_nonstandard_stacks)
    return __pthread_find_self();
  else
#ifdef _STACK_GROWS_DOWN
    return (pthread_descr)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1;
#else
    return (pthread_descr)((unsigned long)sp &~ (STACK_SIZE-1));
#endif
#endif
}


"Martin J. Bligh" wrote:

> Is there any good reason we can't remove TASK_UNMAPPED_BASE, and just shove
> libraries directly above the program text? Red Hat seems to have patches to
> dynamically tune it on a per-processes basis anyway ...
>
> Moreover, can we put the stack back where it's meant to be, below the
> program text, in that wasted 128MB of virtual space? Who really wants
> > 128MB of stack anyway (and can't fix their app)?
>
> I'm sure there's some horrible reason we can't do this ... would just like
> to know what it is. If it's "standards compilance" I don't really believe
> it - we don't comply with the standard now anyway ...
>
> M.
>
> PS. Motivation is creating large shmem segments for DBs.
> --
> 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/ .
> Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>


  parent reply	other threads:[~2003-04-25 23:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-25 20:32 TASK_UNMAPPED_BASE & stack location Martin J. Bligh
2003-04-25 21:01 ` H. Peter Anvin
2003-04-25 21:10   ` Martin J. Bligh
2003-04-25 21:12     ` H. Peter Anvin
2003-04-25 22:02     ` Timothy Miller
2003-04-25 22:06       ` Martin J. Bligh
2003-04-25 23:15         ` H. Peter Anvin
2003-04-25 23:19           ` Martin J. Bligh
2003-04-26  0:11             ` H. Peter Anvin
2003-04-26  0:42         ` Hugh Dickins
2003-04-26  5:15           ` Martin J. Bligh
2003-04-26 10:40         ` jlnance
2003-04-26 15:39           ` Martin J. Bligh
2003-04-25 23:52 ` badari [this message]
2003-04-25 23:58   ` William Lee Irwin III
2003-04-26 14:37 ` Rik van Riel
2003-04-26 15:03   ` William Lee Irwin III
     [not found] <20030425204012$4424@gated-at.bofh.it>
2003-04-25 21:54 ` Andi Kleen
2003-04-25 22:06   ` William Lee Irwin III
2003-04-25 22:10   ` Martin J. Bligh
     [not found] <20030425220018$6219@gated-at.bofh.it>
     [not found] ` <20030425220018$76b1@gated-at.bofh.it>
     [not found]   ` <20030425225007$3fae@gated-at.bofh.it>
2003-04-25 22:58     ` Andi Kleen
2003-04-25 23:13       ` Hui Huang
2003-04-25 23:02 Chuck Ebbert
2003-04-25 23:02 Chuck Ebbert

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=3EA9CA25.E140A02C@us.ibm.com \
    --to=pbadari@us.ibm.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mbligh@aracnet.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;
as well as URLs for NNTP newsgroup(s).