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
1ae008d2
Commit
1ae008d2
authored
Jul 03, 2020
by
Eugene Kosov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace UT_LIST with ilist in rw_lock_list_t
parent
ee584137
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
49 deletions
+35
-49
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+9
-11
storage/innobase/handler/i_s.cc
storage/innobase/handler/i_s.cc
+10
-12
storage/innobase/include/sync0rw.h
storage/innobase/include/sync0rw.h
+5
-8
storage/innobase/sync/sync0debug.cc
storage/innobase/sync/sync0debug.cc
+1
-3
storage/innobase/sync/sync0rw.cc
storage/innobase/sync/sync0rw.cc
+8
-10
storage/innobase/sync/sync0sync.cc
storage/innobase/sync/sync0sync.cc
+2
-5
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
1ae008d2
...
@@ -16388,7 +16388,7 @@ innodb_show_rwlock_status(
...
@@ -16388,7 +16388,7 @@ innodb_show_rwlock_status(
{
{
DBUG_ENTER
(
"innodb_show_rwlock_status"
);
DBUG_ENTER
(
"innodb_show_rwlock_status"
);
rw_lock_t
*
block_rwlock
=
NULL
;
const
rw_lock_t
*
block_rwlock
=
nullptr
;
ulint
block_rwlock_oswait_count
=
0
;
ulint
block_rwlock_oswait_count
=
0
;
uint
hton_name_len
=
(
uint
)
strlen
(
innobase_hton_name
);
uint
hton_name_len
=
(
uint
)
strlen
(
innobase_hton_name
);
...
@@ -16396,36 +16396,34 @@ innodb_show_rwlock_status(
...
@@ -16396,36 +16396,34 @@ innodb_show_rwlock_status(
mutex_enter
(
&
rw_lock_list_mutex
);
mutex_enter
(
&
rw_lock_list_mutex
);
for
(
rw_lock_t
*
rw_lock
=
UT_LIST_GET_FIRST
(
rw_lock_list
);
for
(
const
rw_lock_t
&
rw_lock
:
rw_lock_list
)
{
rw_lock
!=
NULL
;
rw_lock
=
UT_LIST_GET_NEXT
(
list
,
rw_lock
))
{
if
(
rw_lock
->
count_os_wait
==
0
)
{
if
(
rw_lock
.
count_os_wait
==
0
)
{
continue
;
continue
;
}
}
int
buf1len
;
int
buf1len
;
char
buf1
[
IO_SIZE
];
char
buf1
[
IO_SIZE
];
if
(
rw_lock
->
is_block_lock
)
{
if
(
rw_lock
.
is_block_lock
)
{
block_rwlock
=
rw_lock
;
block_rwlock
=
&
rw_lock
;
block_rwlock_oswait_count
+=
rw_lock
->
count_os_wait
;
block_rwlock_oswait_count
+=
rw_lock
.
count_os_wait
;
continue
;
continue
;
}
}
buf1len
=
snprintf
(
buf1len
=
snprintf
(
buf1
,
sizeof
buf1
,
"rwlock: %s:%u"
,
buf1
,
sizeof
buf1
,
"rwlock: %s:%u"
,
innobase_basename
(
rw_lock
->
cfile_name
),
innobase_basename
(
rw_lock
.
cfile_name
),
rw_lock
->
cline
);
rw_lock
.
cline
);
int
buf2len
;
int
buf2len
;
char
buf2
[
IO_SIZE
];
char
buf2
[
IO_SIZE
];
buf2len
=
snprintf
(
buf2len
=
snprintf
(
buf2
,
sizeof
buf2
,
"waits=%u"
,
buf2
,
sizeof
buf2
,
"waits=%u"
,
rw_lock
->
count_os_wait
);
rw_lock
.
count_os_wait
);
if
(
stat_print
(
thd
,
innobase_hton_name
,
if
(
stat_print
(
thd
,
innobase_hton_name
,
hton_name_len
,
hton_name_len
,
...
...
storage/innobase/handler/i_s.cc
View file @
1ae008d2
...
@@ -7165,9 +7165,8 @@ i_s_innodb_mutexes_fill_table(
...
@@ -7165,9 +7165,8 @@ i_s_innodb_mutexes_fill_table(
TABLE_LIST
*
tables
,
/*!< in/out: tables to fill */
TABLE_LIST
*
tables
,
/*!< in/out: tables to fill */
Item
*
)
/*!< in: condition (not used) */
Item
*
)
/*!< in: condition (not used) */
{
{
rw_lock_t
*
lock
;
ulint
block_lock_oswait_count
=
0
;
ulint
block_lock_oswait_count
=
0
;
rw_lock_t
*
block_lock
=
NULL
;
const
rw_lock_t
*
block_lock
=
nullptr
;
Field
**
fields
=
tables
->
table
->
field
;
Field
**
fields
=
tables
->
table
->
field
;
DBUG_ENTER
(
"i_s_innodb_mutexes_fill_table"
);
DBUG_ENTER
(
"i_s_innodb_mutexes_fill_table"
);
...
@@ -7210,32 +7209,31 @@ i_s_innodb_mutexes_fill_table(
...
@@ -7210,32 +7209,31 @@ i_s_innodb_mutexes_fill_table(
char
lock_name
[
sizeof
"buf0dump.cc:12345"
];
char
lock_name
[
sizeof
"buf0dump.cc:12345"
];
for
(
lock
=
UT_LIST_GET_FIRST
(
rw_lock_list
);
lock
!=
NULL
;
for
(
const
rw_lock_t
&
lock
:
rw_lock_list
)
{
lock
=
UT_LIST_GET_NEXT
(
list
,
lock
))
{
if
(
lock
.
count_os_wait
==
0
)
{
if
(
lock
->
count_os_wait
==
0
)
{
continue
;
continue
;
}
}
if
(
buf_pool
.
is_block_lock
(
lock
))
{
if
(
buf_pool
.
is_block_lock
(
&
lock
))
{
block_lock
=
lock
;
block_lock
=
&
lock
;
block_lock_oswait_count
+=
lock
->
count_os_wait
;
block_lock_oswait_count
+=
lock
.
count_os_wait
;
continue
;
continue
;
}
}
const
char
*
basename
=
innobase_basename
(
const
char
*
basename
=
innobase_basename
(
lock
->
cfile_name
);
lock
.
cfile_name
);
snprintf
(
lock_name
,
sizeof
lock_name
,
"%s:%u"
,
snprintf
(
lock_name
,
sizeof
lock_name
,
"%s:%u"
,
basename
,
lock
->
cline
);
basename
,
lock
.
cline
);
OK
(
field_store_string
(
fields
[
MUTEXES_NAME
],
OK
(
field_store_string
(
fields
[
MUTEXES_NAME
],
lock_name
));
lock_name
));
OK
(
field_store_string
(
fields
[
MUTEXES_CREATE_FILE
],
OK
(
field_store_string
(
fields
[
MUTEXES_CREATE_FILE
],
basename
));
basename
));
OK
(
fields
[
MUTEXES_CREATE_LINE
]
->
store
(
lock
->
cline
,
OK
(
fields
[
MUTEXES_CREATE_LINE
]
->
store
(
lock
.
cline
,
true
));
true
));
fields
[
MUTEXES_CREATE_LINE
]
->
set_notnull
();
fields
[
MUTEXES_CREATE_LINE
]
->
set_notnull
();
OK
(
fields
[
MUTEXES_OS_WAITS
]
->
store
(
lock
->
count_os_wait
,
OK
(
fields
[
MUTEXES_OS_WAITS
]
->
store
(
lock
.
count_os_wait
,
true
));
true
));
fields
[
MUTEXES_OS_WAITS
]
->
set_notnull
();
fields
[
MUTEXES_OS_WAITS
]
->
set_notnull
();
OK
(
schema_table_store_record
(
thd
,
tables
->
table
));
OK
(
schema_table_store_record
(
thd
,
tables
->
table
));
...
...
storage/innobase/include/sync0rw.h
View file @
1ae008d2
...
@@ -36,6 +36,7 @@ Created 9/11/1995 Heikki Tuuri
...
@@ -36,6 +36,7 @@ Created 9/11/1995 Heikki Tuuri
#include "os0event.h"
#include "os0event.h"
#include "ut0mutex.h"
#include "ut0mutex.h"
#include "ilist.h"
/** Counters for RW locks. */
/** Counters for RW locks. */
struct
rw_lock_stats_t
{
struct
rw_lock_stats_t
{
...
@@ -105,9 +106,7 @@ struct rw_lock_t;
...
@@ -105,9 +106,7 @@ struct rw_lock_t;
struct
rw_lock_debug_t
;
struct
rw_lock_debug_t
;
#endif
/* UNIV_DEBUG */
#endif
/* UNIV_DEBUG */
typedef
UT_LIST_BASE_NODE_T
(
rw_lock_t
)
rw_lock_list_t
;
extern
ilist
<
rw_lock_t
>
rw_lock_list
;
extern
rw_lock_list_t
rw_lock_list
;
extern
ib_mutex_t
rw_lock_list_mutex
;
extern
ib_mutex_t
rw_lock_list_mutex
;
/** Counters for RW locks. */
/** Counters for RW locks. */
...
@@ -562,10 +561,11 @@ readers, a writer may queue for x-lock by decrementing lock_word: no
...
@@ -562,10 +561,11 @@ readers, a writer may queue for x-lock by decrementing lock_word: no
new readers will be let in while the thread waits for readers to
new readers will be let in while the thread waits for readers to
exit. */
exit. */
struct
rw_lock_t
struct
rw_lock_t
:
#ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
:
public
latch_t
public
latch_t
,
#endif
/* UNIV_DEBUG */
#endif
/* UNIV_DEBUG */
public
ilist_node
<>
{
{
/** Holds the state of the lock. */
/** Holds the state of the lock. */
Atomic_relaxed
<
int32_t
>
lock_word
;
Atomic_relaxed
<
int32_t
>
lock_word
;
...
@@ -615,9 +615,6 @@ struct rw_lock_t
...
@@ -615,9 +615,6 @@ struct rw_lock_t
/** Count of os_waits. May not be accurate */
/** Count of os_waits. May not be accurate */
uint32_t
count_os_wait
;
uint32_t
count_os_wait
;
/** All allocated rw locks are put into a list */
UT_LIST_NODE_T
(
rw_lock_t
)
list
;
#ifdef UNIV_PFS_RWLOCK
#ifdef UNIV_PFS_RWLOCK
/** The instrumentation hook */
/** The instrumentation hook */
struct
PSI_rwlock
*
pfs_psi
;
struct
PSI_rwlock
*
pfs_psi
;
...
...
storage/innobase/sync/sync0debug.cc
View file @
1ae008d2
...
@@ -1682,9 +1682,7 @@ sync_check_init()
...
@@ -1682,9 +1682,7 @@ sync_check_init()
sync_latch_meta_init
();
sync_latch_meta_init
();
/* Init the rw-lock & mutex list and create the mutex to protect it. */
/* create the mutex to protect rw_lock list. */
UT_LIST_INIT
(
rw_lock_list
,
&
rw_lock_t
::
list
);
mutex_create
(
LATCH_ID_RW_LOCK_LIST
,
&
rw_lock_list_mutex
);
mutex_create
(
LATCH_ID_RW_LOCK_LIST
,
&
rw_lock_list_mutex
);
...
...
storage/innobase/sync/sync0rw.cc
View file @
1ae008d2
...
@@ -141,7 +141,7 @@ wait_ex_event: A thread may only wait on the wait_ex_event after it has
...
@@ -141,7 +141,7 @@ wait_ex_event: A thread may only wait on the wait_ex_event after it has
rw_lock_stats_t
rw_lock_stats
;
rw_lock_stats_t
rw_lock_stats
;
/* The global list of rw-locks */
/* The global list of rw-locks */
rw_lock_list_t
rw_lock_list
;
ilist
<
rw_lock_t
>
rw_lock_list
;
ib_mutex_t
rw_lock_list_mutex
;
ib_mutex_t
rw_lock_list_mutex
;
#ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
...
@@ -235,7 +235,7 @@ rw_lock_create_func(
...
@@ -235,7 +235,7 @@ rw_lock_create_func(
lock
->
is_block_lock
=
0
;
lock
->
is_block_lock
=
0
;
mutex_enter
(
&
rw_lock_list_mutex
);
mutex_enter
(
&
rw_lock_list_mutex
);
UT_LIST_ADD_FIRST
(
rw_lock_list
,
lock
);
rw_lock_list
.
push_front
(
*
lock
);
mutex_exit
(
&
rw_lock_list_mutex
);
mutex_exit
(
&
rw_lock_list_mutex
);
}
}
...
@@ -257,7 +257,7 @@ rw_lock_free_func(
...
@@ -257,7 +257,7 @@ rw_lock_free_func(
os_event_destroy
(
lock
->
wait_ex_event
);
os_event_destroy
(
lock
->
wait_ex_event
);
UT_LIST_REMOVE
(
rw_lock_list
,
lock
);
rw_lock_list
.
remove
(
*
lock
);
mutex_exit
(
&
rw_lock_list_mutex
);
mutex_exit
(
&
rw_lock_list_mutex
);
}
}
...
@@ -1095,17 +1095,15 @@ rw_lock_list_print_info(
...
@@ -1095,17 +1095,15 @@ rw_lock_list_print_info(
"RW-LATCH INFO
\n
"
"RW-LATCH INFO
\n
"
"-------------
\n
"
,
file
);
"-------------
\n
"
,
file
);
for
(
const
rw_lock_t
*
lock
=
UT_LIST_GET_FIRST
(
rw_lock_list
);
for
(
const
rw_lock_t
&
lock
:
rw_lock_list
)
{
lock
!=
NULL
;
lock
=
UT_LIST_GET_NEXT
(
list
,
lock
))
{
count
++
;
count
++
;
if
(
lock
->
lock_word
!=
X_LOCK_DECR
)
{
if
(
lock
.
lock_word
!=
X_LOCK_DECR
)
{
fprintf
(
file
,
"RW-LOCK: %p "
,
(
void
*
)
lock
);
fprintf
(
file
,
"RW-LOCK: %p "
,
(
void
*
)
&
lock
);
if
(
int32_t
waiters
=
lock
->
waiters
)
{
if
(
int32_t
waiters
=
lock
.
waiters
)
{
fprintf
(
file
,
" (%d waiters)
\n
"
,
waiters
);
fprintf
(
file
,
" (%d waiters)
\n
"
,
waiters
);
}
else
{
}
else
{
putc
(
'\n'
,
file
);
putc
(
'\n'
,
file
);
...
@@ -1115,7 +1113,7 @@ rw_lock_list_print_info(
...
@@ -1115,7 +1113,7 @@ rw_lock_list_print_info(
rw_lock_debug_mutex_enter
();
rw_lock_debug_mutex_enter
();
for
(
info
=
UT_LIST_GET_FIRST
(
lock
->
debug_list
);
for
(
info
=
UT_LIST_GET_FIRST
(
lock
.
debug_list
);
info
!=
NULL
;
info
!=
NULL
;
info
=
UT_LIST_GET_NEXT
(
list
,
info
))
{
info
=
UT_LIST_GET_NEXT
(
list
,
info
))
{
...
...
storage/innobase/sync/sync0sync.cc
View file @
1ae008d2
...
@@ -257,11 +257,8 @@ MutexMonitor::reset()
...
@@ -257,11 +257,8 @@ MutexMonitor::reset()
mutex_enter
(
&
rw_lock_list_mutex
);
mutex_enter
(
&
rw_lock_list_mutex
);
for
(
rw_lock_t
*
rw_lock
=
UT_LIST_GET_FIRST
(
rw_lock_list
);
for
(
rw_lock_t
&
rw_lock
:
rw_lock_list
)
{
rw_lock
!=
NULL
;
rw_lock
.
count_os_wait
=
0
;
rw_lock
=
UT_LIST_GET_NEXT
(
list
,
rw_lock
))
{
rw_lock
->
count_os_wait
=
0
;
}
}
mutex_exit
(
&
rw_lock_list_mutex
);
mutex_exit
(
&
rw_lock_list_mutex
);
...
...
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