Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5664
b: refs/heads/master
c: 2f60f8d
h: refs/heads/master
v: v3
  • Loading branch information
Simon Derr authored and Linus Torvalds committed Aug 5, 2005
1 parent 73bc119 commit 59083b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b68e9f857271189bd7a59b74c99890de9195b0e1
refs/heads/master: 2f60f8d3573ff90fe5d75a6d11fd2add1248e7d6
6 changes: 5 additions & 1 deletion trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin)
leave 3% of the size of this process for other processes */
allowed -= current->mm->total_vm / 32;

if (atomic_read(&vm_committed_space) < allowed)
/*
* cast `allowed' as a signed long because vm_committed_space
* sometimes has a negative value
*/
if (atomic_read(&vm_committed_space) < (long)allowed)
return 0;

vm_unacct_memory(pages);
Expand Down
6 changes: 5 additions & 1 deletion trunk/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin)
leave 3% of the size of this process for other processes */
allowed -= current->mm->total_vm / 32;

if (atomic_read(&vm_committed_space) < allowed)
/*
* cast `allowed' as a signed long because vm_committed_space
* sometimes has a negative value
*/
if (atomic_read(&vm_committed_space) < (long)allowed)
return 0;

vm_unacct_memory(pages);
Expand Down

0 comments on commit 59083b6

Please sign in to comment.