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
bb7e84b7
Commit
bb7e84b7
authored
Nov 22, 2016
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11296 - InnoDB stalls under OLTP RW on P8
Simplified away rw_lock_lock_word_incr().
parent
e06e455e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
39 deletions
+3
-39
storage/innobase/include/sync0rw.h
storage/innobase/include/sync0rw.h
+0
-9
storage/innobase/include/sync0rw.ic
storage/innobase/include/sync0rw.ic
+3
-30
No files found.
storage/innobase/include/sync0rw.h
View file @
bb7e84b7
...
@@ -521,15 +521,6 @@ rw_lock_lock_word_decr(
...
@@ -521,15 +521,6 @@ rw_lock_lock_word_decr(
ulint
amount
,
/*!< in: amount to decrement */
ulint
amount
,
/*!< in: amount to decrement */
lint
threshold
);
/*!< in: threshold of judgement */
lint
threshold
);
/*!< in: threshold of judgement */
/******************************************************************//**
/******************************************************************//**
Increments lock_word the specified amount and returns new value.
@return lock->lock_word after increment */
UNIV_INLINE
lint
rw_lock_lock_word_incr
(
/*===================*/
rw_lock_t
*
lock
,
/*!< in/out: rw-lock */
ulint
amount
);
/*!< in: amount to increment */
/******************************************************************//**
This function sets the lock->writer_thread and lock->recursive fields.
This function sets the lock->writer_thread and lock->recursive fields.
For platforms where we are using atomic builtins instead of lock->mutex
For platforms where we are using atomic builtins instead of lock->mutex
it sets the lock->writer_thread field using atomics to ensure memory
it sets the lock->writer_thread field using atomics to ensure memory
...
...
storage/innobase/include/sync0rw.ic
View file @
bb7e84b7
...
@@ -291,32 +291,6 @@ rw_lock_lock_word_decr(
...
@@ -291,32 +291,6 @@ rw_lock_lock_word_decr(
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
}
}
/******************************************************************//**
Increments lock_word the specified amount and returns new value.
@return lock->lock_word after increment */
UNIV_INLINE
lint
rw_lock_lock_word_incr(
/*===================*/
rw_lock_t* lock, /*!< in/out: rw-lock */
ulint amount) /*!< in: amount of increment */
{
#ifdef INNODB_RW_LOCKS_USE_ATOMICS
return(my_atomic_addlint(&lock->lock_word, amount) + amount);
#else /* INNODB_RW_LOCKS_USE_ATOMICS */
lint local_lock_word;
mutex_enter(&(lock->mutex));
lock->lock_word += amount;
local_lock_word = lock->lock_word;
mutex_exit(&(lock->mutex));
return(local_lock_word);
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
}
/******************************************************************//**
/******************************************************************//**
This function sets the lock->writer_thread and lock->recursive fields.
This function sets the lock->writer_thread and lock->recursive fields.
For platforms where we are using atomic builtins instead of lock->mutex
For platforms where we are using atomic builtins instead of lock->mutex
...
@@ -526,7 +500,7 @@ rw_lock_s_unlock_func(
...
@@ -526,7 +500,7 @@ rw_lock_s_unlock_func(
ut_d(rw_lock_remove_debug_info(lock, pass, RW_LOCK_S));
ut_d(rw_lock_remove_debug_info(lock, pass, RW_LOCK_S));
/* Increment lock_word to indicate 1 less reader */
/* Increment lock_word to indicate 1 less reader */
lint lock_word =
rw_lock_lock_word_incr(lock, 1)
;
lint lock_word =
my_atomic_addlint(&lock->lock_word, 1) + 1
;
if (lock_word == 0 || lock_word == -X_LOCK_HALF_DECR) {
if (lock_word == 0 || lock_word == -X_LOCK_HALF_DECR) {
/* wait_ex waiter exists. It may not be asleep, but we signal
/* wait_ex waiter exists. It may not be asleep, but we signal
...
@@ -571,7 +545,7 @@ rw_lock_x_unlock_func(
...
@@ -571,7 +545,7 @@ rw_lock_x_unlock_func(
if (lock->lock_word == 0 || lock->lock_word == -X_LOCK_HALF_DECR) {
if (lock->lock_word == 0 || lock->lock_word == -X_LOCK_HALF_DECR) {
/* There is 1 x-lock */
/* There is 1 x-lock */
/* atomic increment is needed, because it is last */
/* atomic increment is needed, because it is last */
if (
rw_lock_lock_word_incr(lock, X_LOCK_DECR) <= 0
) {
if (
my_atomic_addlint(&lock->lock_word, X_LOCK_DECR) <= -X_LOCK_DECR
) {
ut_error;
ut_error;
}
}
...
@@ -624,8 +598,7 @@ rw_lock_sx_unlock_func(
...
@@ -624,8 +598,7 @@ rw_lock_sx_unlock_func(
UNIV_MEM_INVALID(&lock->writer_thread,
UNIV_MEM_INVALID(&lock->writer_thread,
sizeof lock->writer_thread);
sizeof lock->writer_thread);
if (rw_lock_lock_word_incr(lock, X_LOCK_HALF_DECR)
if (my_atomic_addlint(&lock->lock_word, X_LOCK_HALF_DECR) <= 0) {
<= X_LOCK_HALF_DECR) {
ut_error;
ut_error;
}
}
/* Lock is now free. May have to signal read/write
/* Lock is now free. May have to signal read/write
...
...
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