Commit e32d96dc authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[PATCH] remove the "half of memory" limit on mlock() and

It seems pretty pointless and people do complain about it occasionally.
parent 6ada8a9c
......@@ -111,16 +111,8 @@ asmlinkage long sys_mlock(unsigned long start, size_t len)
lock_limit >>= PAGE_SHIFT;
/* check against resource limits */
if (locked > lock_limit)
goto out;
/* we may lock at most half of physical memory... */
/* (this check is pretty bogus, but doesn't hurt) */
if (locked > num_physpages/2)
goto out;
if (locked <= lock_limit)
error = do_mlock(start, len, 1);
out:
up_write(&current->mm->mmap_sem);
return error;
}
......@@ -178,14 +170,7 @@ asmlinkage long sys_mlockall(int flags)
lock_limit >>= PAGE_SHIFT;
ret = -ENOMEM;
if (current->mm->total_vm > lock_limit)
goto out;
/* we may lock at most half of physical memory... */
/* (this check is pretty bogus, but doesn't hurt) */
if (current->mm->total_vm > num_physpages/2)
goto out;
if (current->mm->total_vm <= lock_limit)
ret = do_mlockall(flags);
out:
up_write(&current->mm->mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment