I see system admins often confused when they sysctl vm.overcommit_memory.
This patch makes overcommit_memory enumeration sensible.
0 - no overcommit
1 - always overcommit
2 - heuristic overcommit (default)
I don't feel this would break any userspace scripts.
If it seems OK, I'll
update the documents.
Signed-off-by: Coywolf Qi Hunt <qiyong@xxxxxxxxx>
---
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 18a5689..e50f5ad 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -10,9 +10,9 @@
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
-#define OVERCOMMIT_GUESS 0
+#define OVERCOMMIT_NEVER 0
#define OVERCOMMIT_ALWAYS 1
-#define OVERCOMMIT_NEVER 2
+#define OVERCOMMIT_GUESS 2
extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
extern atomic_t vm_committed_space;