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
4338bb8a
Commit
4338bb8a
authored
Apr 03, 2020
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coding style fixes
parent
e4a96078
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
22 deletions
+28
-22
include/my_bit.h
include/my_bit.h
+3
-2
include/my_sys.h
include/my_sys.h
+3
-3
mysys/mf_keycache.c
mysys/mf_keycache.c
+2
-1
mysys/my_largepage.c
mysys/my_largepage.c
+15
-13
sql/mysqld.cc
sql/mysqld.cc
+4
-2
storage/innobase/os/os0proc.cc
storage/innobase/os/os0proc.cc
+1
-1
No files found.
include/my_bit.h
View file @
4338bb8a
...
...
@@ -74,8 +74,9 @@ static inline CONSTEXPR uint my_bit_log2_size_t(size_t value)
{
#ifdef __cplusplus
static_assert
(
sizeof
(
size_t
)
<=
sizeof
(
ulonglong
),
"size_t <= ulonglong is an assumption that needs to be fixed for this architecture. "
"Please create an issue on https://jira.mariadb.org"
);
"size_t <= ulonglong is an assumption that needs to be fixed "
"for this architecture. Please create an issue on "
"https://jira.mariadb.org"
);
#endif
return
my_bit_log2_uint64
((
ulonglong
)
value
);
}
...
...
include/my_sys.h
View file @
4338bb8a
...
...
@@ -185,11 +185,11 @@ extern void my_get_large_page_size(void);
#ifdef HAVE_LARGE_PAGE_OPTION
int
my_init_large_pages
(
my_bool
super_large_pages
);
uchar
*
my_large_malloc
(
size_t
*
size
,
myf
my_flags
);
uchar
*
my_large_malloc
(
size_t
*
size
,
myf
my_flags
);
void
my_large_free
(
void
*
ptr
,
size_t
size
);
#else
#define my_large_malloc(A,
B) my_malloc_lock(*(A),
(B))
#define my_large_free(A,B) my_free_lock((A))
#define my_large_malloc(A,
B) my_malloc_lock(*(A),
(B))
#define my_large_free(A,
B) my_free_lock((A))
#endif
/* HAVE_LARGE_PAGE_OPTION */
#ifdef _WIN32
...
...
mysys/mf_keycache.c
View file @
4338bb8a
...
...
@@ -547,7 +547,8 @@ int init_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
((
size_t
)
blocks
*
keycache
->
key_cache_block_size
)
>
use_mem
&&
blocks
>
8
)
blocks
--
;
keycache
->
allocated_mem_size
=
blocks
*
keycache
->
key_cache_block_size
;
if
((
keycache
->
block_mem
=
my_large_malloc
(
&
keycache
->
allocated_mem_size
,
MYF
(
0
))))
if
((
keycache
->
block_mem
=
my_large_malloc
(
&
keycache
->
allocated_mem_size
,
MYF
(
0
))))
{
/*
Allocate memory for blocks, hash_links and hash entries;
...
...
mysys/my_largepage.c
View file @
4338bb8a
...
...
@@ -125,8 +125,9 @@ int my_init_large_pages(my_bool super_large_pages)
my_get_large_page_sizes
(
my_large_page_sizes
);
if
(
!
my_obtain_privilege
(
SE_LOCK_MEMORY_NAME
))
{
fprintf
(
stderr
,
"mysqld: Lock Pages in memory access rights required for use with large-pages, "
"see https://mariadb.com/kb/en/library/mariadb-memory-allocation/#huge-pages"
);
fprintf
(
stderr
,
"mysqld: Lock Pages in memory access rights required for "
"use with large-pages, see https://mariadb.com/kb/en/library/"
"mariadb-memory-allocation/#huge-pages"
);
return
1
;
}
#ifdef HAVE_SOLARIS_LARGE_PAGES
...
...
@@ -158,12 +159,12 @@ int my_init_large_pages(my_bool super_large_pages)
mpss
.
mha_cmd
=
MHA_MAPSIZE_BSSBRK
;
mpss
.
mha_pagesize
=
max_page_size
;
mpss
.
mha_flags
=
0
;
if
(
memcntl
(
NULL
,
0
,
MC_HAT_ADVISE
,
(
caddr_t
)
&
mpss
,
0
,
0
))
if
(
memcntl
(
NULL
,
0
,
MC_HAT_ADVISE
,
(
caddr_t
)
&
mpss
,
0
,
0
))
{
perror
(
"memcntl MC_HAT_ADVISE cmd MHA_MAPSIZE_BSSBRK error (continuing)"
);
}
mpss
.
mha_cmd
=
MHA_MAPSIZE_STACK
;
if
(
memcntl
(
NULL
,
0
,
MC_HAT_ADVISE
,
(
caddr_t
)
&
mpss
,
0
,
0
))
if
(
memcntl
(
NULL
,
0
,
MC_HAT_ADVISE
,
(
caddr_t
)
&
mpss
,
0
,
0
))
{
perror
(
"memcntl MC_HAT_ADVISE cmd MHA_MAPSIZE_STACK error (continuing)"
);
}
...
...
@@ -245,15 +246,15 @@ static void my_get_large_page_sizes(size_t sizes[my_large_page_sizes_length])
}
else
{
while
(
i
<
my_large_page_sizes_length
&&
(
r
=
readdir
(
dirp
)))
while
(
i
<
my_large_page_sizes_length
&&
(
r
=
readdir
(
dirp
)))
{
if
(
strncmp
(
"hugepages-"
,
r
->
d_name
,
10
)
==
0
)
{
sizes
[
i
]
=
strtoull
(
r
->
d_name
+
10
,
NULL
,
10
)
*
1024ULL
;
if
(
!
my_is_2pow
(
sizes
[
i
]))
{
fprintf
(
stderr
,
"Warning: non-power of 2 large page size (%zu) found, skipping
\n
"
,
sizes
[
i
]);
fprintf
(
stderr
,
"Warning: non-power of 2 large page size (%zu) found,"
" skipping
\n
"
,
sizes
[
i
]);
sizes
[
i
]
=
0
;
continue
;
}
...
...
@@ -312,7 +313,8 @@ uchar* my_large_malloc_int(size_t *size, myf my_flags)
{
fprintf
(
stderr
,
"Warning: Failed to allocate %zu bytes from HugeTLB memory"
"(page size %zu). errno %d
\n
"
,
aligned_size
,
large_page_size
,
errno
);
"(page size %zu). errno %d
\n
"
,
aligned_size
,
large_page_size
,
errno
);
}
else
{
...
...
@@ -332,11 +334,11 @@ uchar* my_large_malloc_int(size_t *size, myf my_flags)
{
if
(
large_page_size
)
{
/*
we do need to record the adjustment so that munmap gets called with
the right size. This is only the case for HUGETLB pages.
*/
*
size
=
aligned_size
;
/*
we do need to record the adjustment so that munmap gets called with
the right size. This is only the case for HUGETLB pages.
*/
*
size
=
aligned_size
;
}
DBUG_RETURN
(
ptr
);
}
...
...
sql/mysqld.cc
View file @
4338bb8a
...
...
@@ -5042,8 +5042,10 @@ static int init_server_components()
{
"timed-mutexes"
,
OPT_DEPRECATED_OPTION
,
""
,
0
,
0
,
0
,
GET_NO_ARG
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#if defined(__linux__)
/* Linux was the only large page OS that we've now removed the (always)
unused super-large-pages (because its Solaris only). */
/*
Linux was the only large page OS that we've now removed the (always)
unused super-large-pages (because its Solaris only).
*/
{
"super-large-pages"
,
OPT_DEPRECATED_OPTION
,
""
,
0
,
0
,
0
,
GET_NO_ARG
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#endif
...
...
storage/innobase/os/os0proc.cc
View file @
4338bb8a
...
...
@@ -28,7 +28,7 @@ Created 9/30/1995 Heikki Tuuri
#include "univ.i"
/** The total amount of memory currently allocated from the operating
system with
os_mem_alloc
_large(). */
system with
allocacte
_large(). */
Atomic_counter
<
ulint
>
os_total_large_mem_allocated
;
/** Converts the current process id to a number.
...
...
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