From: Chris Wright <chrisw@osdl.org>
To: mingo@elte.hu, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] mmap topdown fix for large stack limit, large allocation
Date: Mon, 23 May 2005 14:06:29 -0700 [thread overview]
Message-ID: <20050523210629.GH27549@shell0.pdx.osdl.net> (raw)
The topdown changes in 2.6.12-rc1 can cause large allocations with
large stack limit to fail, despite there being space available. The
mmap_base-len is only valid when len >= mmap_base. However, nothing in
topdown allocator checks this. It's only (now) caught at higher level,
which will cause allocation to simply fail. The following change restores
the fallback to bottom-up path, which will allow large allocations with
large stack limit to potentially still succeed.
Signed-off-by: Chris Wright <chrisw@osdl.org>
---
mm/mmap.c | 4 ++++
1 files changed, 4 insertions(+)
mm/mmap.c: de54acd9942f9929004921042721df5cdfe2b6c7
--- k/mm/mmap.c
+++ l/mm/mmap.c
@@ -1251,6 +1251,9 @@ arch_get_unmapped_area_topdown(struct fi
return (mm->free_area_cache = addr-len);
}
+ if (mm->mmap_base < len)
+ goto bottomup;
+
addr = mm->mmap_base-len;
do {
@@ -1268,6 +1271,7 @@ arch_get_unmapped_area_topdown(struct fi
addr = vma->vm_start-len;
} while (len < vma->vm_start);
+bottomup:
/*
* A failed mmap() very likely causes application failure,
* so fall back to the bottom-up function here. This scenario
reply other threads:[~2005-05-23 21:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050523210629.GH27549@shell0.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
Powered by JetHome