Merge lp:~akopytov/percona-server/i26611-bug1059812-5.5 into lp:percona-server/5.5
- i26611-bug1059812-5.5
- Merge into 5.5
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Laurynas Biveinis | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 330 | ||||
Proposed branch: | lp:~akopytov/percona-server/i26611-bug1059812-5.5 | ||||
Merge into: | lp:percona-server/5.5 | ||||
Diff against target: |
441 lines (+177/-10) 15 files modified
Percona-Server/mysql-test/r/percona_server_variables_debug.result (+1/-0) Percona-Server/mysql-test/r/percona_server_variables_release.result (+1/-0) Percona-Server/mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result (+12/-0) Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic-master.opt (+1/-0) Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test (+16/-0) Percona-Server/scripts/mysqld_safe.sh (+68/-0) Percona-Server/storage/innobase/buf/buf0buf.c (+7/-4) Percona-Server/storage/innobase/handler/ha_innodb.cc (+7/-0) Percona-Server/storage/innobase/include/buf0buf.h (+1/-0) Percona-Server/storage/innobase/include/os0proc.h (+2/-1) Percona-Server/storage/innobase/include/srv0srv.h (+1/-0) Percona-Server/storage/innobase/os/os0proc.c (+55/-3) Percona-Server/storage/innobase/row/row0merge.c (+1/-1) Percona-Server/storage/innobase/srv/srv0srv.c (+2/-0) Percona-Server/storage/innobase/srv/srv0start.c (+2/-1) |
||||
To merge this branch: | bzr merge lp:~akopytov/percona-server/i26611-bug1059812-5.5 | ||||
Related bugs: |
|
||||
Related blueprints: |
Import Twitter's MySQL Numa Patches
(Undefined)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Laurynas Biveinis (community) | Approve | ||
Davi Arnaut (community) | Needs Fixing | ||
Review via email:
|
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
Alexey -
It's really uncommon to see my_bool instead of ibool outside of handler/ and to lesser extent srv/. I would contain it to these two dirs by changing srv0start.c to
buf_pool_init (... srv_buf_
and making the rest of changes use ibool. I think that this horrible one line is still better than mixing bool types in the lower InnoDB subsystems.
The 2.6.23 version check is something I'd rather not see, but brief checking seems to show that this indeed the only way to find out if MAP_PRIVATE | MAP_POPULATE works :(
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeremy Cole (jeremycole) wrote : | # |
BTW, it seems that the get_time/set_time changes in sql/sp_head.cc and sql/sql_class.h are not related to the main bug being fixed here.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Davi Arnaut (davi) wrote : | # |
Should also take this bug fix: https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Merged the bug fix, thanks!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Davi Arnaut (davi) wrote : | # |
The my_bool/ibool cleanup suggestion is good, will take it.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Laurynas Biveinis (laurynas-biveinis) : | # |
Preview Diff
1 | === modified file 'Percona-Server/mysql-test/r/percona_server_variables_debug.result' | |||
2 | --- Percona-Server/mysql-test/r/percona_server_variables_debug.result 2012-10-12 06:24:13 +0000 | |||
3 | +++ Percona-Server/mysql-test/r/percona_server_variables_debug.result 2012-10-18 18:03:21 +0000 | |||
4 | @@ -88,6 +88,7 @@ | |||
5 | 88 | INNODB_AUTOINC_LOCK_MODE | 88 | INNODB_AUTOINC_LOCK_MODE |
6 | 89 | INNODB_BLOCKING_BUFFER_POOL_RESTORE | 89 | INNODB_BLOCKING_BUFFER_POOL_RESTORE |
7 | 90 | INNODB_BUFFER_POOL_INSTANCES | 90 | INNODB_BUFFER_POOL_INSTANCES |
8 | 91 | INNODB_BUFFER_POOL_POPULATE | ||
9 | 91 | INNODB_BUFFER_POOL_RESTORE_AT_STARTUP | 92 | INNODB_BUFFER_POOL_RESTORE_AT_STARTUP |
10 | 92 | INNODB_BUFFER_POOL_SHM_CHECKSUM | 93 | INNODB_BUFFER_POOL_SHM_CHECKSUM |
11 | 93 | INNODB_BUFFER_POOL_SHM_KEY | 94 | INNODB_BUFFER_POOL_SHM_KEY |
12 | 94 | 95 | ||
13 | === modified file 'Percona-Server/mysql-test/r/percona_server_variables_release.result' | |||
14 | --- Percona-Server/mysql-test/r/percona_server_variables_release.result 2012-09-28 01:36:45 +0000 | |||
15 | +++ Percona-Server/mysql-test/r/percona_server_variables_release.result 2012-10-18 18:03:21 +0000 | |||
16 | @@ -86,6 +86,7 @@ | |||
17 | 86 | INNODB_AUTOINC_LOCK_MODE | 86 | INNODB_AUTOINC_LOCK_MODE |
18 | 87 | INNODB_BLOCKING_BUFFER_POOL_RESTORE | 87 | INNODB_BLOCKING_BUFFER_POOL_RESTORE |
19 | 88 | INNODB_BUFFER_POOL_INSTANCES | 88 | INNODB_BUFFER_POOL_INSTANCES |
20 | 89 | INNODB_BUFFER_POOL_POPULATE | ||
21 | 89 | INNODB_BUFFER_POOL_RESTORE_AT_STARTUP | 90 | INNODB_BUFFER_POOL_RESTORE_AT_STARTUP |
22 | 90 | INNODB_BUFFER_POOL_SHM_CHECKSUM | 91 | INNODB_BUFFER_POOL_SHM_CHECKSUM |
23 | 91 | INNODB_BUFFER_POOL_SHM_KEY | 92 | INNODB_BUFFER_POOL_SHM_KEY |
24 | 92 | 93 | ||
25 | === added file 'Percona-Server/mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result' | |||
26 | --- Percona-Server/mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result 1970-01-01 00:00:00 +0000 | |||
27 | +++ Percona-Server/mysql-test/suite/sys_vars/r/innodb_buffer_pool_populate_basic.result 2012-10-18 18:03:21 +0000 | |||
28 | @@ -0,0 +1,12 @@ | |||
29 | 1 | CALL mtr.add_suppression(".* Forcing preallocation by faulting in pages."); | ||
30 | 2 | SELECT @@GLOBAL.innodb_buffer_pool_populate; | ||
31 | 3 | @@GLOBAL.innodb_buffer_pool_populate | ||
32 | 4 | 1 | ||
33 | 5 | 1 Expected | ||
34 | 6 | SET @@GLOBAL.innodb_buffer_pool_populate=0; | ||
35 | 7 | ERROR HY000: Variable 'innodb_buffer_pool_populate' is a read only variable | ||
36 | 8 | Expected error 'Read only variable' | ||
37 | 9 | SELECT @@GLOBAL.innodb_buffer_pool_populate; | ||
38 | 10 | @@GLOBAL.innodb_buffer_pool_populate | ||
39 | 11 | 1 | ||
40 | 12 | 1 Expected | ||
41 | 0 | 13 | ||
42 | === added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic-master.opt' | |||
43 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic-master.opt 1970-01-01 00:00:00 +0000 | |||
44 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic-master.opt 2012-10-18 18:03:21 +0000 | |||
45 | @@ -0,0 +1,1 @@ | |||
46 | 1 | --innodb-buffer-pool-populate=true | ||
47 | 0 | 2 | ||
48 | === added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test' | |||
49 | --- Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test 1970-01-01 00:00:00 +0000 | |||
50 | +++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_populate_basic.test 2012-10-18 18:03:21 +0000 | |||
51 | @@ -0,0 +1,16 @@ | |||
52 | 1 | --source include/have_innodb.inc | ||
53 | 2 | |||
54 | 3 | CALL mtr.add_suppression(".* Forcing preallocation by faulting in pages."); | ||
55 | 4 | |||
56 | 5 | # Display current value of innodb_use_sys_malloc | ||
57 | 6 | SELECT @@GLOBAL.innodb_buffer_pool_populate; | ||
58 | 7 | --echo 1 Expected | ||
59 | 8 | |||
60 | 9 | # Variable should be read-only | ||
61 | 10 | --error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
62 | 11 | SET @@GLOBAL.innodb_buffer_pool_populate=0; | ||
63 | 12 | --echo Expected error 'Read only variable' | ||
64 | 13 | |||
65 | 14 | SELECT @@GLOBAL.innodb_buffer_pool_populate; | ||
66 | 15 | --echo 1 Expected | ||
67 | 16 | |||
68 | 0 | 17 | ||
69 | === modified file 'Percona-Server/scripts/mysqld_safe.sh' | |||
70 | --- Percona-Server/scripts/mysqld_safe.sh 2011-11-10 13:46:51 +0000 | |||
71 | +++ Percona-Server/scripts/mysqld_safe.sh 2012-10-18 18:03:21 +0000 | |||
72 | @@ -17,6 +17,8 @@ | |||
73 | 17 | niceness=0 | 17 | niceness=0 |
74 | 18 | mysqld_ld_preload= | 18 | mysqld_ld_preload= |
75 | 19 | mysqld_ld_library_path= | 19 | mysqld_ld_library_path= |
76 | 20 | flush_caches=0 | ||
77 | 21 | numa_interleave=0 | ||
78 | 20 | 22 | ||
79 | 21 | # Initial logging status: error log is not open, and not using syslog | 23 | # Initial logging status: error log is not open, and not using syslog |
80 | 22 | logging=init | 24 | logging=init |
81 | @@ -60,6 +62,10 @@ | |||
82 | 60 | --syslog Log messages to syslog with 'logger' | 62 | --syslog Log messages to syslog with 'logger' |
83 | 61 | --skip-syslog Log messages to error log (default) | 63 | --skip-syslog Log messages to error log (default) |
84 | 62 | --syslog-tag=TAG Pass -t "mysqld-TAG" to 'logger' | 64 | --syslog-tag=TAG Pass -t "mysqld-TAG" to 'logger' |
85 | 65 | --flush-caches Flush and purge buffers/caches before | ||
86 | 66 | starting the server | ||
87 | 67 | --numa-interleave Run mysqld with its memory interleaved | ||
88 | 68 | on all NUMA nodes | ||
89 | 63 | 69 | ||
90 | 64 | All other options are passed to the mysqld program. | 70 | All other options are passed to the mysqld program. |
91 | 65 | 71 | ||
92 | @@ -205,6 +211,8 @@ | |||
93 | 205 | --skip-syslog) want_syslog=0 ;; | 211 | --skip-syslog) want_syslog=0 ;; |
94 | 206 | --syslog-tag=*) syslog_tag="$val" ;; | 212 | --syslog-tag=*) syslog_tag="$val" ;; |
95 | 207 | --timezone=*) TZ="$val"; export TZ; ;; | 213 | --timezone=*) TZ="$val"; export TZ; ;; |
96 | 214 | --flush-caches) flush_caches=1 ;; | ||
97 | 215 | --numa-interleave) numa_interleave=1 ;; | ||
98 | 208 | 216 | ||
99 | 209 | --help) usage ;; | 217 | --help) usage ;; |
100 | 210 | 218 | ||
101 | @@ -711,6 +719,41 @@ | |||
102 | 711 | fi | 719 | fi |
103 | 712 | 720 | ||
104 | 713 | # | 721 | # |
105 | 722 | # Flush and purge buffers/caches. | ||
106 | 723 | # | ||
107 | 724 | |||
108 | 725 | if @TARGET_LINUX@ && test $flush_caches -eq 1 | ||
109 | 726 | then | ||
110 | 727 | # Locate sync, ensure it exists. | ||
111 | 728 | if ! my_which sync > /dev/null 2>&1 | ||
112 | 729 | then | ||
113 | 730 | log_error "sync command not found, required for --flush-caches" | ||
114 | 731 | exit 1 | ||
115 | 732 | # Flush file system buffers. | ||
116 | 733 | elif ! sync | ||
117 | 734 | then | ||
118 | 735 | # Huh, the sync() function is always successful... | ||
119 | 736 | log_error "sync failed, check if sync is properly installed" | ||
120 | 737 | fi | ||
121 | 738 | |||
122 | 739 | # Locate sysctl, ensure it exists. | ||
123 | 740 | if ! my_which sysctl > /dev/null 2>&1 | ||
124 | 741 | then | ||
125 | 742 | log_error "sysctl command not found, required for --flush-caches" | ||
126 | 743 | exit 1 | ||
127 | 744 | # Purge page cache, dentries and inodes. | ||
128 | 745 | elif ! sysctl -q -w vm.drop_caches=3 | ||
129 | 746 | then | ||
130 | 747 | log_error "sysctl failed, check the error message for details" | ||
131 | 748 | exit 1 | ||
132 | 749 | fi | ||
133 | 750 | elif test $flush_caches -eq 1 | ||
134 | 751 | then | ||
135 | 752 | log_error "--flush-caches is not supported on this platform" | ||
136 | 753 | exit 1 | ||
137 | 754 | fi | ||
138 | 755 | |||
139 | 756 | # | ||
140 | 714 | # Uncomment the following lines if you want all tables to be automatically | 757 | # Uncomment the following lines if you want all tables to be automatically |
141 | 715 | # checked and repaired during startup. You should add sensible key_buffer | 758 | # checked and repaired during startup. You should add sensible key_buffer |
142 | 716 | # and sort_buffer values to my.cnf to improve check performance or require | 759 | # and sort_buffer values to my.cnf to improve check performance or require |
143 | @@ -730,6 +773,31 @@ | |||
144 | 730 | 773 | ||
145 | 731 | cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" | 774 | cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" |
146 | 732 | 775 | ||
147 | 776 | # | ||
148 | 777 | # Set mysqld's memory interleave policy. | ||
149 | 778 | # | ||
150 | 779 | |||
151 | 780 | if @TARGET_LINUX@ && test $numa_interleave -eq 1 | ||
152 | 781 | then | ||
153 | 782 | # Locate numactl, ensure it exists. | ||
154 | 783 | if ! my_which numactl > /dev/null 2>&1 | ||
155 | 784 | then | ||
156 | 785 | log_error "numactl command not found, required for --numa-interleave" | ||
157 | 786 | exit 1 | ||
158 | 787 | # Attempt to run a command, ensure it works. | ||
159 | 788 | elif ! numactl --interleave=all true | ||
160 | 789 | then | ||
161 | 790 | log_error "numactl failed, check if numactl is properly installed" | ||
162 | 791 | fi | ||
163 | 792 | |||
164 | 793 | # Launch mysqld with numactl. | ||
165 | 794 | cmd="$cmd numactl --interleave=all" | ||
166 | 795 | elif test $numa_interleave -eq 1 | ||
167 | 796 | then | ||
168 | 797 | log_error "--numa-interleave is not supported on this platform" | ||
169 | 798 | exit 1 | ||
170 | 799 | fi | ||
171 | 800 | |||
172 | 733 | for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ | 801 | for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ |
173 | 734 | "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" | 802 | "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" |
174 | 735 | do | 803 | do |
175 | 736 | 804 | ||
176 | === modified file 'Percona-Server/storage/innobase/buf/buf0buf.c' | |||
177 | --- Percona-Server/storage/innobase/buf/buf0buf.c 2012-10-12 06:24:13 +0000 | |||
178 | +++ Percona-Server/storage/innobase/buf/buf0buf.c 2012-10-18 18:03:21 +0000 | |||
179 | @@ -1028,7 +1028,8 @@ | |||
180 | 1028 | /*===========*/ | 1028 | /*===========*/ |
181 | 1029 | buf_pool_t* buf_pool, /*!< in: buffer pool instance */ | 1029 | buf_pool_t* buf_pool, /*!< in: buffer pool instance */ |
182 | 1030 | buf_chunk_t* chunk, /*!< out: chunk of buffers */ | 1030 | buf_chunk_t* chunk, /*!< out: chunk of buffers */ |
184 | 1031 | ulint mem_size) /*!< in: requested size in bytes */ | 1031 | ulint mem_size, /*!< in: requested size in bytes */ |
185 | 1032 | ibool populate) /*!< in: virtual page preallocation */ | ||
186 | 1032 | { | 1033 | { |
187 | 1033 | buf_block_t* block; | 1034 | buf_block_t* block; |
188 | 1034 | byte* frame; | 1035 | byte* frame; |
189 | @@ -1044,7 +1045,7 @@ | |||
190 | 1044 | + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE); | 1045 | + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE); |
191 | 1045 | 1046 | ||
192 | 1046 | chunk->mem_size = mem_size; | 1047 | chunk->mem_size = mem_size; |
194 | 1047 | chunk->mem = os_mem_alloc_large(&chunk->mem_size); | 1048 | chunk->mem = os_mem_alloc_large(&chunk->mem_size, populate); |
195 | 1048 | 1049 | ||
196 | 1049 | if (UNIV_UNLIKELY(chunk->mem == NULL)) { | 1050 | if (UNIV_UNLIKELY(chunk->mem == NULL)) { |
197 | 1050 | 1051 | ||
198 | @@ -1254,6 +1255,7 @@ | |||
199 | 1254 | /*===================*/ | 1255 | /*===================*/ |
200 | 1255 | buf_pool_t* buf_pool, /*!< in: buffer pool instance */ | 1256 | buf_pool_t* buf_pool, /*!< in: buffer pool instance */ |
201 | 1256 | ulint buf_pool_size, /*!< in: size in bytes */ | 1257 | ulint buf_pool_size, /*!< in: size in bytes */ |
202 | 1258 | ibool populate, /*!< in: virtual page preallocation */ | ||
203 | 1257 | ulint instance_no) /*!< in: id of the instance */ | 1259 | ulint instance_no) /*!< in: id of the instance */ |
204 | 1258 | { | 1260 | { |
205 | 1259 | ulint i; | 1261 | ulint i; |
206 | @@ -1286,7 +1288,7 @@ | |||
207 | 1286 | 1288 | ||
208 | 1287 | UT_LIST_INIT(buf_pool->free); | 1289 | UT_LIST_INIT(buf_pool->free); |
209 | 1288 | 1290 | ||
211 | 1289 | if (!buf_chunk_init(buf_pool, chunk, buf_pool_size)) { | 1291 | if (!buf_chunk_init(buf_pool, chunk, buf_pool_size, populate)) { |
212 | 1290 | mem_free(chunk); | 1292 | mem_free(chunk); |
213 | 1291 | mem_free(buf_pool); | 1293 | mem_free(buf_pool); |
214 | 1292 | 1294 | ||
215 | @@ -1381,6 +1383,7 @@ | |||
216 | 1381 | buf_pool_init( | 1383 | buf_pool_init( |
217 | 1382 | /*==========*/ | 1384 | /*==========*/ |
218 | 1383 | ulint total_size, /*!< in: size of the total pool in bytes */ | 1385 | ulint total_size, /*!< in: size of the total pool in bytes */ |
219 | 1386 | ibool populate, /*!< in: virtual page preallocation */ | ||
220 | 1384 | ulint n_instances) /*!< in: number of instances */ | 1387 | ulint n_instances) /*!< in: number of instances */ |
221 | 1385 | { | 1388 | { |
222 | 1386 | ulint i; | 1389 | ulint i; |
223 | @@ -1398,7 +1401,7 @@ | |||
224 | 1398 | for (i = 0; i < n_instances; i++) { | 1401 | for (i = 0; i < n_instances; i++) { |
225 | 1399 | buf_pool_t* ptr = &buf_pool_ptr[i]; | 1402 | buf_pool_t* ptr = &buf_pool_ptr[i]; |
226 | 1400 | 1403 | ||
228 | 1401 | if (buf_pool_init_instance(ptr, size, i) != DB_SUCCESS) { | 1404 | if (buf_pool_init_instance(ptr, size, populate, i) != DB_SUCCESS) { |
229 | 1402 | 1405 | ||
230 | 1403 | /* Free all the instances created so far. */ | 1406 | /* Free all the instances created so far. */ |
231 | 1404 | buf_pool_free(i); | 1407 | buf_pool_free(i); |
232 | 1405 | 1408 | ||
233 | === modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc' | |||
234 | --- Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-10-01 00:49:13 +0000 | |||
235 | +++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-10-18 18:03:21 +0000 | |||
236 | @@ -12494,6 +12494,12 @@ | |||
237 | 12494 | "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", | 12494 | "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", |
238 | 12495 | NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L); | 12495 | NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L); |
239 | 12496 | 12496 | ||
240 | 12497 | static MYSQL_SYSVAR_BOOL(buffer_pool_populate, srv_buf_pool_populate, | ||
241 | 12498 | PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, | ||
242 | 12499 | "Preallocate (pre-fault) the page frames required for the mapping " | ||
243 | 12500 | "established by the buffer pool memory region. Disabled by default.", | ||
244 | 12501 | NULL, NULL, FALSE); | ||
245 | 12502 | |||
246 | 12497 | static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances, | 12503 | static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances, |
247 | 12498 | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, | 12504 | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, |
248 | 12499 | "Number of buffer pool instances, set to higher value on high-end machines to increase scalability", | 12505 | "Number of buffer pool instances, set to higher value on high-end machines to increase scalability", |
249 | @@ -12874,6 +12880,7 @@ | |||
250 | 12874 | MYSQL_SYSVAR(additional_mem_pool_size), | 12880 | MYSQL_SYSVAR(additional_mem_pool_size), |
251 | 12875 | MYSQL_SYSVAR(autoextend_increment), | 12881 | MYSQL_SYSVAR(autoextend_increment), |
252 | 12876 | MYSQL_SYSVAR(buffer_pool_size), | 12882 | MYSQL_SYSVAR(buffer_pool_size), |
253 | 12883 | MYSQL_SYSVAR(buffer_pool_populate), | ||
254 | 12877 | MYSQL_SYSVAR(buffer_pool_instances), | 12884 | MYSQL_SYSVAR(buffer_pool_instances), |
255 | 12878 | MYSQL_SYSVAR(buffer_pool_shm_key), | 12885 | MYSQL_SYSVAR(buffer_pool_shm_key), |
256 | 12879 | MYSQL_SYSVAR(buffer_pool_shm_checksum), | 12886 | MYSQL_SYSVAR(buffer_pool_shm_checksum), |
257 | 12880 | 12887 | ||
258 | === modified file 'Percona-Server/storage/innobase/include/buf0buf.h' | |||
259 | --- Percona-Server/storage/innobase/include/buf0buf.h 2012-08-07 06:10:00 +0000 | |||
260 | +++ Percona-Server/storage/innobase/include/buf0buf.h 2012-10-18 18:03:21 +0000 | |||
261 | @@ -233,6 +233,7 @@ | |||
262 | 233 | buf_pool_init( | 233 | buf_pool_init( |
263 | 234 | /*=========*/ | 234 | /*=========*/ |
264 | 235 | ulint size, /*!< in: Size of the total pool in bytes */ | 235 | ulint size, /*!< in: Size of the total pool in bytes */ |
265 | 236 | ibool populate, /*!< in: Force virtual page preallocation */ | ||
266 | 236 | ulint n_instances); /*!< in: Number of instances */ | 237 | ulint n_instances); /*!< in: Number of instances */ |
267 | 237 | /********************************************************************//** | 238 | /********************************************************************//** |
268 | 238 | Frees the buffer pool at shutdown. This must not be invoked before | 239 | Frees the buffer pool at shutdown. This must not be invoked before |
269 | 239 | 240 | ||
270 | === modified file 'Percona-Server/storage/innobase/include/os0proc.h' | |||
271 | --- Percona-Server/storage/innobase/include/os0proc.h 2010-06-22 15:58:28 +0000 | |||
272 | +++ Percona-Server/storage/innobase/include/os0proc.h 2012-10-18 18:03:21 +0000 | |||
273 | @@ -58,7 +58,8 @@ | |||
274 | 58 | void* | 58 | void* |
275 | 59 | os_mem_alloc_large( | 59 | os_mem_alloc_large( |
276 | 60 | /*===============*/ | 60 | /*===============*/ |
278 | 61 | ulint* n); /*!< in/out: number of bytes */ | 61 | ulint* n, /*!< in/out: number of bytes */ |
279 | 62 | ibool populate); /*!< in: virtual page preallocation */ | ||
280 | 62 | /****************************************************************//** | 63 | /****************************************************************//** |
281 | 63 | Frees large pages memory. */ | 64 | Frees large pages memory. */ |
282 | 64 | UNIV_INTERN | 65 | UNIV_INTERN |
283 | 65 | 66 | ||
284 | === modified file 'Percona-Server/storage/innobase/include/srv0srv.h' | |||
285 | --- Percona-Server/storage/innobase/include/srv0srv.h 2012-09-28 07:53:51 +0000 | |||
286 | +++ Percona-Server/storage/innobase/include/srv0srv.h 2012-10-18 18:03:21 +0000 | |||
287 | @@ -179,6 +179,7 @@ | |||
288 | 179 | extern ibool srv_use_sys_malloc; | 179 | extern ibool srv_use_sys_malloc; |
289 | 180 | #endif /* UNIV_HOTBACKUP */ | 180 | #endif /* UNIV_HOTBACKUP */ |
290 | 181 | extern ulint srv_buf_pool_size; /*!< requested size in bytes */ | 181 | extern ulint srv_buf_pool_size; /*!< requested size in bytes */ |
291 | 182 | extern my_bool srv_buf_pool_populate; /*!< virtual page preallocation */ | ||
292 | 182 | extern ulint srv_buf_pool_instances; /*!< requested number of buffer pool instances */ | 183 | extern ulint srv_buf_pool_instances; /*!< requested number of buffer pool instances */ |
293 | 183 | extern ulint srv_buf_pool_old_size; /*!< previously requested size */ | 184 | extern ulint srv_buf_pool_old_size; /*!< previously requested size */ |
294 | 184 | extern ulint srv_buf_pool_curr_size; /*!< current size in bytes */ | 185 | extern ulint srv_buf_pool_curr_size; /*!< current size in bytes */ |
295 | 185 | 186 | ||
296 | === modified file 'Percona-Server/storage/innobase/os/os0proc.c' | |||
297 | --- Percona-Server/storage/innobase/os/os0proc.c 2011-12-28 10:31:18 +0000 | |||
298 | +++ Percona-Server/storage/innobase/os/os0proc.c 2012-10-18 18:03:21 +0000 | |||
299 | @@ -32,6 +32,12 @@ | |||
300 | 32 | #include "ut0mem.h" | 32 | #include "ut0mem.h" |
301 | 33 | #include "ut0byte.h" | 33 | #include "ut0byte.h" |
302 | 34 | 34 | ||
303 | 35 | /* Linux release version */ | ||
304 | 36 | #if defined(UNIV_LINUX) && defined(_GNU_SOURCE) | ||
305 | 37 | #include <string.h> /* strverscmp() */ | ||
306 | 38 | #include <sys/utsname.h> /* uname() */ | ||
307 | 39 | #endif | ||
308 | 40 | |||
309 | 35 | /* FreeBSD for example has only MAP_ANON, Linux has MAP_ANONYMOUS and | 41 | /* FreeBSD for example has only MAP_ANON, Linux has MAP_ANONYMOUS and |
310 | 36 | MAP_ANON but MAP_ANON is marked as deprecated */ | 42 | MAP_ANON but MAP_ANON is marked as deprecated */ |
311 | 37 | #if defined(MAP_ANONYMOUS) | 43 | #if defined(MAP_ANONYMOUS) |
312 | @@ -40,6 +46,13 @@ | |||
313 | 40 | #define OS_MAP_ANON MAP_ANON | 46 | #define OS_MAP_ANON MAP_ANON |
314 | 41 | #endif | 47 | #endif |
315 | 42 | 48 | ||
316 | 49 | /* Linux's MAP_POPULATE */ | ||
317 | 50 | #if defined(MAP_POPULATE) | ||
318 | 51 | #define OS_MAP_POPULATE MAP_POPULATE | ||
319 | 52 | #else | ||
320 | 53 | #define OS_MAP_POPULATE 0 | ||
321 | 54 | #endif | ||
322 | 55 | |||
323 | 43 | UNIV_INTERN ibool os_use_large_pages; | 56 | UNIV_INTERN ibool os_use_large_pages; |
324 | 44 | /* Large page size. This may be a boot-time option on some platforms */ | 57 | /* Large page size. This may be a boot-time option on some platforms */ |
325 | 45 | UNIV_INTERN ulint os_large_page_size; | 58 | UNIV_INTERN ulint os_large_page_size; |
326 | @@ -63,13 +76,32 @@ | |||
327 | 63 | } | 76 | } |
328 | 64 | 77 | ||
329 | 65 | /****************************************************************//** | 78 | /****************************************************************//** |
330 | 79 | Retrieve and compare operating system release. | ||
331 | 80 | @return TRUE if the OS release is equal to, or later than release. */ | ||
332 | 81 | UNIV_INTERN | ||
333 | 82 | ibool | ||
334 | 83 | os_compare_release( | ||
335 | 84 | /*===============*/ | ||
336 | 85 | const char* release /*!< in: OS release */ | ||
337 | 86 | __attribute__((unused))) | ||
338 | 87 | { | ||
339 | 88 | #if defined(UNIV_LINUX) && defined(_GNU_SOURCE) | ||
340 | 89 | struct utsname name; | ||
341 | 90 | return uname(&name) == 0 && strverscmp(name.release, release) >= 0; | ||
342 | 91 | #else | ||
343 | 92 | return 0; | ||
344 | 93 | #endif | ||
345 | 94 | } | ||
346 | 95 | |||
347 | 96 | /****************************************************************//** | ||
348 | 66 | Allocates large pages memory. | 97 | Allocates large pages memory. |
349 | 67 | @return allocated memory */ | 98 | @return allocated memory */ |
350 | 68 | UNIV_INTERN | 99 | UNIV_INTERN |
351 | 69 | void* | 100 | void* |
352 | 70 | os_mem_alloc_large( | 101 | os_mem_alloc_large( |
353 | 71 | /*===============*/ | 102 | /*===============*/ |
355 | 72 | ulint* n) /*!< in/out: number of bytes */ | 103 | ulint* n, /*!< in/out: number of bytes */ |
356 | 104 | ibool populate) /*!< in: virtual page preallocation */ | ||
357 | 73 | { | 105 | { |
358 | 74 | void* ptr; | 106 | void* ptr; |
359 | 75 | ulint size; | 107 | ulint size; |
360 | @@ -155,12 +187,13 @@ | |||
361 | 155 | ut_ad(ut_is_2pow(size)); | 187 | ut_ad(ut_is_2pow(size)); |
362 | 156 | size = *n = ut_2pow_round(*n + (size - 1), size); | 188 | size = *n = ut_2pow_round(*n + (size - 1), size); |
363 | 157 | ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, | 189 | ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, |
365 | 158 | MAP_PRIVATE | OS_MAP_ANON, -1, 0); | 190 | MAP_PRIVATE | OS_MAP_ANON | |
366 | 191 | (populate ? OS_MAP_POPULATE : 0), -1, 0); | ||
367 | 159 | if (UNIV_UNLIKELY(ptr == (void*) -1)) { | 192 | if (UNIV_UNLIKELY(ptr == (void*) -1)) { |
368 | 160 | fprintf(stderr, "InnoDB: mmap(%lu bytes) failed;" | 193 | fprintf(stderr, "InnoDB: mmap(%lu bytes) failed;" |
369 | 161 | " errno %lu\n", | 194 | " errno %lu\n", |
370 | 162 | (ulong) size, (ulong) errno); | 195 | (ulong) size, (ulong) errno); |
372 | 163 | ptr = NULL; | 196 | return(NULL); |
373 | 164 | } else { | 197 | } else { |
374 | 165 | os_fast_mutex_lock(&ut_list_mutex); | 198 | os_fast_mutex_lock(&ut_list_mutex); |
375 | 166 | ut_total_allocated_memory += size; | 199 | ut_total_allocated_memory += size; |
376 | @@ -168,6 +201,25 @@ | |||
377 | 168 | UNIV_MEM_ALLOC(ptr, size); | 201 | UNIV_MEM_ALLOC(ptr, size); |
378 | 169 | } | 202 | } |
379 | 170 | #endif | 203 | #endif |
380 | 204 | |||
381 | 205 | #if OS_MAP_ANON && OS_MAP_POPULATE | ||
382 | 206 | /* MAP_POPULATE is only supported for private mappings | ||
383 | 207 | since Linux 2.6.23. */ | ||
384 | 208 | populate = populate && !os_compare_release("2.6.23"); | ||
385 | 209 | |||
386 | 210 | if (populate) { | ||
387 | 211 | fprintf(stderr, "InnoDB: Warning: mmap(MAP_POPULATE) " | ||
388 | 212 | "is not supported for private mappings. " | ||
389 | 213 | "Forcing preallocation by faulting in pages.\n"); | ||
390 | 214 | } | ||
391 | 215 | #endif | ||
392 | 216 | |||
393 | 217 | /* Initialize the entire buffer to force the allocation | ||
394 | 218 | of physical memory page frames. */ | ||
395 | 219 | if (populate) { | ||
396 | 220 | memset(ptr, '\0', size); | ||
397 | 221 | } | ||
398 | 222 | |||
399 | 171 | return(ptr); | 223 | return(ptr); |
400 | 172 | } | 224 | } |
401 | 173 | 225 | ||
402 | 174 | 226 | ||
403 | === modified file 'Percona-Server/storage/innobase/row/row0merge.c' | |||
404 | --- Percona-Server/storage/innobase/row/row0merge.c 2012-07-13 11:34:09 +0000 | |||
405 | +++ Percona-Server/storage/innobase/row/row0merge.c 2012-10-18 18:03:21 +0000 | |||
406 | @@ -2720,7 +2720,7 @@ | |||
407 | 2720 | 2720 | ||
408 | 2721 | merge_files = mem_alloc(n_indexes * sizeof *merge_files); | 2721 | merge_files = mem_alloc(n_indexes * sizeof *merge_files); |
409 | 2722 | block_size = 3 * merge_sort_block_size; | 2722 | block_size = 3 * merge_sort_block_size; |
411 | 2723 | block_mem = os_mem_alloc_large(&block_size); | 2723 | block_mem = os_mem_alloc_large(&block_size, FALSE); |
412 | 2724 | 2724 | ||
413 | 2725 | for (i = 0; i < UT_ARR_SIZE(block); i++) { | 2725 | for (i = 0; i < UT_ARR_SIZE(block); i++) { |
414 | 2726 | block[i] = (row_merge_block_t ) ((byte *) block_mem + | 2726 | block[i] = (row_merge_block_t ) ((byte *) block_mem + |
415 | 2727 | 2727 | ||
416 | === modified file 'Percona-Server/storage/innobase/srv/srv0srv.c' | |||
417 | --- Percona-Server/storage/innobase/srv/srv0srv.c 2012-09-28 07:53:51 +0000 | |||
418 | +++ Percona-Server/storage/innobase/srv/srv0srv.c 2012-10-18 18:03:21 +0000 | |||
419 | @@ -232,6 +232,8 @@ | |||
420 | 232 | UNIV_INTERN my_bool srv_use_sys_malloc = TRUE; | 232 | UNIV_INTERN my_bool srv_use_sys_malloc = TRUE; |
421 | 233 | /* requested size in kilobytes */ | 233 | /* requested size in kilobytes */ |
422 | 234 | UNIV_INTERN ulint srv_buf_pool_size = ULINT_MAX; | 234 | UNIV_INTERN ulint srv_buf_pool_size = ULINT_MAX; |
423 | 235 | /* force virtual page preallocation (prefault) */ | ||
424 | 236 | UNIV_INTERN my_bool srv_buf_pool_populate = FALSE; | ||
425 | 235 | /* requested number of buffer pool instances */ | 237 | /* requested number of buffer pool instances */ |
426 | 236 | UNIV_INTERN ulint srv_buf_pool_instances = 1; | 238 | UNIV_INTERN ulint srv_buf_pool_instances = 1; |
427 | 237 | /* previously requested size */ | 239 | /* previously requested size */ |
428 | 238 | 240 | ||
429 | === modified file 'Percona-Server/storage/innobase/srv/srv0start.c' | |||
430 | --- Percona-Server/storage/innobase/srv/srv0start.c 2012-09-28 07:53:51 +0000 | |||
431 | +++ Percona-Server/storage/innobase/srv/srv0start.c 2012-10-18 18:03:21 +0000 | |||
432 | @@ -1540,7 +1540,8 @@ | |||
433 | 1540 | ((double) srv_buf_pool_size) / (1024 * 1024)); | 1540 | ((double) srv_buf_pool_size) / (1024 * 1024)); |
434 | 1541 | } | 1541 | } |
435 | 1542 | 1542 | ||
437 | 1543 | err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances); | 1543 | err = buf_pool_init(srv_buf_pool_size, (ibool) srv_buf_pool_populate, |
438 | 1544 | srv_buf_pool_instances); | ||
439 | 1544 | 1545 | ||
440 | 1545 | ut_print_timestamp(stderr); | 1546 | ut_print_timestamp(stderr); |
441 | 1546 | fprintf(stderr, | 1547 | fprintf(stderr, |
http:// jenkins. percona. com/view/ PS%205. 5/job/percona- server- 5.5-param/ 558/