Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@systemhalted.org>
To: John David Anglin <dave.anglin@bell.net>
Cc: Parisc List <linux-parisc@vger.kernel.org>
Subject: Re: Thread stack allocation
Date: Mon, 10 Sep 2012 11:13:51 -0400	[thread overview]
Message-ID: <504E03AF.2070204@systemhalted.org> (raw)
In-Reply-To: <BLU0-SMTP297D308BBF8A72A121C16397AD0@phx.gbl>

On 9/9/2012 6:24 PM, John David Anglin wrote:
> On 9-Sep-12, at 4:23 PM, John David Anglin wrote:
> 
>> It seems to me this must be a kernel bug:
> 
> Nope, it's a problem with guard page allocation in openjdk.
> It assumes stack grows down.

Yes, that's wrong :-)

If you allocate your own stacks then glibc can't setup guard
pages for you since it violates some POSIX constraints.

For avoidance of doubt you *can* get a thread with PTHREAD_STACK_MIN
as the stack size if:

(a) RLIMIT_STACK is a useful value e.g. != infinity

... but ....

(b) RLIMIT_STACK < PTHREAD_STACK_MIN

.... then ....

We allocate PTHREAD_STACK_MIN by default which might not be enough
space for what you need.

I'm actually working heavily on a BZ for glibc that would split up
the accounting of stack space and other incidentals to avoid grouping
them. For example if you had a lot of TLS variables they could actually
consume your stack and that's wrong.

http://sourceware.org/bugzilla/show_bug.cgi?id=11787

Cheers,
Carlos.


  reply	other threads:[~2012-09-10 15:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-09 17:52 Thread stack allocation John David Anglin
2012-09-09 20:23 ` John David Anglin
2012-09-09 22:24   ` John David Anglin
2012-09-10 15:13     ` Carlos O'Donell [this message]
2012-09-10 15:45       ` John David Anglin
2012-09-10 19:02         ` Carlos O'Donell

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=504E03AF.2070204@systemhalted.org \
    --to=carlos@systemhalted.org \
    --cc=dave.anglin@bell.net \
    --cc=linux-parisc@vger.kernel.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