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
4404ee29
Commit
4404ee29
authored
Oct 14, 2018
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17441 - InnoDB transition to C++11 atomics
os_total_large_mem_allocated transition to Atomic_counter.
parent
dab38ce0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
16 deletions
+9
-16
storage/innobase/include/os0proc.h
storage/innobase/include/os0proc.h
+1
-1
storage/innobase/os/os0proc.cc
storage/innobase/os/os0proc.cc
+7
-14
storage/innobase/srv/srv0srv.cc
storage/innobase/srv/srv0srv.cc
+1
-1
No files found.
storage/innobase/include/os0proc.h
View file @
4404ee29
...
@@ -40,7 +40,7 @@ typedef unsigned long int os_process_id_t;
...
@@ -40,7 +40,7 @@ typedef unsigned long int os_process_id_t;
/** The total amount of memory currently allocated from the operating
/** The total amount of memory currently allocated from the operating
system with os_mem_alloc_large(). */
system with os_mem_alloc_large(). */
extern
ulint
os_total_large_mem_allocated
;
extern
Atomic_counter
<
ulint
>
os_total_large_mem_allocated
;
/** Whether to use large pages in the buffer pool */
/** Whether to use large pages in the buffer pool */
extern
my_bool
os_use_large_pages
;
extern
my_bool
os_use_large_pages
;
...
...
storage/innobase/os/os0proc.cc
View file @
4404ee29
...
@@ -36,7 +36,7 @@ MAP_ANON but MAP_ANON is marked as deprecated */
...
@@ -36,7 +36,7 @@ MAP_ANON but MAP_ANON is marked as deprecated */
/** The total amount of memory currently allocated from the operating
/** The total amount of memory currently allocated from the operating
system with os_mem_alloc_large(). */
system with os_mem_alloc_large(). */
ulint
os_total_large_mem_allocated
=
0
;
Atomic_counter
<
ulint
>
os_total_large_mem_allocated
;
/** Whether to use large pages in the buffer pool */
/** Whether to use large pages in the buffer pool */
my_bool
os_use_large_pages
;
my_bool
os_use_large_pages
;
...
@@ -100,9 +100,7 @@ os_mem_alloc_large(
...
@@ -100,9 +100,7 @@ os_mem_alloc_large(
if
(
ptr
)
{
if
(
ptr
)
{
*
n
=
size
;
*
n
=
size
;
my_atomic_addlint
(
os_total_large_mem_allocated
+=
size
;
&
os_total_large_mem_allocated
,
size
);
UNIV_MEM_ALLOC
(
ptr
,
size
);
UNIV_MEM_ALLOC
(
ptr
,
size
);
return
(
ptr
);
return
(
ptr
);
}
}
...
@@ -127,8 +125,7 @@ os_mem_alloc_large(
...
@@ -127,8 +125,7 @@ os_mem_alloc_large(
ib
::
info
()
<<
"VirtualAlloc("
<<
size
<<
" bytes) failed;"
ib
::
info
()
<<
"VirtualAlloc("
<<
size
<<
" bytes) failed;"
" Windows error "
<<
GetLastError
();
" Windows error "
<<
GetLastError
();
}
else
{
}
else
{
my_atomic_addlint
(
os_total_large_mem_allocated
+=
size
;
&
os_total_large_mem_allocated
,
size
);
UNIV_MEM_ALLOC
(
ptr
,
size
);
UNIV_MEM_ALLOC
(
ptr
,
size
);
}
}
#else
#else
...
@@ -143,8 +140,7 @@ os_mem_alloc_large(
...
@@ -143,8 +140,7 @@ os_mem_alloc_large(
" errno "
<<
errno
;
" errno "
<<
errno
;
ptr
=
NULL
;
ptr
=
NULL
;
}
else
{
}
else
{
my_atomic_addlint
(
os_total_large_mem_allocated
+=
size
;
&
os_total_large_mem_allocated
,
size
);
UNIV_MEM_ALLOC
(
ptr
,
size
);
UNIV_MEM_ALLOC
(
ptr
,
size
);
}
}
#endif
#endif
...
@@ -163,8 +159,7 @@ os_mem_free_large(
...
@@ -163,8 +159,7 @@ os_mem_free_large(
#if defined HAVE_LINUX_LARGE_PAGES && defined UNIV_LINUX
#if defined HAVE_LINUX_LARGE_PAGES && defined UNIV_LINUX
if
(
os_use_large_pages
&&
os_large_page_size
&&
!
shmdt
(
ptr
))
{
if
(
os_use_large_pages
&&
os_large_page_size
&&
!
shmdt
(
ptr
))
{
my_atomic_addlint
(
os_total_large_mem_allocated
-=
size
;
&
os_total_large_mem_allocated
,
-
size
);
UNIV_MEM_FREE
(
ptr
,
size
);
UNIV_MEM_FREE
(
ptr
,
size
);
return
;
return
;
}
}
...
@@ -176,8 +171,7 @@ os_mem_free_large(
...
@@ -176,8 +171,7 @@ os_mem_free_large(
ib
::
error
()
<<
"VirtualFree("
<<
ptr
<<
", "
<<
size
ib
::
error
()
<<
"VirtualFree("
<<
ptr
<<
", "
<<
size
<<
") failed; Windows error "
<<
GetLastError
();
<<
") failed; Windows error "
<<
GetLastError
();
}
else
{
}
else
{
my_atomic_addlint
(
os_total_large_mem_allocated
-=
size
;
&
os_total_large_mem_allocated
,
-
lint
(
size
));
UNIV_MEM_FREE
(
ptr
,
size
);
UNIV_MEM_FREE
(
ptr
,
size
);
}
}
#elif !defined OS_MAP_ANON
#elif !defined OS_MAP_ANON
...
@@ -191,8 +185,7 @@ os_mem_free_large(
...
@@ -191,8 +185,7 @@ os_mem_free_large(
ib
::
error
()
<<
"munmap("
<<
ptr
<<
", "
<<
size
<<
") failed;"
ib
::
error
()
<<
"munmap("
<<
ptr
<<
", "
<<
size
<<
") failed;"
" errno "
<<
errno
;
" errno "
<<
errno
;
}
else
{
}
else
{
my_atomic_addlint
(
os_total_large_mem_allocated
-=
size
;
&
os_total_large_mem_allocated
,
-
size
);
UNIV_MEM_FREE
(
ptr
,
size
);
UNIV_MEM_FREE
(
ptr
,
size
);
}
}
#endif
#endif
...
...
storage/innobase/srv/srv0srv.cc
View file @
4404ee29
...
@@ -1329,7 +1329,7 @@ srv_printf_innodb_monitor(
...
@@ -1329,7 +1329,7 @@ srv_printf_innodb_monitor(
fprintf
(
file
,
fprintf
(
file
,
"Total large memory allocated "
ULINTPF
"
\n
"
"Total large memory allocated "
ULINTPF
"
\n
"
"Dictionary memory allocated "
ULINTPF
"
\n
"
,
"Dictionary memory allocated "
ULINTPF
"
\n
"
,
os_total_large_mem_allocated
,
ulint
{
os_total_large_mem_allocated
}
,
dict_sys_get_size
());
dict_sys_get_size
());
buf_print_io
(
file
);
buf_print_io
(
file
);
...
...
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