From: William Lee Irwin III <wli@holomorphy.com>
To: Rik van Riel <riel@redhat.com>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
Mikael Pettersson <mikpe@csd.uu.se>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org,
James Antill <james.antill@redhat.com>,
Bryn Reeves <breeves@redhat.com>
Subject: Re: don't let mmap allocate down to zero
Date: Thu, 27 Jan 2005 12:44:55 -0800 [thread overview]
Message-ID: <20050127204455.GM10843@holomorphy.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0501271420070.13927@chimarrao.boston.redhat.com>
On Thu, 27 Jan 2005, William Lee Irwin III wrote:
>> The only claim above is the effect of clobbering virtual page 0 and
>> referring to this phenomenon by the macro. I was rather careful not to
>> claim a specific lower boundary to the address space.
On Thu, Jan 27, 2005 at 02:22:50PM -0500, Rik van Riel wrote:
> OK, here is a patch that does compile against the current
> 2.6 kernel. It it obvious we need a cutoff somewhere, so
> I've chosen one that's sure to spark up a conversation
> and I'll let others decide what that cutoff value is ;)))
Okay, 2 comments:
(a) The most permissive scheme possible given architectural constraints
I'm aware of (thanks, rmk) would only disallow below PAGE_SIZE,
or basically !vma->vm_start. mm->brk affects executables with
high load addresses and prevents the use of the lower 128MB on
ia32, which I personally make extensive use of in order to move
program stacks out of the way of larger mmap()'s and to conserve
pagetable memory.
(b) sys_mremap() isn't covered.
Does the following give you any new ideas?
-- wli
Index: mm1-2.6.11-rc2/mm/mmap.c
===================================================================
--- mm1-2.6.11-rc2.orig/mm/mmap.c 2005-01-26 00:30:38.000000000 -0800
+++ mm1-2.6.11-rc2/mm/mmap.c 2005-01-27 12:33:34.000000000 -0800
@@ -1258,7 +1258,7 @@
* return with success:
*/
vma = find_vma(mm, addr);
- if (!vma || addr+len <= vma->vm_start)
+ if (addr && (!vma || addr+len <= vma->vm_start))
/* remember the address as a hint for next time */
return (mm->free_area_cache = addr);
Index: mm1-2.6.11-rc2/mm/mremap.c
===================================================================
--- mm1-2.6.11-rc2.orig/mm/mremap.c 2005-01-26 00:26:43.000000000 -0800
+++ mm1-2.6.11-rc2/mm/mremap.c 2005-01-27 12:34:34.000000000 -0800
@@ -297,6 +297,8 @@
if (flags & MREMAP_FIXED) {
if (new_addr & ~PAGE_MASK)
goto out;
+ if (!new_addr)
+ goto out;
if (!(flags & MREMAP_MAYMOVE))
goto out;
next prev parent reply other threads:[~2005-01-27 20:50 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-26 16:18 don't let mmap allocate down to zero Rik van Riel
2005-01-26 16:38 ` linux-os
2005-01-26 17:05 ` Sytse Wielinga
2005-01-26 17:34 ` Chris Friesen
2005-01-26 17:57 ` Bryn Reeves
2005-01-26 18:37 ` linux-os
2005-01-26 18:54 ` Rik van Riel
2005-01-26 19:09 ` linux-os
2005-01-26 19:13 ` Chris Friesen
2005-01-26 19:08 ` Chris Friesen
2005-01-26 18:10 ` Olivier Galibert
2005-01-26 18:20 ` linux-os
2005-01-26 18:31 ` Olivier Galibert
2005-01-26 18:39 ` linux-os
2005-01-26 19:41 ` Arjan van de Ven
2005-01-26 20:26 ` Andy Isaacson
2005-01-26 20:42 ` Rik van Riel
2005-01-26 22:12 ` Kyle Moffett
2005-01-26 23:31 ` Brian Gerst
2005-01-26 17:25 ` William Lee Irwin III
2005-01-27 5:09 ` William Lee Irwin III
2005-01-27 5:18 ` Dave Jones
2005-01-27 5:28 ` William Lee Irwin III
2005-01-27 9:29 ` Mikael Pettersson
2005-01-27 12:52 ` William Lee Irwin III
2005-01-27 14:25 ` Russell King
2005-01-27 15:12 ` William Lee Irwin III
2005-01-27 19:22 ` Rik van Riel
2005-01-27 20:44 ` William Lee Irwin III [this message]
2005-01-27 20:58 ` Rik van Riel
2005-01-27 21:13 ` William Lee Irwin III
2005-01-27 21:28 ` Rik van Riel
2005-01-28 5:30 ` William Lee Irwin III
2005-01-28 13:01 ` Rik van Riel
2005-01-28 14:14 ` Hugh Dickins
2005-01-28 14:26 ` William Lee Irwin III
2005-01-28 15:41 ` Rik van Riel
2005-01-28 15:53 ` Hugh Dickins
2005-01-27 21:58 ` linux-os
2005-01-27 14:26 ` Mikael Pettersson
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=20050127204455.GM10843@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@osdl.org \
--cc=breeves@redhat.com \
--cc=james.antill@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@csd.uu.se \
--cc=riel@redhat.com \
--cc=rmk+lkml@arm.linux.org.uk \
/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