linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de
Subject: Re: mm-factor-commit-limit-calculation-fix broken on ARM-nommu
Date: Mon, 11 Nov 2013 11:52:21 -0800	[thread overview]
Message-ID: <20131111115221.7582f4d924d5ca16bb2c1100@linux-foundation.org> (raw)
In-Reply-To: <20131111092815.GJ14892@pengutronix.de>

On Mon, 11 Nov 2013 10:28:15 +0100 Uwe Kleine-K__nig <u.kleine-koenig@pengutronix.de> wrote:

> Hello Andrew,
> 
> in mm-factor-commit-limit-calculation-fix you move vm_commit_limit to
> mm/mmap.c. This file is only compiled with CONFIG_MMU on though. So my
> build fails here.
> 
> There are some more problems that I didn't look into yet, but if you
> want to look into it, efm32_defconfig for ARCH=arm is what I'm seeing
> broken.

yup.  Hopefully mm-factor-commit-limit-calculation-fix-fix.patch
fix-fixes this.


From: Andrew Morton <akpm@linux-foundation.org>
Subject: mm-factor-commit-limit-calculation-fix-fix

Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mmap.c |    9 ---------
 mm/util.c |   13 +++++++++++++
 2 files changed, 13 insertions(+), 9 deletions(-)

diff -puN mm/mmap.c~mm-factor-commit-limit-calculation-fix-fix mm/mmap.c
--- a/mm/mmap.c~mm-factor-commit-limit-calculation-fix-fix
+++ a/mm/mmap.c
@@ -110,15 +110,6 @@ unsigned long vm_memory_committed(void)
 EXPORT_SYMBOL_GPL(vm_memory_committed);
 
 /*
- * Commited memory limit enforced when OVERCOMMIT_NEVER policy is used
- */
-unsigned long vm_commit_limit(void)
-{
-	return ((totalram_pages - hugetlb_total_pages())
-		* sysctl_overcommit_ratio / 100) + total_swap_pages;
-}
-
-/*
  * Check that a process has enough memory to allocate a new virtual
  * mapping. 0 means there is enough memory for the allocation to
  * succeed and -ENOMEM implies there is not.
diff -puN mm/util.c~mm-factor-commit-limit-calculation-fix-fix mm/util.c
--- a/mm/util.c~mm-factor-commit-limit-calculation-fix-fix
+++ a/mm/util.c
@@ -7,6 +7,9 @@
 #include <linux/security.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
+#include <linux/mman.h>
+#include <linux/hugetlb.h>
+
 #include <asm/uaccess.h>
 
 #include "internal.h"
@@ -398,6 +401,16 @@ struct address_space *page_mapping(struc
 	return mapping;
 }
 
+/*
+ * Commited memory limit enforced when OVERCOMMIT_NEVER policy is used
+ */
+unsigned long vm_commit_limit(void)
+{
+	return ((totalram_pages - hugetlb_total_pages())
+		* sysctl_overcommit_ratio / 100) + total_swap_pages;
+}
+
+
 /* Tracepoints definitions. */
 EXPORT_TRACEPOINT_SYMBOL(kmalloc);
 EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);
_


      reply	other threads:[~2013-11-11 19:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11  9:28 mm-factor-commit-limit-calculation-fix broken on ARM-nommu Uwe Kleine-König
2013-11-11 19:52 ` Andrew Morton [this message]

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=20131111115221.7582f4d924d5ca16bb2c1100@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).