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
66bca0df
Commit
66bca0df
authored
Dec 28, 2018
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17441 - InnoDB transition to C++11 atomics
zip_pad_info_t::pad transition to Atomic_counter.
parent
c6a00544
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
storage/innobase/dict/dict0dict.cc
storage/innobase/dict/dict0dict.cc
+6
-7
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+2
-1
No files found.
storage/innobase/dict/dict0dict.cc
View file @
66bca0df
...
@@ -6821,6 +6821,7 @@ dict_index_zip_pad_update(
...
@@ -6821,6 +6821,7 @@ dict_index_zip_pad_update(
ulint
fail_pct
;
ulint
fail_pct
;
ut_ad
(
info
);
ut_ad
(
info
);
ut_ad
(
info
->
pad
%
ZIP_PAD_INCR
==
0
);
total
=
info
->
success
+
info
->
failure
;
total
=
info
->
success
+
info
->
failure
;
...
@@ -6845,17 +6846,16 @@ dict_index_zip_pad_update(
...
@@ -6845,17 +6846,16 @@ dict_index_zip_pad_update(
if
(
fail_pct
>
zip_threshold
)
{
if
(
fail_pct
>
zip_threshold
)
{
/* Compression failures are more then user defined
/* Compression failures are more then user defined
threshold. Increase the pad size to reduce chances of
threshold. Increase the pad size to reduce chances of
compression failures. */
compression failures.
ut_ad
(
info
->
pad
%
ZIP_PAD_INCR
==
0
);
/*
Only do increment if it won't increase padding
Only do increment if it won't increase padding
beyond max pad size. */
beyond max pad size. */
if
(
info
->
pad
+
ZIP_PAD_INCR
if
(
info
->
pad
+
ZIP_PAD_INCR
<
(
srv_page_size
*
zip_pad_max
)
/
100
)
{
<
(
srv_page_size
*
zip_pad_max
)
/
100
)
{
/* Use atomics even though we have the mutex.
/* Use atomics even though we have the mutex.
This is to ensure that we are able to read
This is to ensure that we are able to read
info->pad atomically. */
info->pad atomically. */
my_atomic_addlint
(
&
info
->
pad
,
ZIP_PAD_INCR
)
;
info
->
pad
+=
ZIP_PAD_INCR
;
MONITOR_INC
(
MONITOR_PAD_INCREMENTS
);
MONITOR_INC
(
MONITOR_PAD_INCREMENTS
);
}
}
...
@@ -6873,11 +6873,10 @@ dict_index_zip_pad_update(
...
@@ -6873,11 +6873,10 @@ dict_index_zip_pad_update(
if
(
info
->
n_rounds
>=
ZIP_PAD_SUCCESSFUL_ROUND_LIMIT
if
(
info
->
n_rounds
>=
ZIP_PAD_SUCCESSFUL_ROUND_LIMIT
&&
info
->
pad
>
0
)
{
&&
info
->
pad
>
0
)
{
ut_ad
(
info
->
pad
%
ZIP_PAD_INCR
==
0
);
/* Use atomics even though we have the mutex.
/* Use atomics even though we have the mutex.
This is to ensure that we are able to read
This is to ensure that we are able to read
info->pad atomically. */
info->pad atomically. */
my_atomic_addlint
(
&
info
->
pad
,
ulint
(
-
ZIP_PAD_INCR
))
;
info
->
pad
-=
ZIP_PAD_INCR
;
info
->
n_rounds
=
0
;
info
->
n_rounds
=
0
;
...
@@ -6950,7 +6949,7 @@ dict_index_zip_pad_optimal_page_size(
...
@@ -6950,7 +6949,7 @@ dict_index_zip_pad_optimal_page_size(
return
(
srv_page_size
);
return
(
srv_page_size
);
}
}
pad
=
my_atomic_loadlint
(
&
index
->
zip_pad
.
pad
)
;
pad
=
index
->
zip_pad
.
pad
;
ut_ad
(
pad
<
srv_page_size
);
ut_ad
(
pad
<
srv_page_size
);
sz
=
srv_page_size
-
pad
;
sz
=
srv_page_size
-
pad
;
...
...
storage/innobase/include/dict0mem.h
View file @
66bca0df
...
@@ -873,7 +873,8 @@ an uncompressed page should be left as padding to avoid compression
...
@@ -873,7 +873,8 @@ an uncompressed page should be left as padding to avoid compression
failures. This estimate is based on a self-adapting heuristic. */
failures. This estimate is based on a self-adapting heuristic. */
struct
zip_pad_info_t
{
struct
zip_pad_info_t
{
SysMutex
*
mutex
;
/*!< mutex protecting the info */
SysMutex
*
mutex
;
/*!< mutex protecting the info */
ulint
pad
;
/*!< number of bytes used as pad */
Atomic_counter
<
ulint
>
pad
;
/*!< number of bytes used as pad */
ulint
success
;
/*!< successful compression ops during
ulint
success
;
/*!< successful compression ops during
current round */
current round */
ulint
failure
;
/*!< failed compression ops during
ulint
failure
;
/*!< failed compression ops during
...
...
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