From: Dave Barach Date: Sat, 12 Dec 2015 15:37:00 +0000 (-0500) Subject: Handle large user-mode page sizes, tested to 64k X-Git-Tag: odp_vpp~2304^2 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=95bb883a62b5b4da53c5082ae93ccc3bfd867467;p=odp4vpp.git Handle large user-mode page sizes, tested to 64k Change-Id: Iccabc1be6e3a2822268c7b60e9c4e8250677c2ac Signed-off-by: Dave Barach --- diff --git a/svm/svm.c b/svm/svm.c index c629f932..4d45b297 100644 --- 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; diff --git a/svm/svm.h b/svm/svm.h index 95c55001..5f112cb8 100644 --- a/svm/svm.h +++ b/svm/svm.h @@ -25,7 +25,7 @@ #include #include -#define MMAP_PAGESIZE (4<<10) +#define MMAP_PAGESIZE (clib_mem_get_page_size()) #define SVM_VERSION ((1<<16) | 1) /* set to declare region ready. */ @@ -34,7 +34,7 @@ #define SVM_FLAGS_NODATA (1<<2) /* region will be further subdivided */ #define SVM_FLAGS_NEED_DATA_INIT (1<<3) -#define SVM_PVT_MHEAP_SIZE (32<<10) /* region's private mheap (32k) */ +#define SVM_PVT_MHEAP_SIZE (128<<10) /* region's private mheap (128k) */ typedef struct svm_region_ { volatile uword version;