1 # name : innodb_buffer_pool_shm.patch
3 # maintainer : Yasufumi
6 # Any small change to this file in the main branch
7 # should be done or reviewed by the maintainer!
8 diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
9 --- a/storage/innobase/buf/buf0buf.c 2011-04-09 18:48:47.000000000 +0400
10 +++ b/storage/innobase/buf/buf0buf.c 2011-04-09 18:48:48.000000000 +0400
11 @@ -1006,10 +1006,12 @@
17 /* Round down to a multiple of page size,
18 although it already should be. */
19 mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE);
20 + size_target = (mem_size / UNIV_PAGE_SIZE) - 1;
21 /* Reserve space for the block descriptors. */
22 mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block)
23 + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
24 @@ -1047,6 +1049,10 @@
28 + if (chunk->size > size_target) {
29 + chunk->size = size_target;
32 /* Init block structs and assign frames for them. Then we
33 assign the frames to the first blocks (we already mapped the
35 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
36 --- a/storage/innobase/handler/ha_innodb.cc 2011-04-09 18:48:47.000000000 +0400
37 +++ b/storage/innobase/handler/ha_innodb.cc 2011-04-09 18:48:48.000000000 +0400
39 static my_bool innobase_create_status_file = FALSE;
40 static my_bool innobase_stats_on_metadata = TRUE;
41 static my_bool innobase_use_sys_stats_table = FALSE;
42 +static my_bool innobase_buffer_pool_shm_checksum = TRUE;
43 +static uint innobase_buffer_pool_shm_key = 0;
46 static char* internal_innobase_data_file_path = NULL;
47 @@ -2670,6 +2672,12 @@
48 srv_buf_pool_size = (ulint) innobase_buffer_pool_size;
49 srv_buf_pool_instances = (ulint) innobase_buffer_pool_instances;
51 + if (innobase_buffer_pool_shm_key) {
53 + "InnoDB: Warning: innodb_buffer_pool_shm_key is deprecated function.\n"
54 + "InnoDB: innodb_buffer_pool_shm_key was ignored.\n");
57 srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
59 srv_n_file_io_threads = (ulint) innobase_file_io_threads;
60 @@ -11733,6 +11741,16 @@
61 "Number of buffer pool instances, set to higher value on high-end machines to increase scalability",
62 NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L);
64 +static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, innobase_buffer_pool_shm_key,
65 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
66 + "[Deprecated option] no effect",
67 + NULL, NULL, 0, 0, INT_MAX32, 0);
69 +static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum,
70 + PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
71 + "[Deprecated option] no effect",
74 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
76 "Helps in performance tuning in heavily concurrent environments.",
77 @@ -12027,6 +12045,8 @@
78 MYSQL_SYSVAR(autoextend_increment),
79 MYSQL_SYSVAR(buffer_pool_size),
80 MYSQL_SYSVAR(buffer_pool_instances),
81 + MYSQL_SYSVAR(buffer_pool_shm_key),
82 + MYSQL_SYSVAR(buffer_pool_shm_checksum),
83 MYSQL_SYSVAR(checksums),
84 MYSQL_SYSVAR(fast_checksum),
85 MYSQL_SYSVAR(commit_concurrency),