diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-13 10:13:18 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-13 10:13:18 +0100 |
commit | 1e270d504d56cb015efe060b319e3a5b9bc6513f (patch) | |
tree | ef18e249732ce1a0ff98b342fa3edb8d2eceb46f /storage/xtradb/os/os0proc.cc | |
parent | 6a821d78a6a33aaf81909ab2858d13f95dbe2708 (diff) | |
download | mariadb-git-1e270d504d56cb015efe060b319e3a5b9bc6513f.tar.gz |
5.6.27-76.0
Diffstat (limited to 'storage/xtradb/os/os0proc.cc')
-rw-r--r-- | storage/xtradb/os/os0proc.cc | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/storage/xtradb/os/os0proc.cc b/storage/xtradb/os/os0proc.cc index ec629430baf..ff6d65e4ae6 100644 --- a/storage/xtradb/os/os0proc.cc +++ b/storage/xtradb/os/os0proc.cc @@ -32,12 +32,6 @@ Created 9/30/1995 Heikki Tuuri #include "ut0mem.h" #include "ut0byte.h" -/* Linux release version */ -#if defined(UNIV_LINUX) && defined(_GNU_SOURCE) -#include <string.h> /* strverscmp() */ -#include <sys/utsname.h> /* uname() */ -#endif - /* FreeBSD for example has only MAP_ANON, Linux has MAP_ANONYMOUS and MAP_ANON but MAP_ANON is marked as deprecated */ #if defined(MAP_ANONYMOUS) @@ -46,13 +40,6 @@ MAP_ANON but MAP_ANON is marked as deprecated */ #define OS_MAP_ANON MAP_ANON #endif -/* Linux's MAP_POPULATE */ -#if defined(MAP_POPULATE) -#define OS_MAP_POPULATE MAP_POPULATE -#else -#define OS_MAP_POPULATE 0 -#endif - UNIV_INTERN ibool os_use_large_pages; /* Large page size. This may be a boot-time option on some platforms */ UNIV_INTERN ulint os_large_page_size; @@ -76,32 +63,13 @@ os_proc_get_number(void) } /****************************************************************//** -Retrieve and compare operating system release. -@return TRUE if the OS release is equal to, or later than release. */ -UNIV_INTERN -ibool -os_compare_release( -/*===============*/ - const char* release /*!< in: OS release */ - __attribute__((unused))) -{ -#if defined(UNIV_LINUX) && defined(_GNU_SOURCE) - struct utsname name; - return uname(&name) == 0 && strverscmp(name.release, release) >= 0; -#else - return 0; -#endif -} - -/****************************************************************//** Allocates large pages memory. @return allocated memory */ UNIV_INTERN void* os_mem_alloc_large( /*===============*/ - ulint* n, /*!< in/out: number of bytes */ - ibool populate) /*!< in: virtual page preallocation */ + ulint* n) /*!< in/out: number of bytes */ { void* ptr; ulint size; @@ -187,13 +155,12 @@ skip: ut_ad(ut_is_2pow(size)); size = *n = ut_2pow_round(*n + (size - 1), size); ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | OS_MAP_ANON | - (populate ? OS_MAP_POPULATE : 0), -1, 0); + MAP_PRIVATE | OS_MAP_ANON, -1, 0); if (UNIV_UNLIKELY(ptr == (void*) -1)) { fprintf(stderr, "InnoDB: mmap(%lu bytes) failed;" " errno %lu\n", (ulong) size, (ulong) errno); - return(NULL); + ptr = NULL; } else { os_fast_mutex_lock(&ut_list_mutex); ut_total_allocated_memory += size; @@ -201,25 +168,6 @@ skip: UNIV_MEM_ALLOC(ptr, size); } #endif - -#if OS_MAP_ANON && OS_MAP_POPULATE - /* MAP_POPULATE is only supported for private mappings - since Linux 2.6.23. */ - populate = populate && !os_compare_release("2.6.23"); - - if (populate) { - fprintf(stderr, "InnoDB: Warning: mmap(MAP_POPULATE) " - "is not supported for private mappings. " - "Forcing preallocation by faulting in pages.\n"); - } -#endif - - /* Initialize the entire buffer to force the allocation - of physical memory page frames. */ - if (populate) { - memset(ptr, '\0', size); - } - return(ptr); } |