diff options
author | Andries E. Brouwer <andries.brouwer@cwi.nl> | 2004-09-29 18:41:37 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-29 18:41:37 -0700 |
commit | 237827056d5d9c86aab9e1f1d66eb4c9d0b6422c (patch) | |
tree | 09e71a62e689856f6e3c64cf98b0d93c258107ff /mm | |
parent | 339f152bbc5f29d103ce71e67fa5060e91f1c167 (diff) | |
download | history-237827056d5d9c86aab9e1f1d66eb4c9d0b6422c.tar.gz |
[PATCH] overcommit symbolic constants
Played a bit with overcommit the past hour.
Am not entirely satisfied with the no overcommit mode 2 -
programs segfault when the system is close to that boundary.
So, instead of the somewhat larger patch that I planned to send,
just symbolic names for the modes.
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 4 | ||||
-rw-r--r-- | mm/nommu.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 6738d1b397bce4..4bd891b1bea0a4 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -54,7 +54,7 @@ pgprot_t protection_map[16] = { __S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111 }; -int sysctl_overcommit_memory = 0; /* default is heuristic overcommit */ +int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ int sysctl_overcommit_ratio = 50; /* default is 50% */ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; atomic_t vm_committed_space = ATOMIC_INIT(0); @@ -907,7 +907,7 @@ munmap_back: return -ENOMEM; if (accountable && (!(flags & MAP_NORESERVE) || - sysctl_overcommit_memory > 1)) { + sysctl_overcommit_memory == OVERCOMMIT_NEVER)) { if (vm_flags & VM_SHARED) { /* Check memory availability in shmem_file_setup? */ vm_flags |= VM_ACCOUNT; diff --git a/mm/nommu.c b/mm/nommu.c index 114c0ccb4ee61c..dd4b66b8c9a6df 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -30,7 +30,7 @@ unsigned long max_mapnr; unsigned long num_physpages; unsigned long askedalloc, realalloc; atomic_t vm_committed_space = ATOMIC_INIT(0); -int sysctl_overcommit_memory; /* default is heuristic overcommit */ +int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ int sysctl_overcommit_ratio = 50; /* default is 50% */ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; |