Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2e2138ba
Commit
2e2138ba
authored
Apr 04, 2020
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified away my_get_large_page_size()
parent
30379b48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
41 deletions
+17
-41
include/my_sys.h
include/my_sys.h
+0
-10
mysys/my_largepage.c
mysys/my_largepage.c
+17
-26
sql/mysqld.cc
sql/mysqld.cc
+0
-5
No files found.
include/my_sys.h
View file @
2e2138ba
...
...
@@ -176,13 +176,6 @@ extern void *my_memdup(PSI_memory_key key, const void *from,size_t length,myf My
extern
char
*
my_strdup
(
PSI_memory_key
key
,
const
char
*
from
,
myf
MyFlags
);
extern
char
*
my_strndup
(
PSI_memory_key
key
,
const
char
*
from
,
size_t
length
,
myf
MyFlags
);
#if defined(_WIN32) || (defined(HAVE_MMAP) && !defined(__linux__) \
&& !defined(MAP_ALIGNED))
extern
void
my_get_large_page_size
(
void
);
#else
#define my_get_large_page_size() do {} while(0)
#endif
#ifdef HAVE_LARGE_PAGES
int
my_init_large_pages
(
my_bool
super_large_pages
);
uchar
*
my_large_malloc
(
size_t
*
size
,
myf
my_flags
);
...
...
@@ -194,9 +187,6 @@ void my_large_free(void *ptr, size_t size);
#ifdef _WIN32
extern
BOOL
my_obtain_privilege
(
LPCSTR
lpPrivilege
);
#else
#define my_obtain_privilege(A) (1)
#define SE_LOCK_MEMORY_NAME "SeLockMemoryPrivilege"
#endif
void
my_init_atomic_write
(
void
);
...
...
mysys/my_largepage.c
View file @
2e2138ba
...
...
@@ -38,6 +38,10 @@ extern int memcntl(caddr_t, size_t, int, caddr_t, int, int);
#endif
/* __sun__ ... */
#endif
/* HAVE_SOLARIS_LARGE_PAGES */
#if defined(_WIN32) || (!defined(__linux__) && !defined(MAP_ALIGNED))
static
size_t
my_large_page_size
;
#endif
#ifdef HAVE_LARGE_PAGES
static
my_bool
my_use_large_pages
=
0
;
#else
...
...
@@ -121,8 +125,7 @@ static size_t my_next_large_page_size(size_t sz, int *start)
int
my_init_large_pages
(
my_bool
super_large_pages
)
{
my_use_large_pages
=
1
;
my_get_large_page_sizes
(
my_large_page_sizes
);
#ifdef _WIN32
if
(
!
my_obtain_privilege
(
SE_LOCK_MEMORY_NAME
))
{
fprintf
(
stderr
,
"mysqld: Lock Pages in memory access rights required for "
...
...
@@ -130,6 +133,18 @@ int my_init_large_pages(my_bool super_large_pages)
"mariadb-memory-allocation/#huge-pages"
);
return
1
;
}
my_large_page_size
=
GetLargePageMinimum
();
#elif !defined(__linux__) && !defined(MAP_ALIGNED)
/*
This is a fudge as we only use this to ensure that mmap allocations are of
this size.
*/
my_large_page_size
=
my_getpagesize
();
#endif
my_use_large_pages
=
1
;
my_get_large_page_sizes
(
my_large_page_sizes
);
#ifdef HAVE_SOLARIS_LARGE_PAGES
#define LARGE_PAGESIZE (4*1024*1024)
/* 4MB */
#define SUPER_LARGE_PAGESIZE (256*1024*1024)
/* 256MB */
...
...
@@ -403,18 +418,6 @@ MAP_ANON but MAP_ANONYMOUS is marked "for compatibility" */
#error unsupported mmap - no MAP_ANON{YMOUS}
#endif
static
size_t
my_large_page_size
=
0
;
/* mmap-specific function to determine the size of large pages
This is a fudge as we only use this to ensure that mmap allocations
are of this size.
*/
void
my_get_large_page_size
(
void
)
{
my_large_page_size
=
my_getpagesize
();
}
/* mmap(non-Linux,non-FreeBSD) pages allocator */
...
...
@@ -447,18 +450,6 @@ uchar* my_large_malloc_int(size_t *size, myf my_flags)
#endif
/* defined(HAVE_MMAP) && !defined(__linux__) && !defined(_WIN32) */
#ifdef _WIN32
static
size_t
my_large_page_size
=
0
;
/* Windows-specific function to determine the size of large pages */
void
my_get_large_page_size
(
void
)
{
DBUG_ENTER
(
"my_get_large_page_size_int"
);
my_large_page_size
=
my_use_large_pages
?
GetLargePageMinimum
()
:
my_getpagesize
();
DBUG_VOID_RETURN
;
}
/* Windows-specific large pages allocator */
...
...
sql/mysqld.cc
View file @
2e2138ba
...
...
@@ -3947,11 +3947,6 @@ static int init_common_variables()
return
1
;
}
}
/*
my_get_large_page_size results used by large allocations even if not large pages.
This function must be called after my_init_large_pages.
*/
my_get_large_page_size
();
#endif
/* HAVE_LARGE_PAGES */
#if defined(HAVE_POOL_OF_THREADS)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment