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
f693b725
Commit
f693b725
authored
Nov 25, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-24270: Clarify some comments
parent
2de95f7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
storage/innobase/include/os0file.h
storage/innobase/include/os0file.h
+1
-1
tpool/aio_linux.cc
tpool/aio_linux.cc
+20
-9
No files found.
storage/innobase/include/os0file.h
View file @
f693b725
...
@@ -264,7 +264,7 @@ struct os_file_size_t {
...
@@ -264,7 +264,7 @@ struct os_file_size_t {
os_offset_t
m_alloc_size
;
os_offset_t
m_alloc_size
;
};
};
static
const
ulint
OS_AIO_N_PENDING_IOS_PER_THREAD
=
256
;
constexpr
ulint
OS_AIO_N_PENDING_IOS_PER_THREAD
=
256
;
extern
ulint
os_n_file_reads
;
extern
ulint
os_n_file_reads
;
extern
ulint
os_n_file_writes
;
extern
ulint
os_n_file_writes
;
...
...
tpool/aio_linux.cc
View file @
f693b725
...
@@ -22,13 +22,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
...
@@ -22,13 +22,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
# include <libaio.h>
# include <libaio.h>
# include <sys/syscall.h>
# include <sys/syscall.h>
/*
/**
A hack, which so far seems to allow allow getevents thread to be interrupted
Invoke the io_getevents() system call.
by io_destroy() from another thread
@param ctx context from io_setup()
libaio's io_getevent() would sometimes crash when attempting this feat,
@param min_nr minimum number of completion events to wait for
thus the raw syscall.
@param nr maximum number of completion events to collect
@param ev the collected events
In https://pagure.io/libaio/c/7cede5af5adf01ad26155061cc476aad0804d3fc
the io_getevents() implementation in libaio was "optimized" so that it
would elide the system call when there are no outstanding requests
and a timeout was specified.
The libaio code for dereferencing ctx would occasionally trigger
SIGSEGV if io_destroy() was concurrently invoked from another thread.
Hence, we use the raw system call.
*/
*/
static
int
my_getevents
(
io_context_t
ctx
,
long
min_nr
,
long
nr
,
io_event
*
ev
)
static
int
my_getevents
(
io_context_t
ctx
,
long
min_nr
,
long
nr
,
io_event
*
ev
)
{
{
...
@@ -59,8 +68,6 @@ namespace tpool
...
@@ -59,8 +68,6 @@ namespace tpool
{
{
#ifdef LINUX_NATIVE_AIO
#ifdef LINUX_NATIVE_AIO
#define MAX_EVENTS 256
class
aio_linux
final
:
public
aio
class
aio_linux
final
:
public
aio
{
{
thread_pool
*
m_pool
;
thread_pool
*
m_pool
;
...
@@ -70,6 +77,10 @@ class aio_linux final : public aio
...
@@ -70,6 +77,10 @@ class aio_linux final : public aio
static
void
getevent_thread_routine
(
aio_linux
*
aio
)
static
void
getevent_thread_routine
(
aio_linux
*
aio
)
{
{
/* We collect this many events at a time. os_aio_init() would
multiply OS_AIO_N_PENDING_THREADS by the number of read and write threads
and ultimately pass it to io_setup() via thread_pool::configure_aio(). */
constexpr
unsigned
MAX_EVENTS
=
256
;
io_event
events
[
MAX_EVENTS
];
io_event
events
[
MAX_EVENTS
];
for
(;;)
for
(;;)
{
{
...
...
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