From: Rob Landley <landley@trommello.org>
To: "H. Peter Anvin" <hpa@zytor.com>, Rik van Riel <riel@conectiva.com.br>
Cc: linux-kernel@vger.kernel.org
Subject: Re: can we make anonymous memory non-EXECUTABLE?
Date: Wed, 9 Jan 2002 06:32:39 -0500 [thread overview]
Message-ID: <200201091919.g09JJtA26375@snark.thyrsus.com> (raw)
In-Reply-To: <Pine.LNX.4.33L.0201090049390.2985-100000@imladris.surriel.com> <3C3BB05D.1040501@zytor.com>
In-Reply-To: <3C3BB05D.1040501@zytor.com>
On Tuesday 08 January 2002 09:52 pm, H. Peter Anvin wrote:
> Rik van Riel wrote:
> > On 8 Jan 2002, H. Peter Anvin wrote:
> >>One way to do this would be to create a newbrk() syscall which takes a
> >>permission argument (for new pages.)
> >
> > ITYM mmap(2)
>
> That's an idea, too. WTF do we actually need brk() for? If it's only
> there to be annoying, let's get rid of it completely and let the C
> library implement it -- stating its assumptions explicitly.
>
> -hpa
There was a fun little panel a few months back at Atlanta Linux Showcase
(which was inexplicably held in california this year, but I'm told they're
patching that in the next release... :)
Apparently, for mallocs below a certain size, glibc uses brk, and above a
certain size, it uses mmap. And the mmap variant is something like 10 times
slower than the brk variant, because of all the soft page faults, fiddling
with page tables, associated cache trashing, etc. (The guy found it trying
to figure out why his app was SLOWER on Linux than on Irix, and eventually
found a glibc variable that could make linux faster: raising glibc's
threshold where it does brk for malloc to infinity.)
Glibc does mmap instead of brk because theoretically brk can leave wasted
memory between fragments, although apparently nobody's ever seen more than
10% waste in a live program, and the speed penality of taking a soft page
fault at access time to muck about with the page tables is a LOT bigger than
10%...
Rob
next prev parent reply other threads:[~2002-01-09 19:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-08 0:25 David Mosberger
2002-01-08 6:02 ` David S. Miller
2002-01-08 13:23 ` Alan Cox
2002-01-08 19:12 ` David Mosberger
2002-01-08 19:32 ` Albert D. Cahalan
2002-01-09 2:44 ` H. Peter Anvin
2002-01-09 2:49 ` Rik van Riel
2002-01-09 2:52 ` H. Peter Anvin
2002-01-09 11:32 ` Rob Landley [this message]
2002-01-09 19:47 ` Doug McNaught
2002-01-09 3:11 ` Alan Cox
2002-01-09 9:40 ` Erik Andersen
2002-01-08 19:15 ` [Linux-ia64] " David Mosberger
2002-01-10 1:04 ` Paul Mackerras
2002-01-10 3:40 ` David Mosberger
2002-01-11 5:49 ` David Mosberger
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=200201091919.g09JJtA26375@snark.thyrsus.com \
--to=landley@trommello.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@conectiva.com.br \
/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
all inboxes | Powered by JetHome®