From: "Stephen C. Tweedie" <sct@redhat.com>
To: Jamie Lokier <lk@tantalophile.demon.co.uk>
Cc: "Stephen C. Tweedie" <sct@redhat.com>,
Raymond Nijssen <raymond@zeropage.com>,
Linux Kernel <linux-kernel@vger.rutgers.edu>,
Linux MM <linux-mm@kvack.org>
Subject: Re: maximum memory limit
Date: Mon, 3 Jul 2000 15:18:23 +0100 [thread overview]
Message-ID: <20000703151823.D3284@redhat.com> (raw)
In-Reply-To: <20000703153213.B29421@pcep-jamie.cern.ch>; from lk@tantalophile.demon.co.uk on Mon, Jul 03, 2000 at 03:32:13PM +0200
Hi,
On Mon, Jul 03, 2000 at 03:32:13PM +0200, Jamie Lokier wrote:
> There are lots of custom malloc libraries. If you're going to teach
> Glibc something anyway, why not add a new mmap flag?
Because by the time glibc has been loaded, it's too late! We need the
crt0.o stub to load libdl.so lower in memory or we have already
clobbered the address space irretrievably. That's why Ben's proposal
for a per-process prctl() for the mmap base would seem to work well
--- you can just use floating mmaps and the kernel will automatically
place them somewhere that won't interfere with really large mallocs.
> One flag I think would be quite useful is MAP_NOCLOBBER|MAP_FIXED: there
> are times when I'd like to be able to _try_ mapping something at a fixed
> address, but fail if there is something mapped there already.
Good idea, but it doesn't help this problem.
> As a natural extension, a map flag which says "try to map at the
> supplied address, but if there is an object there search for a big
> enough hole above the supplied address" would simultaneously be useful
> for malloc optimisations like you're suggesting, and pre-relocated
> shared libraries. That would be MAP_NOCLOBBER without MAP_FIXED.
That's what non-MAP_FIXED mmaps already do. From mmap.c:
/* Obtain the address to map to. we verify (or select) it and
ensure
* that it represents a valid section of the address space.
*/
if (flags & MAP_FIXED) {
if (addr & ~PAGE_MASK)
return -EINVAL;
} else {
addr = get_unmapped_area(addr, len);
if (!addr)
return -ENOMEM;
}
get_unmapped_area looks for the next unmapped area above addr,
with the start address defaulting to TASK_UNMAPPED_BASE only if
addr==0 going in.
Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
next prev parent reply other threads:[~2000-07-03 14:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <381740616.949993193648.JavaMail.root@web36.pub01>
2000-02-08 14:08 ` Rik van Riel
2000-02-08 14:48 ` Matthew Kirkwood
2000-02-08 15:04 ` Mark Hahn
2000-02-08 15:25 ` Jakub Jelinek
2000-02-08 16:13 ` Rogier Wolff
2000-02-08 16:25 ` Eric W. Biederman
2000-07-02 5:35 ` Raymond Nijssen
2000-07-03 10:35 ` Stephen C. Tweedie
2000-07-03 13:32 ` Jamie Lokier
2000-07-03 14:18 ` Stephen C. Tweedie [this message]
2000-07-03 15:01 ` Jamie Lokier
2000-07-03 19:32 ` Raymond Nijssen
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=20000703151823.D3284@redhat.com \
--to=sct@redhat.com \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=lk@tantalophile.demon.co.uk \
--cc=raymond@zeropage.com \
/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