From: Dan Aloni <da-x@monatomic.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Hugh Dickins <hugh@veritas.com>,
linux-kernel@vger.kernel.org
Subject: Re: thread stacks and strict vm overcommit accounting
Date: Fri, 16 Mar 2007 01:42:26 +0200 [thread overview]
Message-ID: <20070315234225.GA5509@localdomain> (raw)
In-Reply-To: <20070315153613.3d2eaf10.akpm@linux-foundation.org>
On Thu, Mar 15, 2007 at 03:36:13PM -0700, Andrew Morton wrote:
>
> > > > > Is this the intended behaviour?
> > > >
> > > > That sounds like a bug to me.
> > >
> > > I'm suspecting it's an oddity rather than a bug.
> >
> > It is intended behaviour.
>
> Each instance of
>
> main()
> {
> sleep(100);
> }
>
> appears to increase Committed_AS by around 200kb. But we've committed to
> providing it with 8MB for stack.
>
> How come this is correct?
Perhaps it makes a lot of sense if you regard stack growth at
the same sense that you regard heap growth by the means of brk().
Just by the fact that the stack is limited on default and RLIMIT_DATA
is unlimited, doesn't mean the we need to account for the maximum
stack size.
Perhaps for embedded systems where you want to have overcommit_memory=2
overcommit_ratio=100 and no swap (for design constraints), just to make
sure that allocations fail *always before* OOM gets triggered (and
therefore OOM never gets triggered, thankfully), it would have been
useful to look at Commited_AS to realize how much the system is close
to the maximum memory utilization potential.
Learning about this 'oddity' in Commited_AS, I'd guess it would be
better for me not to rely on it for measurements and perhaps tweak
smaller values of RSS_STACK for processes on that embedded system.
--
Dan Aloni
XIV LTD, http://www.xivstorage.com
da-x (at) monatomic.org, dan (at) xiv.co.il
next prev parent reply other threads:[~2007-03-15 23:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-13 16:33 thread stacks and strict vm overcommit accounting Dan Aloni
2007-03-15 19:06 ` Andrew Morton
2007-03-15 20:37 ` Hugh Dickins
2007-03-15 20:59 ` Ulrich Drepper
2007-03-15 23:33 ` Alan Cox
2007-03-15 22:36 ` Andrew Morton
2007-03-15 23:08 ` Hugh Dickins
2007-03-16 1:31 ` Alan Cox
2007-03-16 14:43 ` Jakub Jelinek
2007-03-15 23:42 ` Dan Aloni [this message]
2007-03-16 4:29 ` KAMEZAWA Hiroyuki
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=20070315234225.GA5509@localdomain \
--to=da-x@monatomic.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=hugh@veritas.com \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).