From: Werner Almesberger <Werner.Almesberger@epfl.ch>
To: linux-kernel@vger.kernel.org
Cc: riel@conectiva.com.br
Subject: [PATCH] redundant call to vm_enough_memory
Date: Fri, 9 Feb 2001 01:42:27 +0100 [thread overview]
Message-ID: <20010209014227.O13984@almesberger.net> (raw)
This patch removes a redundant call to vm_enough_memory from
mm/mmap.c:sys_brk. Exactly the same test is made in mm/mmap.c:do_brk,
with the exception that the latter is done after calling do_munmap.
Note that do_munmap in do_brk has no effect when called from sys_brk,
because the check for find_vma_intersection only lets us pass if there
are no memory objects in the way.
The patch is for 2.4.2-pre1, with my /proc/sys/vm/max_map_count patch
applied. (The latter only changes some offsets, not the context of this
patch.)
- Werner
------------------------------------ patch ------------------------------------
--- linux.orig/mm/mmap.c Mon Jan 29 17:10:41 2001
+++ linux/mm/mmap.c Fri Feb 9 01:12:55 2001
@@ -148,10 +149,6 @@
if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE))
goto out;
- /* Check if we have enough memory.. */
- if (!vm_enough_memory((newbrk-oldbrk) >> PAGE_SHIFT))
- goto out;
-
/* Ok, looks good - let it rip. */
if (do_brk(oldbrk, newbrk-oldbrk) != oldbrk)
goto out;
--
_________________________________________________________________________
/ Werner Almesberger, ICA, EPFL, CH Werner.Almesberger@epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
reply other threads:[~2001-02-09 0:42 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=20010209014227.O13984@almesberger.net \
--to=werner.almesberger@epfl.ch \
--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;
as well as URLs for NNTP newsgroup(s).