9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] Plan 9 stack limit?
Date: Tue,  6 Sep 2011 19:48:54 -0400	[thread overview]
Message-ID: <9e2467582038ff5b4c4c58fce0b3996d@ladd.quanstro.net> (raw)
In-Reply-To: <CAHcDtnkGF5V=DhQEPw=R66tkP2heFTkpQFosWbvvOuc=akFH+A@mail.gmail.c>

On Tue Sep  6 19:10:46 EDT 2011, mathieu.lonjaret@gmail.com wrote:
> maybe slightly relevant:
> http://9fans.net/archive/2010/05/446
> (see also answers from others as well afterwards).
> 
> On Wed, Sep 7, 2011 at 12:30 AM, Comeau At9Fans <comeauat9fans@gmail.com> wrote:
> > I have an application that is crashing on Plan 9.  Now, it could be a bug in
> > the code, but in the past, similar problems with the same code base on other
> > platforms have always been caused by the system stack being blown out, and
> > in a less rare case, the systems running out of process space.  The crashes
> > are happening on 9vx.OSX (which is currently the only place it can be tested
> > on our systems).   Does 9vx have any such limitations and/or does Plan 9 in
> > general have any such limits?  And if so, can they be changed?   I see some
> > of the threading calls have stack size requests possible, but don't see any
> > such concerns as a consequence of a fork, though I'm sure fork is
> > semantically equivalent to some other calls when all is said and done.
> > Like I said, it could be a bug in the code, but I'd like to approach it from
> > this level first assuming there is any such interaction that even exists so
> > any insights would be appreciated.

good reference.

it's worth noting that a gsoc student (venkatesh srinivas) extended the plan 9
segment model to allow an arbitrary number of them.  this was fairly interesting,
but not of much practical interest.  then he implemented the concept of "segment
group".  group segments alter the address space of each process in the group.
then (here's the neat part) the thread library was modified to make two adjacent
group segments for each stack.  the lower one is not mapped and will always fault
on reference.  the upper one is grow-down, zero-and-map on reference,
so there's not much penalty for making your thread stacks a little too large.
the main limit is deference to machines with a punny 32-bit address space.

i really need to take another look at this and see about merging it into my kernel.
thread library stacks are a big debugging hassle.

- erik



  parent reply	other threads:[~2011-09-06 23:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-06 22:30 Comeau At9Fans
2011-09-06 22:39 ` ron minnich
2011-09-07 13:39   ` Comeau At9Fans
2011-09-07 15:46     ` ron minnich
2011-09-07 16:46       ` Comeau At9Fans
2011-09-07 20:04         ` David du Colombier
     [not found]     ` <CAP6exYKrNj_uz7tKJK_MtnPYVOEhpMr1ssCxUauEck2RLG=+jg@mail.gmail.c>
2011-09-07 15:48       ` erik quanstrom
2011-09-06 23:10 ` Mathieu Lonjaret
2011-09-07 13:40   ` Comeau At9Fans
     [not found] ` <CAHcDtnkGF5V=DhQEPw=R66tkP2heFTkpQFosWbvvOuc=akFH+A@mail.gmail.c>
2011-09-06 23:48   ` erik quanstrom [this message]
2011-09-07  0:00 ` Russ Cox
2011-09-07 13:43   ` Comeau At9Fans
2011-09-07 14:05     ` Russ Cox
2011-09-07 16:38       ` Comeau At9Fans
2011-09-07 20:12         ` Comeau At9Fans
2011-09-08  1:18           ` Comeau At9Fans
2011-09-08  1:50             ` Russ Cox

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=9e2467582038ff5b4c4c58fce0b3996d@ladd.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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).