diff options
author | Daniel Black <daniel@linux.ibm.com> | 2020-04-06 11:52:29 +1000 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2020-04-08 14:51:14 +0400 |
commit | 96d4b228ea5cb0dfd42d92b8e058ecd4d9be7b70 (patch) | |
tree | 2ed76fd0e3da8cb8294ce2121f218954383e18c1 | |
parent | 7b7a9161e2d210355e798aa2000e7ed7578e6d03 (diff) | |
download | mariadb-git-96d4b228ea5cb0dfd42d92b8e058ecd4d9be7b70.tar.gz |
my_large_pages: simplify solaris constants
-rw-r--r-- | mysys/my_largepage.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c index de8e0407798..246afa80ee0 100644 --- a/mysys/my_largepage.c +++ b/mysys/my_largepage.c @@ -213,8 +213,6 @@ int my_init_large_pages(my_bool super_large_pages) #endif #ifdef HAVE_SOLARIS_LARGE_PAGES -#define LARGE_PAGESIZE (4*1024*1024) /* 4MB */ -#define SUPER_LARGE_PAGESIZE (256*1024*1024) /* 256MB */ /* tell the kernel that we want to use 4/256MB page for heap storage and also for the stack. We use 4 MByte as default and if the @@ -226,14 +224,9 @@ int my_init_large_pages(my_bool super_large_pages) desired page sizes. */ int nelem= 0; - size_t max_desired_page_size; - size_t max_page_size= 0; - if (super_large_pages) - max_desired_page_size= SUPER_LARGE_PAGESIZE; - else - max_desired_page_size= LARGE_PAGESIZE; + size_t max_desired_page_size= (super_large_pages ? 256 : 4) * 1024 * 1024; + size_t max_page_size= my_next_large_page_size(max_desired_page_size, &nelem); - max_page_size= my_next_large_page_size(max_desired_page_size, &nelem); if (max_page_size > 0) { struct memcntl_mha mpss; |