Commit 34f1d3e6 authored by marko's avatar marko

Port r145 from branches/5.0:

Make innodb_thread_concurrency 0 by default, and extend the useable
range from 0 to 1000 (0 disables the thread throttling).

Remove SRV_CONCURRENCY_THRESHOLD (20).  The magic value to
disable the thread throttling is 0 from now on.
parent 8993745f
...@@ -355,7 +355,7 @@ innodb_srv_conc_enter_innodb( ...@@ -355,7 +355,7 @@ innodb_srv_conc_enter_innodb(
/*=========================*/ /*=========================*/
trx_t* trx) /* in: transaction handle */ trx_t* trx) /* in: transaction handle */
{ {
if (UNIV_LIKELY(srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD)) { if (UNIV_LIKELY(!srv_thread_concurrency)) {
return; return;
} }
...@@ -372,7 +372,7 @@ innodb_srv_conc_exit_innodb( ...@@ -372,7 +372,7 @@ innodb_srv_conc_exit_innodb(
/*========================*/ /*========================*/
trx_t* trx) /* in: transaction handle */ trx_t* trx) /* in: transaction handle */
{ {
if (UNIV_LIKELY(srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD)) { if (UNIV_LIKELY(!srv_thread_concurrency)) {
return; return;
} }
......
...@@ -195,7 +195,6 @@ extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, ...@@ -195,7 +195,6 @@ extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs,
#define kernel_mutex (*kernel_mutex_temp) #define kernel_mutex (*kernel_mutex_temp)
#define SRV_MAX_N_IO_THREADS 100 #define SRV_MAX_N_IO_THREADS 100
#define SRV_CONCURRENCY_THRESHOLD 20
/* Array of English strings describing the current state of an /* Array of English strings describing the current state of an
i/o handler thread */ i/o handler thread */
......
...@@ -1821,15 +1821,15 @@ Variable_name Value ...@@ -1821,15 +1821,15 @@ Variable_name Value
innodb_sync_spin_loops 20 innodb_sync_spin_loops 20
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
Variable_name Value Variable_name Value
innodb_thread_concurrency 20 innodb_thread_concurrency 0
set global innodb_thread_concurrency=1000; set global innodb_thread_concurrency=1001;
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
Variable_name Value Variable_name Value
innodb_thread_concurrency 1000 innodb_thread_concurrency 1000
set global innodb_thread_concurrency=0; set global innodb_thread_concurrency=0;
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
Variable_name Value Variable_name Value
innodb_thread_concurrency 1 innodb_thread_concurrency 0
set global innodb_thread_concurrency=16; set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
Variable_name Value Variable_name Value
......
...@@ -1316,7 +1316,7 @@ show variables like "innodb_sync_spin_loops"; ...@@ -1316,7 +1316,7 @@ show variables like "innodb_sync_spin_loops";
# Test for innodb_thread_concurrency variable # Test for innodb_thread_concurrency variable
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
set global innodb_thread_concurrency=1000; set global innodb_thread_concurrency=1001;
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
set global innodb_thread_concurrency=0; set global innodb_thread_concurrency=0;
show variables like "innodb_thread_concurrency"; show variables like "innodb_thread_concurrency";
......
...@@ -258,9 +258,10 @@ threads waiting for locks are not counted into the number because otherwise ...@@ -258,9 +258,10 @@ threads waiting for locks are not counted into the number because otherwise
we could get a deadlock. MySQL creates a thread for each user session, and we could get a deadlock. MySQL creates a thread for each user session, and
semaphore contention and convoy problems can occur withput this restriction. semaphore contention and convoy problems can occur withput this restriction.
Value 10 should be good if there are less than 4 processors + 4 disks in the Value 10 should be good if there are less than 4 processors + 4 disks in the
computer. Bigger computers need bigger values. */ computer. Bigger computers need bigger values. Value 0 will disable the
concurrency check. */
ulong srv_thread_concurrency = SRV_CONCURRENCY_THRESHOLD; ulong srv_thread_concurrency = 0;
ulong srv_commit_concurrency = 0; ulong srv_commit_concurrency = 0;
os_fast_mutex_t srv_conc_mutex; /* this mutex protects srv_conc data os_fast_mutex_t srv_conc_mutex; /* this mutex protects srv_conc data
...@@ -1141,7 +1142,7 @@ srv_conc_force_enter_innodb( ...@@ -1141,7 +1142,7 @@ srv_conc_force_enter_innodb(
trx_t* trx) /* in: transaction object associated with the trx_t* trx) /* in: transaction object associated with the
thread */ thread */
{ {
if (srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD) { if (UNIV_LIKELY(!srv_thread_concurrency)) {
return; return;
} }
...@@ -1167,7 +1168,7 @@ srv_conc_force_exit_innodb( ...@@ -1167,7 +1168,7 @@ srv_conc_force_exit_innodb(
{ {
srv_conc_slot_t* slot = NULL; srv_conc_slot_t* slot = NULL;
if (srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD) { if (UNIV_LIKELY(!srv_thread_concurrency)) {
return; return;
} }
......
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