diff -urN linux-2.2.20/mm/mlock.c linux-2.2.20-memtest/mm/mlock.c
--- linux-2.2.20/mm/mlock.c	Thu Aug 26 09:35:37 1999
+++ linux-2.2.20-memtest/mm/mlock.c	Wed Feb 13 10:13:30 2002
@@ -194,9 +194,9 @@
 			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)
+	/* Normal Linux can only mlock half of physical memory... */
+	/* Let's up that. */
+	if (locked > (num_physpages*15/16))
 		goto out;
 
 	error = do_mlock(start, len, 1);
@@ -268,9 +268,9 @@
 			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)
+	/* Normal Linux can only mlock half of physical memory... */
+	/* Let's up that. */
+	if (current->mm->total_vm > (num_physpages*15/16))
 		goto out;
 
 	ret = do_mlockall(flags);
