Handle large user-mode page sizes, tested to 64k
[vpp.git] / svm / svm.c
index c629f93..4d45b29 100644 (file)
--- a/svm/svm.c
+++ b/svm/svm.c
@@ -632,7 +632,10 @@ static void svm_region_init_internal (char *root_path)
     atexit(svm_mutex_cleanup);
 
     /* Randomize the shared-VM base at init time */
-    randomize_baseva = (ticks & 15) * 4096;
+    if (MMAP_PAGESIZE <= (4<<10))
+        randomize_baseva = (ticks & 15) * MMAP_PAGESIZE;
+    else
+        randomize_baseva = (ticks & 3) * MMAP_PAGESIZE;
 
     vec_validate(a,0);
     a->root_path = root_path;