From 59083b62294f91a9187cd8844eff1b6ef54ca330 Mon Sep 17 00:00:00 2001 From: Simon Derr Date: Thu, 4 Aug 2005 19:52:03 -0700 Subject: [PATCH] --- yaml --- r: 5664 b: refs/heads/master c: 2f60f8d3573ff90fe5d75a6d11fd2add1248e7d6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/mmap.c | 6 +++++- trunk/mm/nommu.c | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 1deabea94140..fa00a591b312 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b68e9f857271189bd7a59b74c99890de9195b0e1 +refs/heads/master: 2f60f8d3573ff90fe5d75a6d11fd2add1248e7d6 diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index da3fa90a0aae..404319477e71 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -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); diff --git a/trunk/mm/nommu.c b/trunk/mm/nommu.c index ce74452c02d9..fd4e8df0f02d 100644 --- a/trunk/mm/nommu.c +++ b/trunk/mm/nommu.c @@ -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);