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
bd1ba780
Commit
bd1ba780
authored
Mar 12, 2022
by
Daniel Black
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 10.5 into 10.6
parents
77c7390f
d7817382
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
29 deletions
+62
-29
storage/innobase/buf/buf0rea.cc
storage/innobase/buf/buf0rea.cc
+1
-1
storage/innobase/os/os0file.cc
storage/innobase/os/os0file.cc
+1
-1
tpool/aio_linux.cc
tpool/aio_linux.cc
+2
-0
tpool/aio_simulated.cc
tpool/aio_simulated.cc
+1
-26
tpool/tpool.h
tpool/tpool.h
+5
-1
tpool/tpool_generic.cc
tpool/tpool_generic.cc
+52
-0
No files found.
storage/innobase/buf/buf0rea.cc
View file @
bd1ba780
...
...
@@ -290,7 +290,7 @@ buf_read_page_low(
/* Trx sys header is so low in the latching order that we play
safe and do not leave the i/o-completion to an asynchronous
i/o-thread. Change buffer pages must always be read with
syncronous i/o, to make sure they do not get involved in
sync
h
ronous i/o, to make sure they do not get involved in
thread deadlocks. */
sync
=
true
;
}
...
...
storage/innobase/os/os0file.cc
View file @
bd1ba780
...
...
@@ -2785,7 +2785,7 @@ os_file_set_eof(
#endif
/* !_WIN32*/
/** Does a syncronous read or write depending upon the type specified
/** Does a sync
h
ronous read or write depending upon the type specified
In case of partial reads/writes the function tries
NUM_RETRIES_ON_PARTIAL_IO times to read/write the complete data.
@param[in] type, IO flags
...
...
tpool/aio_linux.cc
View file @
bd1ba780
...
...
@@ -128,6 +128,8 @@ class aio_linux final : public aio
{
iocb
->
m_ret_len
=
event
.
res
;
iocb
->
m_err
=
0
;
if
(
iocb
->
m_ret_len
!=
iocb
->
m_len
)
finish_synchronous
(
iocb
);
}
iocb
->
m_internal_task
.
m_func
=
iocb
->
m_callback
;
iocb
->
m_internal_task
.
m_arg
=
iocb
;
...
...
tpool/aio_simulated.cc
View file @
bd1ba780
...
...
@@ -136,32 +136,7 @@ class simulated_aio : public aio
static
void
simulated_aio_callback
(
void
*
param
)
{
aiocb
*
cb
=
(
aiocb
*
)
param
;
#ifdef _WIN32
size_t
ret_len
;
#else
ssize_t
ret_len
;
#endif
int
err
=
0
;
switch
(
cb
->
m_opcode
)
{
case
aio_opcode
:
:
AIO_PREAD
:
ret_len
=
pread
(
cb
->
m_fh
,
cb
->
m_buffer
,
cb
->
m_len
,
cb
->
m_offset
);
break
;
case
aio_opcode
:
:
AIO_PWRITE
:
ret_len
=
pwrite
(
cb
->
m_fh
,
cb
->
m_buffer
,
cb
->
m_len
,
cb
->
m_offset
);
break
;
default:
abort
();
}
#ifdef _WIN32
if
(
static_cast
<
int
>
(
ret_len
)
<
0
)
err
=
GetLastError
();
#else
if
(
ret_len
<
0
)
err
=
errno
;
#endif
cb
->
m_ret_len
=
ret_len
;
cb
->
m_err
=
err
;
synchronous
(
cb
);
cb
->
m_internal_task
.
m_func
=
cb
->
m_callback
;
thread_pool
*
pool
=
(
thread_pool
*
)
cb
->
m_internal
;
pool
->
submit_task
(
&
cb
->
m_internal_task
);
...
...
tpool/tpool.h
View file @
bd1ba780
...
...
@@ -161,7 +161,7 @@ class aio
{
public:
/**
Submit asyncronous IO.
Submit async
h
ronous IO.
On completion, cb->m_callback is executed.
*/
virtual
int
submit_io
(
aiocb
*
cb
)
=
0
;
...
...
@@ -170,6 +170,10 @@ class aio
/** "Unind" file to AIO handler (used on Windows only) */
virtual
int
unbind
(
const
native_file_handle
&
fd
)
=
0
;
virtual
~
aio
(){};
protected:
static
void
synchronous
(
aiocb
*
cb
);
/** finish a partial read/write callback synchronously */
static
void
finish_synchronous
(
aiocb
*
cb
);
};
class
timer
...
...
tpool/tpool_generic.cc
View file @
bd1ba780
...
...
@@ -51,6 +51,58 @@ namespace tpool
static
const
std
::
chrono
::
milliseconds
LONG_TASK_DURATION
=
std
::
chrono
::
milliseconds
(
500
);
static
const
int
OVERSUBSCRIBE_FACTOR
=
2
;
/**
Process the cb synchronously
*/
void
aio
::
synchronous
(
aiocb
*
cb
)
{
#ifdef _WIN32
size_t
ret_len
;
#else
ssize_t
ret_len
;
#endif
int
err
=
0
;
switch
(
cb
->
m_opcode
)
{
case
aio_opcode
:
:
AIO_PREAD
:
ret_len
=
pread
(
cb
->
m_fh
,
cb
->
m_buffer
,
cb
->
m_len
,
cb
->
m_offset
);
break
;
case
aio_opcode
:
:
AIO_PWRITE
:
ret_len
=
pwrite
(
cb
->
m_fh
,
cb
->
m_buffer
,
cb
->
m_len
,
cb
->
m_offset
);
break
;
default:
abort
();
}
#ifdef _WIN32
if
(
static_cast
<
int
>
(
ret_len
)
<
0
)
err
=
GetLastError
();
#else
if
(
ret_len
<
0
)
{
err
=
errno
;
ret_len
=
0
;
}
#endif
cb
->
m_ret_len
=
ret_len
;
cb
->
m_err
=
err
;
if
(
!
err
&&
cb
->
m_ret_len
!=
cb
->
m_len
)
finish_synchronous
(
cb
);
}
/**
A partial read/write has occured, continue synchronously.
*/
void
aio
::
finish_synchronous
(
aiocb
*
cb
)
{
assert
(
cb
->
m_ret_len
!=
(
unsigned
int
)
cb
->
m_len
&&
!
cb
->
m_err
);
/* partial read/write */
cb
->
m_buffer
=
(
char
*
)
cb
->
m_buffer
+
cb
->
m_ret_len
;
cb
->
m_len
-=
(
unsigned
int
)
cb
->
m_ret_len
;
cb
->
m_offset
+=
cb
->
m_ret_len
;
synchronous
(
cb
);
}
/**
Implementation of generic threadpool.
This threadpool consists of the following components
...
...
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