]>
Commit | Line | Data |
---|---|---|
b4e1fa2c AM |
1 | # name : innodb_buffer_pool_shm.patch |
2 | # introduced : 12 | |
3 | # maintainer : Yasufumi | |
4 | # | |
5 | #!!! notice !!! | |
6 | # Any small change to this file in the main branch | |
7 | # should be done or reviewed by the maintainer! | |
db82db79 AM |
8 | --- a/storage/innobase/buf/buf0buf.c |
9 | +++ b/storage/innobase/buf/buf0buf.c | |
1bfc1981 | 10 | @@ -1022,10 +1022,12 @@ |
b4e1fa2c AM |
11 | buf_block_t* block; |
12 | byte* frame; | |
b4e1fa2c | 13 | ulint i; |
a9ee80b9 | 14 | + ulint size_target; |
b4e1fa2c AM |
15 | |
16 | /* Round down to a multiple of page size, | |
17 | although it already should be. */ | |
18 | mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE); | |
a9ee80b9 | 19 | + size_target = (mem_size / UNIV_PAGE_SIZE) - 1; |
b4e1fa2c AM |
20 | /* Reserve space for the block descriptors. */ |
21 | mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block) | |
22 | + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE); | |
1bfc1981 | 23 | @@ -1063,6 +1065,10 @@ |
b4e1fa2c AM |
24 | chunk->size = size; |
25 | } | |
26 | ||
a9ee80b9 ER |
27 | + if (chunk->size > size_target) { |
28 | + chunk->size = size_target; | |
29 | + } | |
30 | + | |
b4e1fa2c AM |
31 | /* Init block structs and assign frames for them. Then we |
32 | assign the frames to the first blocks (we already mapped the | |
33 | memory above). */ | |
db82db79 AM |
34 | --- a/storage/innobase/handler/ha_innodb.cc |
35 | +++ b/storage/innobase/handler/ha_innodb.cc | |
36 | @@ -195,6 +195,8 @@ | |
b4e1fa2c | 37 | static my_bool innobase_stats_on_metadata = TRUE; |
db82db79 | 38 | static my_bool innobase_large_prefix = FALSE; |
b4e1fa2c AM |
39 | static my_bool innobase_use_sys_stats_table = FALSE; |
40 | +static my_bool innobase_buffer_pool_shm_checksum = TRUE; | |
adf0fb13 | 41 | +static uint innobase_buffer_pool_shm_key = 0; |
b4e1fa2c AM |
42 | |
43 | ||
44 | static char* internal_innobase_data_file_path = NULL; | |
734d6226 | 45 | @@ -2706,6 +2708,12 @@ |
b4e1fa2c AM |
46 | srv_buf_pool_size = (ulint) innobase_buffer_pool_size; |
47 | srv_buf_pool_instances = (ulint) innobase_buffer_pool_instances; | |
48 | ||
adf0fb13 | 49 | + if (innobase_buffer_pool_shm_key) { |
b4e1fa2c | 50 | + fprintf(stderr, |
adf0fb13 AM |
51 | + "InnoDB: Warning: innodb_buffer_pool_shm_key is deprecated function.\n" |
52 | + "InnoDB: innodb_buffer_pool_shm_key was ignored.\n"); | |
b4e1fa2c AM |
53 | + } |
54 | + | |
55 | srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size; | |
56 | ||
57 | srv_n_file_io_threads = (ulint) innobase_file_io_threads; | |
29ffd636 | 58 | @@ -11863,6 +11871,16 @@ |
b4e1fa2c AM |
59 | "Number of buffer pool instances, set to higher value on high-end machines to increase scalability", |
60 | NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L); | |
61 | ||
adf0fb13 | 62 | +static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, innobase_buffer_pool_shm_key, |
b4e1fa2c | 63 | + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, |
adf0fb13 | 64 | + "[Deprecated option] no effect", |
b4e1fa2c AM |
65 | + NULL, NULL, 0, 0, INT_MAX32, 0); |
66 | + | |
67 | +static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum, | |
68 | + PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, | |
adf0fb13 | 69 | + "[Deprecated option] no effect", |
b4e1fa2c AM |
70 | + NULL, NULL, TRUE); |
71 | + | |
72 | static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, | |
73 | PLUGIN_VAR_RQCMDARG, | |
74 | "Helps in performance tuning in heavily concurrent environments.", | |
29ffd636 | 75 | @@ -12209,6 +12227,8 @@ |
b4e1fa2c AM |
76 | MYSQL_SYSVAR(autoextend_increment), |
77 | MYSQL_SYSVAR(buffer_pool_size), | |
78 | MYSQL_SYSVAR(buffer_pool_instances), | |
79 | + MYSQL_SYSVAR(buffer_pool_shm_key), | |
80 | + MYSQL_SYSVAR(buffer_pool_shm_checksum), | |
81 | MYSQL_SYSVAR(checksums), | |
82 | MYSQL_SYSVAR(fast_checksum), | |
83 | MYSQL_SYSVAR(commit_concurrency), | |
48b678b4 AM |
84 | --- /dev/null |
85 | +++ b/mysql-test/r/percona_innodb_buffer_pool_shm.result | |
86 | @@ -0,0 +1,4 @@ | |
87 | +show variables like 'innodb_buffer_pool_shm%'; | |
88 | +Variable_name Value | |
89 | +innodb_buffer_pool_shm_checksum ON | |
90 | +innodb_buffer_pool_shm_key 123456 | |
91 | --- /dev/null | |
92 | +++ b/mysql-test/t/percona_innodb_buffer_pool_shm-master.opt | |
93 | @@ -0,0 +1 @@ | |
94 | +--innodb_buffer_pool_shm_key=123456 | |
95 | --- /dev/null | |
96 | +++ b/mysql-test/t/percona_innodb_buffer_pool_shm.test | |
97 | @@ -0,0 +1,2 @@ | |
98 | +--source include/have_innodb.inc | |
99 | +show variables like 'innodb_buffer_pool_shm%'; |