Merge lp:~laurynas-biveinis/percona-server/xtradb-thread-nice into lp:percona-server/5.6
- xtradb-thread-nice
- Merge into 5.6
Status: | Superseded |
---|---|
Proposed branch: | lp:~laurynas-biveinis/percona-server/xtradb-thread-nice |
Merge into: | lp:percona-server/5.6 |
Diff against target: |
972 lines (+664/-22) 20 files modified
Percona-Server/mysql-test/include/linux.inc (+5/-0) Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result (+30/-0) Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result (+30/-0) Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result (+30/-0) Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result (+30/-0) Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test (+1/-5) Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test (+1/-5) Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test (+1/-5) Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test (+1/-5) Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test (+42/-0) Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test (+43/-0) Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test (+43/-0) Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test (+43/-0) Percona-Server/storage/innobase/buf/buf0flu.cc (+4/-0) Percona-Server/storage/innobase/handler/ha_innodb.cc (+197/-1) Percona-Server/storage/innobase/include/os0thread.h (+35/-0) Percona-Server/storage/innobase/include/srv0srv.h (+26/-0) Percona-Server/storage/innobase/os/os0thread.cc (+52/-0) Percona-Server/storage/innobase/srv/srv0srv.cc (+39/-0) Percona-Server/storage/innobase/srv/srv0start.cc (+11/-1) |
To merge this branch: | bzr merge lp:~laurynas-biveinis/percona-server/xtradb-thread-nice |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sergei Glushchenko (community) | g2 | Needs Fixing | |
Vadim Tkachenko | Approve | ||
Review via email: mp+188836@code.launchpad.net |
This proposal has been superseded by a proposal from 2013-10-03.
Commit message
Description of the change
Implement relative thread scheduling priorities for XtraDB
(https:/
Add new command line option innodb_
corresponding to Linux nice values of -20..19. Add other options
innodb_
innodb_
On setting the new values, silently do nothing if a corresponding
thread or threads are not running. If they are running, attempt to
set the thread nice priority for the specified thread type and return
a warning with an actual priority if the attempt failed.
As Linux setpriority() accepts as system-specific pid_t thread id,
define a new type os_tid_t. Implement new functions
os_thread_get_tid() and os_thread_
Introduce a new macro SRV_MAX_
number of purge threads.
Add new sys_vars test for these variables.
http://
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Hi Laurynas,
I noted a lot of OS checks in tests, would be nice to have file have_linux.inc and use it. Also "Linux" (double quotes) is not compatible with MySQL ansi mode, not sure if it is important. Introduction of have_linux will probably not save a lot of code lines, but will save a bit of time for those who need to implement that check in future. One can easily find have_linux.inc and use it instead of digging the actual way how check OS.
Otherwise looks good.
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
There are also lines in test cases which are commented out.
diff lines 165-168,
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
srv_sched_
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
Sergei -
> There are also lines in test cases which are commented out.
> diff lines 165-168,
Diff line 164 explained this: these are the valid values for the variable, but the test would not necessarily succeed as it needs ulimit setup. Thus leave them in the test to show the legal values, but do not attempt to execute them.
Preview Diff
1 | === added file 'Percona-Server/mysql-test/include/linux.inc' | |||
2 | --- Percona-Server/mysql-test/include/linux.inc 1970-01-01 00:00:00 +0000 | |||
3 | +++ Percona-Server/mysql-test/include/linux.inc 2013-10-03 06:43:28 +0000 | |||
4 | @@ -0,0 +1,5 @@ | |||
5 | 1 | if (`select convert(@@version_compile_os using latin1) LIKE 'Linux' = 0`) | ||
6 | 2 | { | ||
7 | 3 | skip Need Linux; | ||
8 | 4 | } | ||
9 | 5 | |||
10 | 0 | 6 | ||
11 | === added file 'Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result' | |||
12 | --- Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result 1970-01-01 00:00:00 +0000 | |||
13 | +++ Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result 2013-10-03 06:43:28 +0000 | |||
14 | @@ -0,0 +1,30 @@ | |||
15 | 1 | SET @start_value = @@GLOBAL.innodb_sched_priority_cleaner; | ||
16 | 2 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
17 | 3 | @@GLOBAL.innodb_sched_priority_cleaner | ||
18 | 4 | 20 | ||
19 | 5 | SELECT @@SESSION.innodb_sched_priority_cleaner; | ||
20 | 6 | ERROR HY000: Variable 'innodb_sched_priority_cleaner' is a GLOBAL variable | ||
21 | 7 | SET GLOBAL innodb_sched_priority_cleaner=20; | ||
22 | 8 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
23 | 9 | @@GLOBAL.innodb_sched_priority_cleaner | ||
24 | 10 | 20 | ||
25 | 11 | SET GLOBAL innodb_sched_priority_cleaner=25; | ||
26 | 12 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
27 | 13 | @@GLOBAL.innodb_sched_priority_cleaner | ||
28 | 14 | 25 | ||
29 | 15 | SET GLOBAL innodb_sched_priority_cleaner=39; | ||
30 | 16 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
31 | 17 | @@GLOBAL.innodb_sched_priority_cleaner | ||
32 | 18 | 39 | ||
33 | 19 | SET GLOBAL innodb_sched_priority_cleaner=41; | ||
34 | 20 | Warnings: | ||
35 | 21 | Warning 1292 Truncated incorrect innodb_sched_priority_cleaner value: '41' | ||
36 | 22 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
37 | 23 | @@GLOBAL.innodb_sched_priority_cleaner | ||
38 | 24 | 39 | ||
39 | 25 | SET GLOBAL innodb_sched_priority_cleaner=1.1; | ||
40 | 26 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner' | ||
41 | 27 | SET GLOBAL innodb_sched_priority_cleaner=1e1; | ||
42 | 28 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner' | ||
43 | 29 | SET GLOBAL innodb_sched_priority_cleaner='foo'; | ||
44 | 30 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner' | ||
45 | 0 | 31 | ||
46 | === added file 'Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result' | |||
47 | --- Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result 1970-01-01 00:00:00 +0000 | |||
48 | +++ Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result 2013-10-03 06:43:28 +0000 | |||
49 | @@ -0,0 +1,30 @@ | |||
50 | 1 | SET @start_value = @@GLOBAL.innodb_sched_priority_io; | ||
51 | 2 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
52 | 3 | @@GLOBAL.innodb_sched_priority_io | ||
53 | 4 | 20 | ||
54 | 5 | SELECT @@SESSION.innodb_sched_priority_io; | ||
55 | 6 | ERROR HY000: Variable 'innodb_sched_priority_io' is a GLOBAL variable | ||
56 | 7 | SET GLOBAL innodb_sched_priority_io=20; | ||
57 | 8 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
58 | 9 | @@GLOBAL.innodb_sched_priority_io | ||
59 | 10 | 20 | ||
60 | 11 | SET GLOBAL innodb_sched_priority_io=25; | ||
61 | 12 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
62 | 13 | @@GLOBAL.innodb_sched_priority_io | ||
63 | 14 | 25 | ||
64 | 15 | SET GLOBAL innodb_sched_priority_io=39; | ||
65 | 16 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
66 | 17 | @@GLOBAL.innodb_sched_priority_io | ||
67 | 18 | 39 | ||
68 | 19 | SET GLOBAL innodb_sched_priority_io=41; | ||
69 | 20 | Warnings: | ||
70 | 21 | Warning 1292 Truncated incorrect innodb_sched_priority_io value: '41' | ||
71 | 22 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
72 | 23 | @@GLOBAL.innodb_sched_priority_io | ||
73 | 24 | 39 | ||
74 | 25 | SET GLOBAL innodb_sched_priority_io=1.1; | ||
75 | 26 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io' | ||
76 | 27 | SET GLOBAL innodb_sched_priority_io=1e1; | ||
77 | 28 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io' | ||
78 | 29 | SET GLOBAL innodb_sched_priority_io='foo'; | ||
79 | 30 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io' | ||
80 | 0 | 31 | ||
81 | === added file 'Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result' | |||
82 | --- Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result 1970-01-01 00:00:00 +0000 | |||
83 | +++ Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result 2013-10-03 06:43:28 +0000 | |||
84 | @@ -0,0 +1,30 @@ | |||
85 | 1 | SET @start_value = @@GLOBAL.innodb_sched_priority_master; | ||
86 | 2 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
87 | 3 | @@GLOBAL.innodb_sched_priority_master | ||
88 | 4 | 20 | ||
89 | 5 | SELECT @@SESSION.innodb_sched_priority_master; | ||
90 | 6 | ERROR HY000: Variable 'innodb_sched_priority_master' is a GLOBAL variable | ||
91 | 7 | SET GLOBAL innodb_sched_priority_master=20; | ||
92 | 8 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
93 | 9 | @@GLOBAL.innodb_sched_priority_master | ||
94 | 10 | 20 | ||
95 | 11 | SET GLOBAL innodb_sched_priority_master=25; | ||
96 | 12 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
97 | 13 | @@GLOBAL.innodb_sched_priority_master | ||
98 | 14 | 25 | ||
99 | 15 | SET GLOBAL innodb_sched_priority_master=39; | ||
100 | 16 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
101 | 17 | @@GLOBAL.innodb_sched_priority_master | ||
102 | 18 | 39 | ||
103 | 19 | SET GLOBAL innodb_sched_priority_master=41; | ||
104 | 20 | Warnings: | ||
105 | 21 | Warning 1292 Truncated incorrect innodb_sched_priority_master value: '41' | ||
106 | 22 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
107 | 23 | @@GLOBAL.innodb_sched_priority_master | ||
108 | 24 | 39 | ||
109 | 25 | SET GLOBAL innodb_sched_priority_master=1.1; | ||
110 | 26 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master' | ||
111 | 27 | SET GLOBAL innodb_sched_priority_master=1e1; | ||
112 | 28 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master' | ||
113 | 29 | SET GLOBAL innodb_sched_priority_master='foo'; | ||
114 | 30 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master' | ||
115 | 0 | 31 | ||
116 | === added file 'Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result' | |||
117 | --- Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result 1970-01-01 00:00:00 +0000 | |||
118 | +++ Percona-Server/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result 2013-10-03 06:43:28 +0000 | |||
119 | @@ -0,0 +1,30 @@ | |||
120 | 1 | SET @start_value = @@GLOBAL.innodb_sched_priority_purge; | ||
121 | 2 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
122 | 3 | @@GLOBAL.innodb_sched_priority_purge | ||
123 | 4 | 20 | ||
124 | 5 | SELECT @@SESSION.innodb_sched_priority_purge; | ||
125 | 6 | ERROR HY000: Variable 'innodb_sched_priority_purge' is a GLOBAL variable | ||
126 | 7 | SET GLOBAL innodb_sched_priority_purge=20; | ||
127 | 8 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
128 | 9 | @@GLOBAL.innodb_sched_priority_purge | ||
129 | 10 | 20 | ||
130 | 11 | SET GLOBAL innodb_sched_priority_purge=25; | ||
131 | 12 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
132 | 13 | @@GLOBAL.innodb_sched_priority_purge | ||
133 | 14 | 25 | ||
134 | 15 | SET GLOBAL innodb_sched_priority_purge=39; | ||
135 | 16 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
136 | 17 | @@GLOBAL.innodb_sched_priority_purge | ||
137 | 18 | 39 | ||
138 | 19 | SET GLOBAL innodb_sched_priority_purge=41; | ||
139 | 20 | Warnings: | ||
140 | 21 | Warning 1292 Truncated incorrect innodb_sched_priority_purge value: '41' | ||
141 | 22 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
142 | 23 | @@GLOBAL.innodb_sched_priority_purge | ||
143 | 24 | 39 | ||
144 | 25 | SET GLOBAL innodb_sched_priority_purge=1.1; | ||
145 | 26 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge' | ||
146 | 27 | SET GLOBAL innodb_sched_priority_purge=1e1; | ||
147 | 28 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge' | ||
148 | 29 | SET GLOBAL innodb_sched_priority_purge='foo'; | ||
149 | 30 | ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge' | ||
150 | 0 | 31 | ||
151 | === modified file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test' | |||
152 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test 2013-09-23 12:31:09 +0000 | |||
153 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test 2013-10-03 06:43:28 +0000 | |||
154 | @@ -1,10 +1,6 @@ | |||
155 | 1 | --source include/have_debug.inc | 1 | --source include/have_debug.inc |
156 | 2 | --source include/have_innodb.inc | 2 | --source include/have_innodb.inc |
162 | 3 | 3 | --source include/linux.inc | |
158 | 4 | if (`SELECT @@version_compile_os LIKE "Linux" = 0`) | ||
159 | 5 | { | ||
160 | 6 | skip Needs Linux; | ||
161 | 7 | } | ||
163 | 8 | 4 | ||
164 | 9 | # A dynamic, global variable | 5 | # A dynamic, global variable |
165 | 10 | 6 | ||
166 | 11 | 7 | ||
167 | === modified file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test' | |||
168 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test 2013-09-23 12:31:09 +0000 | |||
169 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test 2013-10-03 06:43:28 +0000 | |||
170 | @@ -1,10 +1,6 @@ | |||
171 | 1 | --source include/have_debug.inc | 1 | --source include/have_debug.inc |
172 | 2 | --source include/have_innodb.inc | 2 | --source include/have_innodb.inc |
178 | 3 | 3 | --source include/linux.inc | |
174 | 4 | if (`SELECT @@version_compile_os LIKE "Linux" = 0`) | ||
175 | 5 | { | ||
176 | 6 | skip Needs Linux; | ||
177 | 7 | } | ||
179 | 8 | 4 | ||
180 | 9 | # A dynamic, global variable | 5 | # A dynamic, global variable |
181 | 10 | 6 | ||
182 | 11 | 7 | ||
183 | === modified file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test' | |||
184 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test 2013-09-23 12:31:09 +0000 | |||
185 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test 2013-10-03 06:43:28 +0000 | |||
186 | @@ -1,10 +1,6 @@ | |||
187 | 1 | --source include/have_debug.inc | 1 | --source include/have_debug.inc |
188 | 2 | --source include/have_innodb.inc | 2 | --source include/have_innodb.inc |
194 | 3 | 3 | --source include/linux.inc | |
190 | 4 | if (`SELECT @@version_compile_os LIKE "Linux" = 0`) | ||
191 | 5 | { | ||
192 | 6 | skip Needs Linux; | ||
193 | 7 | } | ||
195 | 8 | 4 | ||
196 | 9 | # A dynamic, global variable | 5 | # A dynamic, global variable |
197 | 10 | 6 | ||
198 | 11 | 7 | ||
199 | === modified file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test' | |||
200 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test 2013-09-23 12:31:09 +0000 | |||
201 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test 2013-10-03 06:43:28 +0000 | |||
202 | @@ -1,10 +1,6 @@ | |||
203 | 1 | --source include/have_debug.inc | 1 | --source include/have_debug.inc |
204 | 2 | --source include/have_innodb.inc | 2 | --source include/have_innodb.inc |
210 | 3 | 3 | --source include/linux.inc | |
206 | 4 | if (`SELECT @@version_compile_os LIKE "Linux" = 0`) | ||
207 | 5 | { | ||
208 | 6 | skip Needs Linux; | ||
209 | 7 | } | ||
211 | 8 | 4 | ||
212 | 9 | # A dynamic, global variable | 5 | # A dynamic, global variable |
213 | 10 | 6 | ||
214 | 11 | 7 | ||
215 | === added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test' | |||
216 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test 1970-01-01 00:00:00 +0000 | |||
217 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test 2013-10-03 06:43:28 +0000 | |||
218 | @@ -0,0 +1,42 @@ | |||
219 | 1 | --source include/have_innodb.inc | ||
220 | 2 | --source include/linux.inc | ||
221 | 3 | |||
222 | 4 | # A dynamic, global variable | ||
223 | 5 | |||
224 | 6 | SET @start_value = @@GLOBAL.innodb_sched_priority_cleaner; | ||
225 | 7 | |||
226 | 8 | # Default value | ||
227 | 9 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
228 | 10 | |||
229 | 11 | # Global only | ||
230 | 12 | --error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
231 | 13 | SELECT @@SESSION.innodb_sched_priority_cleaner; | ||
232 | 14 | |||
233 | 15 | # Correct values | ||
234 | 16 | # The high priority values may need permissions, thus do not test them | ||
235 | 17 | # SET GLOBAL innodb_sched_priority_cleaner=0; | ||
236 | 18 | # SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
237 | 19 | #SET GLOBAL innodb_sched_priority_cleaner=15; | ||
238 | 20 | # SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
239 | 21 | SET GLOBAL innodb_sched_priority_cleaner=20; | ||
240 | 22 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
241 | 23 | SET GLOBAL innodb_sched_priority_cleaner=25; | ||
242 | 24 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
243 | 25 | SET GLOBAL innodb_sched_priority_cleaner=39; | ||
244 | 26 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
245 | 27 | |||
246 | 28 | # Incorrect values | ||
247 | 29 | #SET GLOBAL innodb_sched_priority_cleaner=-1; | ||
248 | 30 | #SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
249 | 31 | SET GLOBAL innodb_sched_priority_cleaner=41; | ||
250 | 32 | SELECT @@GLOBAL.innodb_sched_priority_cleaner; | ||
251 | 33 | --error ER_WRONG_TYPE_FOR_VAR | ||
252 | 34 | SET GLOBAL innodb_sched_priority_cleaner=1.1; | ||
253 | 35 | --error ER_WRONG_TYPE_FOR_VAR | ||
254 | 36 | SET GLOBAL innodb_sched_priority_cleaner=1e1; | ||
255 | 37 | --error ER_WRONG_TYPE_FOR_VAR | ||
256 | 38 | SET GLOBAL innodb_sched_priority_cleaner='foo'; | ||
257 | 39 | |||
258 | 40 | # If we are lacking permissions, then we cannot restore the startup value | ||
259 | 41 | # at the end. | ||
260 | 42 | --source include/restart_mysqld.inc | ||
261 | 0 | 43 | ||
262 | === added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test' | |||
263 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test 1970-01-01 00:00:00 +0000 | |||
264 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test 2013-10-03 06:43:28 +0000 | |||
265 | @@ -0,0 +1,43 @@ | |||
266 | 1 | --source include/have_debug.inc | ||
267 | 2 | --source include/have_innodb.inc | ||
268 | 3 | --source include/linux.inc | ||
269 | 4 | |||
270 | 5 | # A dynamic, global variable | ||
271 | 6 | |||
272 | 7 | SET @start_value = @@GLOBAL.innodb_sched_priority_io; | ||
273 | 8 | |||
274 | 9 | # Default value | ||
275 | 10 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
276 | 11 | |||
277 | 12 | # Global only | ||
278 | 13 | --error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
279 | 14 | SELECT @@SESSION.innodb_sched_priority_io; | ||
280 | 15 | |||
281 | 16 | # Correct values | ||
282 | 17 | # The high priority values may need permissions, thus do not test them | ||
283 | 18 | # SET GLOBAL innodb_sched_priority_io=0; | ||
284 | 19 | # SELECT @@GLOBAL.innodb_sched_priority_io; | ||
285 | 20 | #SET GLOBAL innodb_sched_priority_io=15; | ||
286 | 21 | # SELECT @@GLOBAL.innodb_sched_priority_io; | ||
287 | 22 | SET GLOBAL innodb_sched_priority_io=20; | ||
288 | 23 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
289 | 24 | SET GLOBAL innodb_sched_priority_io=25; | ||
290 | 25 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
291 | 26 | SET GLOBAL innodb_sched_priority_io=39; | ||
292 | 27 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
293 | 28 | |||
294 | 29 | # Incorrect values | ||
295 | 30 | #SET GLOBAL innodb_sched_priority_io=-1; | ||
296 | 31 | #SELECT @@GLOBAL.innodb_sched_priority_io; | ||
297 | 32 | SET GLOBAL innodb_sched_priority_io=41; | ||
298 | 33 | SELECT @@GLOBAL.innodb_sched_priority_io; | ||
299 | 34 | --error ER_WRONG_TYPE_FOR_VAR | ||
300 | 35 | SET GLOBAL innodb_sched_priority_io=1.1; | ||
301 | 36 | --error ER_WRONG_TYPE_FOR_VAR | ||
302 | 37 | SET GLOBAL innodb_sched_priority_io=1e1; | ||
303 | 38 | --error ER_WRONG_TYPE_FOR_VAR | ||
304 | 39 | SET GLOBAL innodb_sched_priority_io='foo'; | ||
305 | 40 | |||
306 | 41 | # If we are lacking permissions, then we cannot restore the startup value | ||
307 | 42 | # at the end. | ||
308 | 43 | --source include/restart_mysqld.inc | ||
309 | 0 | 44 | ||
310 | === added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test' | |||
311 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test 1970-01-01 00:00:00 +0000 | |||
312 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test 2013-10-03 06:43:28 +0000 | |||
313 | @@ -0,0 +1,43 @@ | |||
314 | 1 | --source include/have_debug.inc | ||
315 | 2 | --source include/have_innodb.inc | ||
316 | 3 | --source include/linux.inc | ||
317 | 4 | |||
318 | 5 | # A dynamic, global variable | ||
319 | 6 | |||
320 | 7 | SET @start_value = @@GLOBAL.innodb_sched_priority_master; | ||
321 | 8 | |||
322 | 9 | # Default value | ||
323 | 10 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
324 | 11 | |||
325 | 12 | # Global only | ||
326 | 13 | --error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
327 | 14 | SELECT @@SESSION.innodb_sched_priority_master; | ||
328 | 15 | |||
329 | 16 | # Correct values | ||
330 | 17 | # The high priority values may need permissions, thus do not test them | ||
331 | 18 | # SET GLOBAL innodb_sched_priority_master=0; | ||
332 | 19 | # SELECT @@GLOBAL.innodb_sched_priority_master; | ||
333 | 20 | #SET GLOBAL innodb_sched_priority_master=15; | ||
334 | 21 | # SELECT @@GLOBAL.innodb_sched_priority_master; | ||
335 | 22 | SET GLOBAL innodb_sched_priority_master=20; | ||
336 | 23 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
337 | 24 | SET GLOBAL innodb_sched_priority_master=25; | ||
338 | 25 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
339 | 26 | SET GLOBAL innodb_sched_priority_master=39; | ||
340 | 27 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
341 | 28 | |||
342 | 29 | # Incorrect values | ||
343 | 30 | #SET GLOBAL innodb_sched_priority_master=-1; | ||
344 | 31 | #SELECT @@GLOBAL.innodb_sched_priority_master; | ||
345 | 32 | SET GLOBAL innodb_sched_priority_master=41; | ||
346 | 33 | SELECT @@GLOBAL.innodb_sched_priority_master; | ||
347 | 34 | --error ER_WRONG_TYPE_FOR_VAR | ||
348 | 35 | SET GLOBAL innodb_sched_priority_master=1.1; | ||
349 | 36 | --error ER_WRONG_TYPE_FOR_VAR | ||
350 | 37 | SET GLOBAL innodb_sched_priority_master=1e1; | ||
351 | 38 | --error ER_WRONG_TYPE_FOR_VAR | ||
352 | 39 | SET GLOBAL innodb_sched_priority_master='foo'; | ||
353 | 40 | |||
354 | 41 | # If we are lacking permissions, then we cannot restore the startup value | ||
355 | 42 | # at the end. | ||
356 | 43 | --source include/restart_mysqld.inc | ||
357 | 0 | 44 | ||
358 | === added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test' | |||
359 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test 1970-01-01 00:00:00 +0000 | |||
360 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test 2013-10-03 06:43:28 +0000 | |||
361 | @@ -0,0 +1,43 @@ | |||
362 | 1 | --source include/have_debug.inc | ||
363 | 2 | --source include/have_innodb.inc | ||
364 | 3 | --source include/linux.inc | ||
365 | 4 | |||
366 | 5 | # A dynamic, global variable | ||
367 | 6 | |||
368 | 7 | SET @start_value = @@GLOBAL.innodb_sched_priority_purge; | ||
369 | 8 | |||
370 | 9 | # Default value | ||
371 | 10 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
372 | 11 | |||
373 | 12 | # Global only | ||
374 | 13 | --error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
375 | 14 | SELECT @@SESSION.innodb_sched_priority_purge; | ||
376 | 15 | |||
377 | 16 | # Correct values | ||
378 | 17 | # The high priority values may need permissions, thus do not test them | ||
379 | 18 | # SET GLOBAL innodb_sched_priority_purge=0; | ||
380 | 19 | # SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
381 | 20 | #SET GLOBAL innodb_sched_priority_purge=15; | ||
382 | 21 | # SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
383 | 22 | SET GLOBAL innodb_sched_priority_purge=20; | ||
384 | 23 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
385 | 24 | SET GLOBAL innodb_sched_priority_purge=25; | ||
386 | 25 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
387 | 26 | SET GLOBAL innodb_sched_priority_purge=39; | ||
388 | 27 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
389 | 28 | |||
390 | 29 | # Incorrect values | ||
391 | 30 | #SET GLOBAL innodb_sched_priority_purge=-1; | ||
392 | 31 | #SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
393 | 32 | SET GLOBAL innodb_sched_priority_purge=41; | ||
394 | 33 | SELECT @@GLOBAL.innodb_sched_priority_purge; | ||
395 | 34 | --error ER_WRONG_TYPE_FOR_VAR | ||
396 | 35 | SET GLOBAL innodb_sched_priority_purge=1.1; | ||
397 | 36 | --error ER_WRONG_TYPE_FOR_VAR | ||
398 | 37 | SET GLOBAL innodb_sched_priority_purge=1e1; | ||
399 | 38 | --error ER_WRONG_TYPE_FOR_VAR | ||
400 | 39 | SET GLOBAL innodb_sched_priority_purge='foo'; | ||
401 | 40 | |||
402 | 41 | # If we are lacking permissions, then we cannot restore the startup value | ||
403 | 42 | # at the end. | ||
404 | 43 | --source include/restart_mysqld.inc | ||
405 | 0 | 44 | ||
406 | === modified file 'Percona-Server/storage/innobase/buf/buf0flu.cc' | |||
407 | --- Percona-Server/storage/innobase/buf/buf0flu.cc 2013-10-02 08:34:56 +0000 | |||
408 | +++ Percona-Server/storage/innobase/buf/buf0flu.cc 2013-10-03 06:43:28 +0000 | |||
409 | @@ -2636,6 +2636,10 @@ | |||
410 | 2636 | pfs_register_thread(buf_page_cleaner_thread_key); | 2636 | pfs_register_thread(buf_page_cleaner_thread_key); |
411 | 2637 | #endif /* UNIV_PFS_THREAD */ | 2637 | #endif /* UNIV_PFS_THREAD */ |
412 | 2638 | 2638 | ||
413 | 2639 | srv_cleaner_tid = os_thread_get_tid(); | ||
414 | 2640 | |||
415 | 2641 | os_thread_set_priority(srv_cleaner_tid, srv_sched_priority_cleaner); | ||
416 | 2642 | |||
417 | 2639 | #ifdef UNIV_DEBUG_THREAD_CREATION | 2643 | #ifdef UNIV_DEBUG_THREAD_CREATION |
418 | 2640 | fprintf(stderr, "InnoDB: page_cleaner thread running, id %lu\n", | 2644 | fprintf(stderr, "InnoDB: page_cleaner thread running, id %lu\n", |
419 | 2641 | os_thread_pf(os_thread_get_curr_id())); | 2645 | os_thread_pf(os_thread_get_curr_id())); |
420 | 2642 | 2646 | ||
421 | === modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc' | |||
422 | --- Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-09-30 12:13:10 +0000 | |||
423 | +++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-10-03 06:43:28 +0000 | |||
424 | @@ -15714,6 +15714,172 @@ | |||
425 | 15714 | } | 15714 | } |
426 | 15715 | } | 15715 | } |
427 | 15716 | 15716 | ||
428 | 15717 | #ifdef UNIV_LINUX | ||
429 | 15718 | |||
430 | 15719 | /****************************************************************//** | ||
431 | 15720 | Update the innodb_sched_priority_cleaner variable and set the thread | ||
432 | 15721 | priority accordingly. */ | ||
433 | 15722 | static | ||
434 | 15723 | void | ||
435 | 15724 | innodb_sched_priority_cleaner_update( | ||
436 | 15725 | /*=================================*/ | ||
437 | 15726 | THD* thd, /*!< in: thread handle */ | ||
438 | 15727 | struct st_mysql_sys_var* var, /*!< in: pointer to | ||
439 | 15728 | system variable */ | ||
440 | 15729 | void* var_ptr,/*!< out: where the | ||
441 | 15730 | formal string goes */ | ||
442 | 15731 | const void* save) /*!< in: immediate result | ||
443 | 15732 | from check function */ | ||
444 | 15733 | { | ||
445 | 15734 | ulint priority = *static_cast<const ulint *>(save); | ||
446 | 15735 | ulint actual_priority; | ||
447 | 15736 | |||
448 | 15737 | if (srv_read_only_mode) { | ||
449 | 15738 | |||
450 | 15739 | return; | ||
451 | 15740 | } | ||
452 | 15741 | |||
453 | 15742 | ut_ad(buf_page_cleaner_is_active); | ||
454 | 15743 | actual_priority = os_thread_set_priority(srv_cleaner_tid, priority); | ||
455 | 15744 | if (UNIV_UNLIKELY(actual_priority != priority)) { | ||
456 | 15745 | |||
457 | 15746 | push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, | ||
458 | 15747 | ER_WRONG_ARGUMENTS, | ||
459 | 15748 | "Failed to set the page cleaner thread " | ||
460 | 15749 | "priority to %lu, " | ||
461 | 15750 | "the current priority is %lu", priority, | ||
462 | 15751 | actual_priority); | ||
463 | 15752 | } else { | ||
464 | 15753 | |||
465 | 15754 | srv_sched_priority_cleaner = priority; | ||
466 | 15755 | } | ||
467 | 15756 | } | ||
468 | 15757 | |||
469 | 15758 | #if defined(UNIV_DEBUG) || (UNIV_PERF_DEBUG) | ||
470 | 15759 | |||
471 | 15760 | /****************************************************************//** | ||
472 | 15761 | Update the innodb_sched_priority_purge variable and set the thread | ||
473 | 15762 | priorities accordingly. */ | ||
474 | 15763 | static | ||
475 | 15764 | void | ||
476 | 15765 | innodb_sched_priority_purge_update( | ||
477 | 15766 | /*===============================*/ | ||
478 | 15767 | THD* thd, /*!< in: thread handle */ | ||
479 | 15768 | struct st_mysql_sys_var* var, /*!< in: pointer to | ||
480 | 15769 | system variable */ | ||
481 | 15770 | void* var_ptr,/*!< out: where the | ||
482 | 15771 | formal string goes */ | ||
483 | 15772 | const void* save) /*!< in: immediate result | ||
484 | 15773 | from check function */ | ||
485 | 15774 | { | ||
486 | 15775 | ulint priority = *static_cast<const ulint *>(save); | ||
487 | 15776 | |||
488 | 15777 | if (srv_read_only_mode) { | ||
489 | 15778 | return; | ||
490 | 15779 | } | ||
491 | 15780 | |||
492 | 15781 | ut_ad(purge_sys->state == PURGE_STATE_RUN); | ||
493 | 15782 | for (ulint i = 0; i < srv_n_purge_threads; i++) { | ||
494 | 15783 | |||
495 | 15784 | ulint actual_priority | ||
496 | 15785 | = os_thread_set_priority(srv_purge_tids[i], priority); | ||
497 | 15786 | if (UNIV_UNLIKELY(actual_priority != priority)) { | ||
498 | 15787 | |||
499 | 15788 | push_warning_printf(thd, | ||
500 | 15789 | Sql_condition::WARN_LEVEL_WARN, | ||
501 | 15790 | ER_WRONG_ARGUMENTS, | ||
502 | 15791 | "Failed to set the purge " | ||
503 | 15792 | "thread priority to %lu, the " | ||
504 | 15793 | "current priority is %lu, " | ||
505 | 15794 | "aborting priority update", | ||
506 | 15795 | priority, actual_priority); | ||
507 | 15796 | return; | ||
508 | 15797 | } | ||
509 | 15798 | } | ||
510 | 15799 | |||
511 | 15800 | srv_sched_priority_purge = priority; | ||
512 | 15801 | } | ||
513 | 15802 | |||
514 | 15803 | /****************************************************************//** | ||
515 | 15804 | Update the innodb_sched_priority_io variable and set the thread | ||
516 | 15805 | priorities accordingly. */ | ||
517 | 15806 | static | ||
518 | 15807 | void | ||
519 | 15808 | innodb_sched_priority_io_update( | ||
520 | 15809 | /*============================*/ | ||
521 | 15810 | THD* thd, /*!< in: thread handle */ | ||
522 | 15811 | struct st_mysql_sys_var* var, /*!< in: pointer to | ||
523 | 15812 | system variable */ | ||
524 | 15813 | void* var_ptr,/*!< out: where the | ||
525 | 15814 | formal string goes */ | ||
526 | 15815 | const void* save) /*!< in: immediate result | ||
527 | 15816 | from check function */ | ||
528 | 15817 | { | ||
529 | 15818 | ulint priority = *static_cast<const ulint *>(save); | ||
530 | 15819 | |||
531 | 15820 | for (ulint i = 0; i < srv_n_file_io_threads; i++) { | ||
532 | 15821 | |||
533 | 15822 | ulint actual_priority = os_thread_set_priority(srv_io_tids[i], | ||
534 | 15823 | priority); | ||
535 | 15824 | |||
536 | 15825 | if (UNIV_UNLIKELY(actual_priority != priority)) { | ||
537 | 15826 | |||
538 | 15827 | push_warning_printf(thd, | ||
539 | 15828 | Sql_condition::WARN_LEVEL_WARN, | ||
540 | 15829 | ER_WRONG_ARGUMENTS, | ||
541 | 15830 | "Failed to set the I/O " | ||
542 | 15831 | "thread priority to %lu, the " | ||
543 | 15832 | "current priority is %lu, " | ||
544 | 15833 | "aborting priority update", | ||
545 | 15834 | priority, actual_priority); | ||
546 | 15835 | return; | ||
547 | 15836 | } | ||
548 | 15837 | } | ||
549 | 15838 | |||
550 | 15839 | srv_sched_priority_io = priority; | ||
551 | 15840 | } | ||
552 | 15841 | |||
553 | 15842 | /****************************************************************//** | ||
554 | 15843 | Update the innodb_sched_priority_master variable and set the thread | ||
555 | 15844 | priorities accordingly. */ | ||
556 | 15845 | static | ||
557 | 15846 | void | ||
558 | 15847 | innodb_sched_priority_master_update( | ||
559 | 15848 | /*================================*/ | ||
560 | 15849 | THD* thd, /*!< in: thread handle */ | ||
561 | 15850 | struct st_mysql_sys_var* var, /*!< in: pointer to | ||
562 | 15851 | system variable */ | ||
563 | 15852 | void* var_ptr,/*!< out: where the | ||
564 | 15853 | formal string goes */ | ||
565 | 15854 | const void* save) /*!< in: immediate result | ||
566 | 15855 | from check function */ | ||
567 | 15856 | { | ||
568 | 15857 | ulint priority = *static_cast<const lint *>(save); | ||
569 | 15858 | ulint actual_priority; | ||
570 | 15859 | |||
571 | 15860 | if (srv_read_only_mode) { | ||
572 | 15861 | return; | ||
573 | 15862 | } | ||
574 | 15863 | |||
575 | 15864 | actual_priority = os_thread_set_priority(srv_master_tid, priority); | ||
576 | 15865 | if (UNIV_UNLIKELY(actual_priority != priority)) { | ||
577 | 15866 | |||
578 | 15867 | push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, | ||
579 | 15868 | ER_WRONG_ARGUMENTS, | ||
580 | 15869 | "Failed to set the master thread " | ||
581 | 15870 | "priority to %lu, " | ||
582 | 15871 | "the current priority is %lu", priority, | ||
583 | 15872 | actual_priority); | ||
584 | 15873 | } else { | ||
585 | 15874 | |||
586 | 15875 | srv_sched_priority_master = priority; | ||
587 | 15876 | } | ||
588 | 15877 | } | ||
589 | 15878 | |||
590 | 15879 | #endif /* defined(UNIV_DEBUG) || (UNIV_PERF_DEBUG) */ | ||
591 | 15880 | |||
592 | 15881 | #endif /* UNIV_LINUX */ | ||
593 | 15882 | |||
594 | 15717 | /****************************************************************//** | 15883 | /****************************************************************//** |
595 | 15718 | Callback function for accessing the InnoDB variables from MySQL: | 15884 | Callback function for accessing the InnoDB variables from MySQL: |
596 | 15719 | SHOW VARIABLES. */ | 15885 | SHOW VARIABLES. */ |
597 | @@ -16266,7 +16432,7 @@ | |||
598 | 16266 | NULL, NULL, | 16432 | NULL, NULL, |
599 | 16267 | 1, /* Default setting */ | 16433 | 1, /* Default setting */ |
600 | 16268 | 1, /* Minimum value */ | 16434 | 1, /* Minimum value */ |
602 | 16269 | 32, 0); /* Maximum value */ | 16435 | SRV_MAX_N_PURGE_THREADS, 0); /* Maximum value */ |
603 | 16270 | 16436 | ||
604 | 16271 | static MYSQL_SYSVAR_ULONG(sync_array_size, srv_sync_array_size, | 16437 | static MYSQL_SYSVAR_ULONG(sync_array_size, srv_sync_array_size, |
605 | 16272 | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, | 16438 | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, |
606 | @@ -16539,6 +16705,15 @@ | |||
607 | 16539 | "established by the buffer pool memory region. Disabled by default.", | 16705 | "established by the buffer pool memory region. Disabled by default.", |
608 | 16540 | NULL, NULL, FALSE); | 16706 | NULL, NULL, FALSE); |
609 | 16541 | 16707 | ||
610 | 16708 | #ifdef UNIV_LINUX | ||
611 | 16709 | |||
612 | 16710 | static MYSQL_SYSVAR_ULONG(sched_priority_cleaner, srv_sched_priority_cleaner, | ||
613 | 16711 | PLUGIN_VAR_RQCMDARG, | ||
614 | 16712 | "Nice value for the cleaner thread scheduling", | ||
615 | 16713 | NULL, innodb_sched_priority_cleaner_update, 20, 0, 39, 0); | ||
616 | 16714 | |||
617 | 16715 | #endif /* UNIV_LINUX */ | ||
618 | 16716 | |||
619 | 16542 | #if defined UNIV_DEBUG || defined UNIV_PERF_DEBUG | 16717 | #if defined UNIV_DEBUG || defined UNIV_PERF_DEBUG |
620 | 16543 | static MYSQL_SYSVAR_ULONG(page_hash_locks, srv_n_page_hash_locks, | 16718 | static MYSQL_SYSVAR_ULONG(page_hash_locks, srv_n_page_hash_locks, |
621 | 16544 | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, | 16719 | PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, |
622 | @@ -16552,6 +16727,21 @@ | |||
623 | 16552 | 16727 | ||
624 | 16553 | #ifdef UNIV_LINUX | 16728 | #ifdef UNIV_LINUX |
625 | 16554 | 16729 | ||
626 | 16730 | static MYSQL_SYSVAR_ULONG(sched_priority_purge, srv_sched_priority_purge, | ||
627 | 16731 | PLUGIN_VAR_RQCMDARG, | ||
628 | 16732 | "Nice value for the purge thread scheduling", | ||
629 | 16733 | NULL, innodb_sched_priority_purge_update, 20, 0, 39, 0); | ||
630 | 16734 | |||
631 | 16735 | static MYSQL_SYSVAR_ULONG(sched_priority_io, srv_sched_priority_io, | ||
632 | 16736 | PLUGIN_VAR_RQCMDARG, | ||
633 | 16737 | "Nice value for the I/O handler thread scheduling", | ||
634 | 16738 | NULL, innodb_sched_priority_io_update, 20, 0, 39, 0); | ||
635 | 16739 | |||
636 | 16740 | static MYSQL_SYSVAR_ULONG(sched_priority_master, srv_sched_priority_master, | ||
637 | 16741 | PLUGIN_VAR_RQCMDARG, | ||
638 | 16742 | "Nice value for the master thread scheduling", | ||
639 | 16743 | NULL, innodb_sched_priority_master_update, 20, 0, 39, 0); | ||
640 | 16744 | |||
641 | 16555 | static MYSQL_SYSVAR_BOOL(priority_purge, srv_purge_thread_priority, | 16745 | static MYSQL_SYSVAR_BOOL(priority_purge, srv_purge_thread_priority, |
642 | 16556 | PLUGIN_VAR_OPCMDARG, | 16746 | PLUGIN_VAR_OPCMDARG, |
643 | 16557 | "Make purge coordinator and worker threads acquire shared resources with " | 16747 | "Make purge coordinator and worker threads acquire shared resources with " |
644 | @@ -17268,10 +17458,16 @@ | |||
645 | 17268 | MYSQL_SYSVAR(log_checkpoint_now), | 17458 | MYSQL_SYSVAR(log_checkpoint_now), |
646 | 17269 | MYSQL_SYSVAR(track_redo_log_now), | 17459 | MYSQL_SYSVAR(track_redo_log_now), |
647 | 17270 | #endif /* UNIV_DEBUG */ | 17460 | #endif /* UNIV_DEBUG */ |
648 | 17461 | #ifdef UNIV_LINUX | ||
649 | 17462 | MYSQL_SYSVAR(sched_priority_cleaner), | ||
650 | 17463 | #endif | ||
651 | 17271 | #if defined UNIV_DEBUG || defined UNIV_PERF_DEBUG | 17464 | #if defined UNIV_DEBUG || defined UNIV_PERF_DEBUG |
652 | 17272 | MYSQL_SYSVAR(page_hash_locks), | 17465 | MYSQL_SYSVAR(page_hash_locks), |
653 | 17273 | MYSQL_SYSVAR(doublewrite_batch_size), | 17466 | MYSQL_SYSVAR(doublewrite_batch_size), |
654 | 17274 | #ifdef UNIV_LINUX | 17467 | #ifdef UNIV_LINUX |
655 | 17468 | MYSQL_SYSVAR(sched_priority_purge), | ||
656 | 17469 | MYSQL_SYSVAR(sched_priority_io), | ||
657 | 17470 | MYSQL_SYSVAR(sched_priority_master), | ||
658 | 17275 | MYSQL_SYSVAR(priority_purge), | 17471 | MYSQL_SYSVAR(priority_purge), |
659 | 17276 | MYSQL_SYSVAR(priority_io), | 17472 | MYSQL_SYSVAR(priority_io), |
660 | 17277 | MYSQL_SYSVAR(priority_cleaner), | 17473 | MYSQL_SYSVAR(priority_cleaner), |
661 | 17278 | 17474 | ||
662 | === modified file 'Percona-Server/storage/innobase/include/os0thread.h' | |||
663 | --- Percona-Server/storage/innobase/include/os0thread.h 2013-06-10 20:44:22 +0000 | |||
664 | +++ Percona-Server/storage/innobase/include/os0thread.h 2013-10-03 06:43:28 +0000 | |||
665 | @@ -29,6 +29,10 @@ | |||
666 | 29 | 29 | ||
667 | 30 | #include "univ.i" | 30 | #include "univ.i" |
668 | 31 | 31 | ||
669 | 32 | #ifdef UNIV_LINUX | ||
670 | 33 | #include <sys/types.h> | ||
671 | 34 | #endif | ||
672 | 35 | |||
673 | 32 | /* Maximum number of threads which can be created in the program; | 36 | /* Maximum number of threads which can be created in the program; |
674 | 33 | this is also the size of the wait slot array for MySQL threads which | 37 | this is also the size of the wait slot array for MySQL threads which |
675 | 34 | can wait inside InnoDB */ | 38 | can wait inside InnoDB */ |
676 | @@ -45,6 +49,7 @@ | |||
677 | 45 | typedef void* os_thread_t; | 49 | typedef void* os_thread_t; |
678 | 46 | typedef DWORD os_thread_id_t; /*!< In Windows the thread id | 50 | typedef DWORD os_thread_id_t; /*!< In Windows the thread id |
679 | 47 | is an unsigned long int */ | 51 | is an unsigned long int */ |
680 | 52 | typedef os_thread_id_t os_tid_t; | ||
681 | 48 | extern "C" { | 53 | extern "C" { |
682 | 49 | typedef LPTHREAD_START_ROUTINE os_thread_func_t; | 54 | typedef LPTHREAD_START_ROUTINE os_thread_func_t; |
683 | 50 | } | 55 | } |
684 | @@ -65,6 +70,15 @@ | |||
685 | 65 | typedef os_thread_t os_thread_id_t; /*!< In Unix we use the thread | 70 | typedef os_thread_t os_thread_id_t; /*!< In Unix we use the thread |
686 | 66 | handle itself as the id of | 71 | handle itself as the id of |
687 | 67 | the thread */ | 72 | the thread */ |
688 | 73 | #ifdef UNIV_LINUX | ||
689 | 74 | typedef pid_t os_tid_t; /*!< An alias for pid_t on | ||
690 | 75 | Linux, where setpriority() | ||
691 | 76 | accepts thread id of this type | ||
692 | 77 | and not pthread_t */ | ||
693 | 78 | #else | ||
694 | 79 | typedef os_thread_id_t os_tid_t; | ||
695 | 80 | #endif | ||
696 | 81 | |||
697 | 68 | extern "C" { typedef void* (*os_thread_func_t)(void*); } | 82 | extern "C" { typedef void* (*os_thread_func_t)(void*); } |
698 | 69 | 83 | ||
699 | 70 | /** Macro for specifying a POSIX thread start function. */ | 84 | /** Macro for specifying a POSIX thread start function. */ |
700 | @@ -134,6 +148,15 @@ | |||
701 | 134 | os_thread_get_curr_id(void); | 148 | os_thread_get_curr_id(void); |
702 | 135 | /*========================*/ | 149 | /*========================*/ |
703 | 136 | /*****************************************************************//** | 150 | /*****************************************************************//** |
704 | 151 | Returns the system-specific thread identifier of current thread. On Linux, | ||
705 | 152 | returns tid. On other systems currently returns os_thread_get_curr_id(). | ||
706 | 153 | |||
707 | 154 | @return current thread identifier */ | ||
708 | 155 | UNIV_INTERN | ||
709 | 156 | os_tid_t | ||
710 | 157 | os_thread_get_tid(void); | ||
711 | 158 | /*=====================*/ | ||
712 | 159 | /*****************************************************************//** | ||
713 | 137 | Advises the os to give up remainder of the thread's time slice. */ | 160 | Advises the os to give up remainder of the thread's time slice. */ |
714 | 138 | UNIV_INTERN | 161 | UNIV_INTERN |
715 | 139 | void | 162 | void |
716 | @@ -146,6 +169,18 @@ | |||
717 | 146 | os_thread_sleep( | 169 | os_thread_sleep( |
718 | 147 | /*============*/ | 170 | /*============*/ |
719 | 148 | ulint tm); /*!< in: time in microseconds */ | 171 | ulint tm); /*!< in: time in microseconds */ |
720 | 172 | /*****************************************************************//** | ||
721 | 173 | Set relative scheduling priority for a given thread on Linux. Currently a | ||
722 | 174 | no-op on other systems. | ||
723 | 175 | |||
724 | 176 | @return An actual thread priority after the update */ | ||
725 | 177 | UNIV_INTERN | ||
726 | 178 | ulint | ||
727 | 179 | os_thread_set_priority( | ||
728 | 180 | /*===================*/ | ||
729 | 181 | os_tid_t thread_id, /*!< in: thread id */ | ||
730 | 182 | ulint relative_priority); /*!< in: system-specific | ||
731 | 183 | priority value */ | ||
732 | 149 | 184 | ||
733 | 150 | #ifndef UNIV_NONINL | 185 | #ifndef UNIV_NONINL |
734 | 151 | #include "os0thread.ic" | 186 | #include "os0thread.ic" |
735 | 152 | 187 | ||
736 | === modified file 'Percona-Server/storage/innobase/include/srv0srv.h' | |||
737 | --- Percona-Server/storage/innobase/include/srv0srv.h 2013-09-30 12:13:10 +0000 | |||
738 | +++ Percona-Server/storage/innobase/include/srv0srv.h 2013-10-03 06:43:28 +0000 | |||
739 | @@ -503,11 +503,37 @@ | |||
740 | 503 | 503 | ||
741 | 504 | #define SRV_MAX_N_IO_THREADS 130 | 504 | #define SRV_MAX_N_IO_THREADS 130 |
742 | 505 | 505 | ||
743 | 506 | #define SRV_MAX_N_PURGE_THREADS 32 | ||
744 | 507 | |||
745 | 506 | /* Array of English strings describing the current state of an | 508 | /* Array of English strings describing the current state of an |
746 | 507 | i/o handler thread */ | 509 | i/o handler thread */ |
747 | 508 | extern const char* srv_io_thread_op_info[]; | 510 | extern const char* srv_io_thread_op_info[]; |
748 | 509 | extern const char* srv_io_thread_function[]; | 511 | extern const char* srv_io_thread_function[]; |
749 | 510 | 512 | ||
750 | 513 | /* The tid of the cleaner thread */ | ||
751 | 514 | extern os_tid_t srv_cleaner_tid; | ||
752 | 515 | |||
753 | 516 | /* The tids of the purge threads */ | ||
754 | 517 | extern os_tid_t srv_purge_tids[]; | ||
755 | 518 | |||
756 | 519 | /* The tids of the I/O threads */ | ||
757 | 520 | extern os_tid_t srv_io_tids[]; | ||
758 | 521 | |||
759 | 522 | /* The tid of the master thread */ | ||
760 | 523 | extern os_tid_t srv_master_tid; | ||
761 | 524 | |||
762 | 525 | /* The relative scheduling priority of the cleaner thread */ | ||
763 | 526 | extern ulint srv_sched_priority_cleaner; | ||
764 | 527 | |||
765 | 528 | /* The relative scheduling priority of the purge threads */ | ||
766 | 529 | extern ulint srv_sched_priority_purge; | ||
767 | 530 | |||
768 | 531 | /* The relative scheduling priority of the I/O threads */ | ||
769 | 532 | extern ulint srv_sched_priority_io; | ||
770 | 533 | |||
771 | 534 | /* The relative scheduling priority of the master thread */ | ||
772 | 535 | extern ulint srv_sched_priority_master; | ||
773 | 536 | |||
774 | 511 | /* The relative priority of the purge coordinator and worker threads. */ | 537 | /* The relative priority of the purge coordinator and worker threads. */ |
775 | 512 | extern my_bool srv_purge_thread_priority; | 538 | extern my_bool srv_purge_thread_priority; |
776 | 513 | 539 | ||
777 | 514 | 540 | ||
778 | === modified file 'Percona-Server/storage/innobase/os/os0thread.cc' | |||
779 | --- Percona-Server/storage/innobase/os/os0thread.cc 2013-06-10 20:44:22 +0000 | |||
780 | +++ Percona-Server/storage/innobase/os/os0thread.cc 2013-10-03 06:43:28 +0000 | |||
781 | @@ -30,6 +30,12 @@ | |||
782 | 30 | 30 | ||
783 | 31 | #ifdef __WIN__ | 31 | #ifdef __WIN__ |
784 | 32 | #include <windows.h> | 32 | #include <windows.h> |
785 | 33 | #elif UNIV_LINUX | ||
786 | 34 | #include <sys/time.h> | ||
787 | 35 | #include <sys/resource.h> | ||
788 | 36 | #include <unistd.h> | ||
789 | 37 | #include <sys/syscall.h> | ||
790 | 38 | #include <sys/types.h> | ||
791 | 33 | #endif | 39 | #endif |
792 | 34 | 40 | ||
793 | 35 | #ifndef UNIV_HOTBACKUP | 41 | #ifndef UNIV_HOTBACKUP |
794 | @@ -98,6 +104,24 @@ | |||
795 | 98 | #endif | 104 | #endif |
796 | 99 | } | 105 | } |
797 | 100 | 106 | ||
798 | 107 | /*****************************************************************//** | ||
799 | 108 | Returns the system-specific thread identifier of current thread. On Linux, | ||
800 | 109 | returns tid. On other systems currently returns os_thread_get_curr_id(). | ||
801 | 110 | |||
802 | 111 | @return current thread identifier */ | ||
803 | 112 | UNIV_INTERN | ||
804 | 113 | os_tid_t | ||
805 | 114 | os_thread_get_tid(void) | ||
806 | 115 | /*===================*/ | ||
807 | 116 | { | ||
808 | 117 | #ifdef UNIV_LINUX | ||
809 | 118 | return((os_tid_t)syscall(SYS_gettid)); | ||
810 | 119 | #else | ||
811 | 120 | return(os_thread_get_curr_id()); | ||
812 | 121 | #endif | ||
813 | 122 | } | ||
814 | 123 | |||
815 | 124 | |||
816 | 101 | /****************************************************************//** | 125 | /****************************************************************//** |
817 | 102 | Creates a new thread of execution. The execution starts from | 126 | Creates a new thread of execution. The execution starts from |
818 | 103 | the function given. The start function takes a void* parameter | 127 | the function given. The start function takes a void* parameter |
819 | @@ -255,3 +279,31 @@ | |||
820 | 255 | select(0, NULL, NULL, NULL, &t); | 279 | select(0, NULL, NULL, NULL, &t); |
821 | 256 | #endif | 280 | #endif |
822 | 257 | } | 281 | } |
823 | 282 | |||
824 | 283 | /*****************************************************************//** | ||
825 | 284 | Set relative scheduling priority for a given thread on Linux. Currently a | ||
826 | 285 | no-op on other systems. | ||
827 | 286 | |||
828 | 287 | @return An actual thread priority after the update */ | ||
829 | 288 | UNIV_INTERN | ||
830 | 289 | ulint | ||
831 | 290 | os_thread_set_priority( | ||
832 | 291 | /*===================*/ | ||
833 | 292 | os_tid_t thread_id, /*!< in: thread id */ | ||
834 | 293 | ulint relative_priority) /*!< in: system-specific | ||
835 | 294 | priority value */ | ||
836 | 295 | { | ||
837 | 296 | #ifdef UNIV_LINUX | ||
838 | 297 | lint thread_nice = relative_priority - 20; | ||
839 | 298 | if (setpriority(PRIO_PROCESS, thread_id, thread_nice) == -1) { | ||
840 | 299 | ib_logf(IB_LOG_LEVEL_WARN, | ||
841 | 300 | "Setting thread %lu nice to %ld failed, " | ||
842 | 301 | "current nice %d, errno %d", | ||
843 | 302 | os_thread_pf(thread_id), thread_nice, | ||
844 | 303 | getpriority(PRIO_PROCESS, thread_id), errno); | ||
845 | 304 | } | ||
846 | 305 | return(getpriority(PRIO_PROCESS, thread_id) + 20); | ||
847 | 306 | #else | ||
848 | 307 | return(relative_priority); | ||
849 | 308 | #endif | ||
850 | 309 | } | ||
851 | 258 | 310 | ||
852 | === modified file 'Percona-Server/storage/innobase/srv/srv0srv.cc' | |||
853 | --- Percona-Server/storage/innobase/srv/srv0srv.cc 2013-09-30 12:13:10 +0000 | |||
854 | +++ Percona-Server/storage/innobase/srv/srv0srv.cc 2013-10-03 06:43:28 +0000 | |||
855 | @@ -344,6 +344,30 @@ | |||
856 | 344 | /* Number of iterations over which adaptive flushing is averaged. */ | 344 | /* Number of iterations over which adaptive flushing is averaged. */ |
857 | 345 | UNIV_INTERN ulong srv_flushing_avg_loops = 30; | 345 | UNIV_INTERN ulong srv_flushing_avg_loops = 30; |
858 | 346 | 346 | ||
859 | 347 | /* The tid of the cleaner thread */ | ||
860 | 348 | UNIV_INTERN os_tid_t srv_cleaner_tid; | ||
861 | 349 | |||
862 | 350 | /* The tids of the purge threads */ | ||
863 | 351 | UNIV_INTERN os_tid_t srv_purge_tids[SRV_MAX_N_PURGE_THREADS]; | ||
864 | 352 | |||
865 | 353 | /* The tids of the I/O threads */ | ||
866 | 354 | UNIV_INTERN os_tid_t srv_io_tids[SRV_MAX_N_IO_THREADS]; | ||
867 | 355 | |||
868 | 356 | /* The tid of the master thread */ | ||
869 | 357 | UNIV_INTERN os_tid_t srv_master_tid; | ||
870 | 358 | |||
871 | 359 | /* The relative scheduling priority of the cleaner thread */ | ||
872 | 360 | UNIV_INTERN ulint srv_sched_priority_cleaner = 20; | ||
873 | 361 | |||
874 | 362 | /* The relative scheduling priority of the purge threads */ | ||
875 | 363 | UNIV_INTERN ulint srv_sched_priority_purge = 20; | ||
876 | 364 | |||
877 | 365 | /* The relative scheduling priority of the I/O threads */ | ||
878 | 366 | UNIV_INTERN ulint srv_sched_priority_io = 20; | ||
879 | 367 | |||
880 | 368 | /* The relative scheduling priority of the master thread */ | ||
881 | 369 | UNIV_INTERN ulint srv_sched_priority_master = 20; | ||
882 | 370 | |||
883 | 347 | /* The relative priority of the current thread. If 0, low priority; if 1, high | 371 | /* The relative priority of the current thread. If 0, low priority; if 1, high |
884 | 348 | priority. */ | 372 | priority. */ |
885 | 349 | UNIV_INTERN UNIV_THREAD_LOCAL ulint srv_current_thread_priority = 0; | 373 | UNIV_INTERN UNIV_THREAD_LOCAL ulint srv_current_thread_priority = 0; |
886 | @@ -2877,6 +2901,10 @@ | |||
887 | 2877 | 2901 | ||
888 | 2878 | ut_ad(!srv_read_only_mode); | 2902 | ut_ad(!srv_read_only_mode); |
889 | 2879 | 2903 | ||
890 | 2904 | srv_master_tid = os_thread_get_tid(); | ||
891 | 2905 | |||
892 | 2906 | os_thread_set_priority(srv_master_tid, srv_sched_priority_master); | ||
893 | 2907 | |||
894 | 2880 | #ifdef UNIV_DEBUG_THREAD_CREATION | 2908 | #ifdef UNIV_DEBUG_THREAD_CREATION |
895 | 2881 | fprintf(stderr, "Master thread starts, id %lu\n", | 2909 | fprintf(stderr, "Master thread starts, id %lu\n", |
896 | 2882 | os_thread_pf(os_thread_get_curr_id())); | 2910 | os_thread_pf(os_thread_get_curr_id())); |
897 | @@ -3006,6 +3034,8 @@ | |||
898 | 3006 | return(thr != NULL); | 3034 | return(thr != NULL); |
899 | 3007 | } | 3035 | } |
900 | 3008 | 3036 | ||
901 | 3037 | static ulint purge_tid_i = 0; | ||
902 | 3038 | |||
903 | 3009 | /*********************************************************************//** | 3039 | /*********************************************************************//** |
904 | 3010 | Worker thread that reads tasks from the work queue and executes them. | 3040 | Worker thread that reads tasks from the work queue and executes them. |
905 | 3011 | @return a dummy parameter */ | 3041 | @return a dummy parameter */ |
906 | @@ -3017,10 +3047,16 @@ | |||
907 | 3017 | required by os_thread_create */ | 3047 | required by os_thread_create */ |
908 | 3018 | { | 3048 | { |
909 | 3019 | srv_slot_t* slot; | 3049 | srv_slot_t* slot; |
910 | 3050 | ulint tid_i = os_atomic_increment_ulint(&purge_tid_i, 1); | ||
911 | 3020 | 3051 | ||
912 | 3052 | ut_ad(tid_i < srv_n_purge_threads); | ||
913 | 3021 | ut_ad(!srv_read_only_mode); | 3053 | ut_ad(!srv_read_only_mode); |
914 | 3022 | ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND); | 3054 | ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND); |
915 | 3023 | 3055 | ||
916 | 3056 | srv_purge_tids[tid_i] = os_thread_get_tid(); | ||
917 | 3057 | os_thread_set_priority(srv_purge_tids[tid_i], | ||
918 | 3058 | srv_sched_priority_purge); | ||
919 | 3059 | |||
920 | 3024 | #ifdef UNIV_DEBUG_THREAD_CREATION | 3060 | #ifdef UNIV_DEBUG_THREAD_CREATION |
921 | 3025 | ut_print_timestamp(stderr); | 3061 | ut_print_timestamp(stderr); |
922 | 3026 | fprintf(stderr, " InnoDB: worker thread starting, id %lu\n", | 3062 | fprintf(stderr, " InnoDB: worker thread starting, id %lu\n", |
923 | @@ -3286,6 +3322,9 @@ | |||
924 | 3286 | ut_a(trx_purge_state() == PURGE_STATE_INIT); | 3322 | ut_a(trx_purge_state() == PURGE_STATE_INIT); |
925 | 3287 | ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND); | 3323 | ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND); |
926 | 3288 | 3324 | ||
927 | 3325 | srv_purge_tids[0] = os_thread_get_tid(); | ||
928 | 3326 | os_thread_set_priority(srv_purge_tids[0], srv_sched_priority_purge); | ||
929 | 3327 | |||
930 | 3289 | rw_lock_x_lock(&purge_sys->latch); | 3328 | rw_lock_x_lock(&purge_sys->latch); |
931 | 3290 | 3329 | ||
932 | 3291 | purge_sys->running = true; | 3330 | purge_sys->running = true; |
933 | 3292 | 3331 | ||
934 | === modified file 'Percona-Server/storage/innobase/srv/srv0start.cc' | |||
935 | --- Percona-Server/storage/innobase/srv/srv0start.cc 2013-09-27 14:09:03 +0000 | |||
936 | +++ Percona-Server/storage/innobase/srv/srv0start.cc 2013-10-03 06:43:28 +0000 | |||
937 | @@ -127,7 +127,8 @@ | |||
938 | 127 | /** io_handler_thread parameters for thread identification */ | 127 | /** io_handler_thread parameters for thread identification */ |
939 | 128 | static ulint n[SRV_MAX_N_IO_THREADS + 6]; | 128 | static ulint n[SRV_MAX_N_IO_THREADS + 6]; |
940 | 129 | /** io_handler_thread identifiers, 32 is the maximum number of purge threads */ | 129 | /** io_handler_thread identifiers, 32 is the maximum number of purge threads */ |
942 | 130 | static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + 32]; | 130 | static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 |
943 | 131 | + SRV_MAX_N_PURGE_THREADS]; | ||
944 | 131 | 132 | ||
945 | 132 | /** We use this mutex to test the return value of pthread_mutex_trylock | 133 | /** We use this mutex to test the return value of pthread_mutex_trylock |
946 | 133 | on successful locking. HP-UX does NOT return 0, though Linux et al do. */ | 134 | on successful locking. HP-UX does NOT return 0, though Linux et al do. */ |
947 | @@ -452,6 +453,9 @@ | |||
948 | 452 | } | 453 | } |
949 | 453 | 454 | ||
950 | 454 | #ifndef UNIV_HOTBACKUP | 455 | #ifndef UNIV_HOTBACKUP |
951 | 456 | |||
952 | 457 | static ulint io_tid_i = 0; | ||
953 | 458 | |||
954 | 455 | /********************************************************************//** | 459 | /********************************************************************//** |
955 | 456 | I/o-handler thread function. | 460 | I/o-handler thread function. |
956 | 457 | @return OS_THREAD_DUMMY_RETURN */ | 461 | @return OS_THREAD_DUMMY_RETURN */ |
957 | @@ -463,9 +467,15 @@ | |||
958 | 463 | the aio array */ | 467 | the aio array */ |
959 | 464 | { | 468 | { |
960 | 465 | ulint segment; | 469 | ulint segment; |
961 | 470 | ulint tid_i = os_atomic_increment_ulint(&io_tid_i, 1) - 1; | ||
962 | 471 | |||
963 | 472 | ut_ad(tid_i < srv_n_file_io_threads); | ||
964 | 466 | 473 | ||
965 | 467 | segment = *((ulint*) arg); | 474 | segment = *((ulint*) arg); |
966 | 468 | 475 | ||
967 | 476 | srv_io_tids[tid_i] = os_thread_get_tid(); | ||
968 | 477 | os_thread_set_priority(srv_io_tids[tid_i], srv_sched_priority_io); | ||
969 | 478 | |||
970 | 469 | #ifdef UNIV_DEBUG_THREAD_CREATION | 479 | #ifdef UNIV_DEBUG_THREAD_CREATION |
971 | 470 | fprintf(stderr, "Io handler thread %lu starts, id %lu\n", segment, | 480 | fprintf(stderr, "Io handler thread %lu starts, id %lu\n", segment, |
972 | 471 | os_thread_pf(os_thread_get_curr_id())); | 481 | os_thread_pf(os_thread_get_curr_id())); |
LGTM from logical point of view.