From: "Ted Ts'o" <tytso@mit.edu>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
martin capitanio <m@capitanio.org>,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org
Subject: Re: mmap, the language go, problems with the linux kernel
Date: Sat, 12 Feb 2011 20:22:27 -0500 [thread overview]
Message-ID: <20110213012227.GC2598@thunk.org> (raw)
In-Reply-To: <87sjvtba3u.fsf@mid.deneb.enyo.de>
On Sat, Feb 12, 2011 at 03:28:37PM +0100, Florian Weimer wrote:
> * Alan Cox:
>
> > Linux implements virtual address space limits, and enforces them. The go
> > language stuff wants to allocate huge amounts of virtual space so you
> > need to tell the OS you want to allow it to do crazy stuff, which you can
> > do so. But virtual address space is not free - it has to be tracked and
> > if the application suddenely tries to fill all of it what will happen ?
> >
> > You'll hit problems if the kernel is running with vm overcommit disabled
> > (as well configured servers do),
>
> The odd thing is that prot==0 does *not* count against the
> vm.overcommit_memory=2 limit, only against ulimit -v. The limit is
> only enforced for the parts on which mprotect is called. I think this
> should really be part of the public API (I'm not sure if it is right
> now, it could well be an accident), to avoid the problems you
> describe.
The overcommit_memory logic does not include any pages which are
mapped read-only. Technically that's not quite enough --- in theory
you could have a debugging attach to every single read-only text page
and set breakpoints on every single page. Digital's OSF/1 operating
system went to such lengths, which meant that you if you were running
(say) an FTP server where you might have hundreds of connections at
the same time, you would need to have enough swap space for every
single ftpd's text page as if they had been modified --- even though
in practice that never happened.
So it's not just prot==0 pages which are not counted; read-only pages
are not counted, either. This probably falls in the category of
"implementation detail", though. If and when we start having
instances where huge number of breakpoints of userspace kprobes get
set (say, if Systemtap actually gets wide use and the userspace probes
patch actually makes it into mainline), we might have to change the
details of how we deal with the accounting. I'm not sure it's worth
it to specify in great detail how things are done at this point, since
in the future it's possible that we might want to change them.
- Ted
next prev parent reply other threads:[~2011-02-13 1:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-08 12:37 mmap, the language go, problems with the linux kernel martin capitanio
2011-02-08 13:26 ` Alan Cox
2011-02-12 14:28 ` Florian Weimer
2011-02-13 1:22 ` Ted Ts'o [this message]
2011-02-16 20:51 ` Florian Weimer
2011-02-08 16:23 ` Linus Torvalds
2011-02-09 16:30 ` Martin Capitanio
2011-02-09 16:40 ` Russ Cox
2011-02-09 19:17 ` Ted Ts'o
2011-02-09 19:56 ` [golang-dev] " Ian Lance Taylor
2011-02-09 20:11 ` Ted Ts'o
2011-02-16 18:16 ` Hannes Frederic Sowa
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=20110213012227.GC2598@thunk.org \
--to=tytso@mit.edu \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=fw@deneb.enyo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=m@capitanio.org \
--cc=torvalds@linux-foundation.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