Skip to contentSkip to conversation

mm-factor-commit-limit-calculation-fix broken on ARM-nommu

DISCUSSION Uwe Kleine-König 2 participants 2 messages Nov 11, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
maintainer
#1 lore raw
Quoted 9 lines · On Mon, 11 Nov 2013 10:28:15 +0100 Uwe Kleine-K__nig…

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 <[email protected]>
Subject: mm-factor-commit-limit-calculation-fix-fix

Cc Dave Hansen <[email protected]>
Cc Jerome Marchand <[email protected]>
Cc Michal Hocko <[email protected]>

---

 mm/mmap.c |    9 ---------
 mm/util.c |   13 +++++++++++++
 2 files changed, 13 insertions(+), 9 deletions(-)
mm/mmap.c renamed from mm/mmap.c~mm-factor-commit-limit-calculation-fix-fix +0 -9
diff -puN mm/mmap.c~mm-factor-commit-limit-calculation-fix-fix 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.
mm/util.c renamed from mm/util.c~mm-factor-commit-limit-calculation-fix-fix +13 -0
diff -puN mm/util.c~mm-factor-commit-limit-calculation-fix-fix 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);

_