mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 22:34:18 +01:00
branches/zip bug#42885 rb://148
The call to put IO threads to sleep was most probably meant for Windows only as the comment in buf0rea.c suggests. However it was enabled on all platforms. This patch restricts the sleep call to windows. This approach of not putting threads to sleep makes even more sense because now we have multiple threads working in the background and it probably is not a good idea to put all of them to sleep because a user thread wants to post a batch for readahead. Approved by: Marko
This commit is contained in:
parent
f01aad33f3
commit
99e250d407
2 changed files with 16 additions and 5 deletions
|
@ -171,9 +171,7 @@ file formats in the configuration file, but can only be set to any
|
|||
of the supported file formats during runtime. */
|
||||
static char* innobase_file_format_check = NULL;
|
||||
|
||||
/* The following has a misleading name: starting from 4.0.5, this also
|
||||
affects Windows: */
|
||||
static char* innobase_unix_file_flush_method = NULL;
|
||||
static char* innobase_file_flush_method = NULL;
|
||||
|
||||
/* Below we have boolean-valued start-up parameters, and their default
|
||||
values */
|
||||
|
@ -2155,7 +2153,7 @@ innobase_change_buffering_inited_ok:
|
|||
|
||||
/* --------------------------------------------------*/
|
||||
|
||||
srv_file_flush_method_str = innobase_unix_file_flush_method;
|
||||
srv_file_flush_method_str = innobase_file_flush_method;
|
||||
|
||||
srv_n_log_groups = (ulint) innobase_mirrored_log_groups;
|
||||
srv_n_log_files = (ulint) innobase_log_files_in_group;
|
||||
|
@ -9757,7 +9755,7 @@ static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit,
|
|||
" or 2 (write at commit, flush once per second).",
|
||||
NULL, NULL, 1, 0, 2, 0);
|
||||
|
||||
static MYSQL_SYSVAR_STR(flush_method, innobase_unix_file_flush_method,
|
||||
static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
|
||||
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
|
||||
"With which method to flush data.", NULL, NULL, NULL);
|
||||
|
||||
|
|
13
os/os0file.c
13
os/os0file.c
|
@ -3371,9 +3371,21 @@ void
|
|||
os_aio_simulated_put_read_threads_to_sleep(void)
|
||||
/*============================================*/
|
||||
{
|
||||
|
||||
/* The idea of putting background IO threads to sleep is only for
|
||||
Windows when using simulated AIO. Windows XP seems to schedule
|
||||
background threads too eagerly to allow for coalescing during
|
||||
readahead requests. */
|
||||
#ifdef __WIN__
|
||||
os_aio_array_t* array;
|
||||
ulint g;
|
||||
|
||||
if (os_aio_use_native_aio) {
|
||||
/* We do not use simulated aio: do nothing */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
os_aio_recommend_sleep_for_read_threads = TRUE;
|
||||
|
||||
for (g = 0; g < os_aio_n_segments; g++) {
|
||||
|
@ -3384,6 +3396,7 @@ os_aio_simulated_put_read_threads_to_sleep(void)
|
|||
os_event_reset(os_aio_segment_wait_events[g]);
|
||||
}
|
||||
}
|
||||
#endif /* __WIN__ */
|
||||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
|
|
Loading…
Add table
Reference in a new issue