diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-18 01:37:44 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-18 01:37:49 -0400 |
commit | dc3f81b129b5439ba7bac265bbc6a51a39275dae (patch) | |
tree | 216030731d911249496d2e97206cd61431e31c89 /mm/mmap.c | |
parent | d2517a49d55536b38c7a87e5289550cfedaa4dcc (diff) | |
parent | 1406de8e11eb043681297adf86d6892ff8efc27a (diff) |
Merge commit 'v2.6.30-rc6' into perfcounters/core
Merge reason: this branch was on an -rc4 base, merge it up to -rc6
to get the latest upstream fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -86,7 +86,7 @@ EXPORT_SYMBOL(vm_get_page_prot); | |||
86 | int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ | 86 | int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ |
87 | int sysctl_overcommit_ratio = 50; /* default is 50% */ | 87 | int sysctl_overcommit_ratio = 50; /* default is 50% */ |
88 | int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; | 88 | int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; |
89 | atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0); | 89 | struct percpu_counter vm_committed_as; |
90 | 90 | ||
91 | /* | 91 | /* |
92 | * Check that a process has enough memory to allocate a new virtual | 92 | * Check that a process has enough memory to allocate a new virtual |
@@ -180,11 +180,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) | |||
180 | if (mm) | 180 | if (mm) |
181 | allowed -= mm->total_vm / 32; | 181 | allowed -= mm->total_vm / 32; |
182 | 182 | ||
183 | /* | 183 | if (percpu_counter_read_positive(&vm_committed_as) < allowed) |
184 | * cast `allowed' as a signed long because vm_committed_space | ||
185 | * sometimes has a negative value | ||
186 | */ | ||
187 | if (atomic_long_read(&vm_committed_space) < (long)allowed) | ||
188 | return 0; | 184 | return 0; |
189 | error: | 185 | error: |
190 | vm_unacct_memory(pages); | 186 | vm_unacct_memory(pages); |
@@ -2491,4 +2487,8 @@ void mm_drop_all_locks(struct mm_struct *mm) | |||
2491 | */ | 2487 | */ |
2492 | void __init mmap_init(void) | 2488 | void __init mmap_init(void) |
2493 | { | 2489 | { |
2490 | int ret; | ||
2491 | |||
2492 | ret = percpu_counter_init(&vm_committed_as, 0); | ||
2493 | VM_BUG_ON(ret); | ||
2494 | } | 2494 | } |