Commit 99e250d4 authored by inaam's avatar inaam

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
parent f01aad33
...@@ -171,9 +171,7 @@ file formats in the configuration file, but can only be set to any ...@@ -171,9 +171,7 @@ file formats in the configuration file, but can only be set to any
of the supported file formats during runtime. */ of the supported file formats during runtime. */
static char* innobase_file_format_check = NULL; static char* innobase_file_format_check = NULL;
/* The following has a misleading name: starting from 4.0.5, this also static char* innobase_file_flush_method = NULL;
affects Windows: */
static char* innobase_unix_file_flush_method = NULL;
/* Below we have boolean-valued start-up parameters, and their default /* Below we have boolean-valued start-up parameters, and their default
values */ values */
...@@ -2155,7 +2153,7 @@ innobase_change_buffering_inited_ok: ...@@ -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_groups = (ulint) innobase_mirrored_log_groups;
srv_n_log_files = (ulint) innobase_log_files_in_group; 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, ...@@ -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).", " or 2 (write at commit, flush once per second).",
NULL, NULL, 1, 0, 2, 0); 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, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"With which method to flush data.", NULL, NULL, NULL); "With which method to flush data.", NULL, NULL, NULL);
......
...@@ -3371,9 +3371,21 @@ void ...@@ -3371,9 +3371,21 @@ void
os_aio_simulated_put_read_threads_to_sleep(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; os_aio_array_t* array;
ulint g; 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; os_aio_recommend_sleep_for_read_threads = TRUE;
for (g = 0; g < os_aio_n_segments; g++) { for (g = 0; g < os_aio_n_segments; g++) {
...@@ -3384,6 +3396,7 @@ os_aio_simulated_put_read_threads_to_sleep(void) ...@@ -3384,6 +3396,7 @@ os_aio_simulated_put_read_threads_to_sleep(void)
os_event_reset(os_aio_segment_wait_events[g]); os_event_reset(os_aio_segment_wait_events[g]);
} }
} }
#endif /* __WIN__ */
} }
/*******************************************************************//** /*******************************************************************//**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment