1 diff -ruN mysql-5.0.67_highperf/innobase/buf/buf0buf.c mysql-5.0.67_highperf_tmp/innobase/buf/buf0buf.c
2 --- mysql-5.0.67_highperf/innobase/buf/buf0buf.c 2008-11-12 09:25:58.000000000 +0900
3 +++ mysql-5.0.67_highperf_tmp/innobase/buf/buf0buf.c 2008-11-12 09:27:52.000000000 +0900
4 @@ -2454,13 +2454,15 @@
5 (ulong) UT_LIST_GET_LEN(buf_pool->awe_LRU_free_mapped));
8 - "Buffer pool size %lu\n"
10 - "Database pages %lu\n"
11 - "Modified db pages %lu\n"
12 + "Buffer pool size %lu\n"
13 + "Buffer pool size, bytes %lu\n"
14 + "Free buffers %lu\n"
15 + "Database pages %lu\n"
16 + "Modified db pages %lu\n"
18 "Pending writes: LRU %lu, flush list %lu, single page %lu\n",
20 + (ulong) size * UNIV_PAGE_SIZE,
21 (ulong) UT_LIST_GET_LEN(buf_pool->free),
22 (ulong) UT_LIST_GET_LEN(buf_pool->LRU),
23 (ulong) UT_LIST_GET_LEN(buf_pool->flush_list),
24 diff -ruN mysql-5.0.67_highperf/innobase/fil/fil0fil.c mysql-5.0.67_highperf_tmp/innobase/fil/fil0fil.c
25 --- mysql-5.0.67_highperf/innobase/fil/fil0fil.c 2008-11-12 09:26:07.000000000 +0900
26 +++ mysql-5.0.67_highperf_tmp/innobase/fil/fil0fil.c 2008-11-12 09:27:52.000000000 +0900
27 @@ -4472,3 +4472,30 @@
29 return(mach_read_from_2(page + FIL_PAGE_TYPE));
32 +/*************************************************************************
33 +Return local hash table informations. */
36 +fil_system_hash_cells(void)
37 +/*=======================*/
40 + return (fil_system->spaces->n_cells
41 + + fil_system->name_hash->n_cells);
48 +fil_system_hash_nodes(void)
49 +/*=======================*/
52 + return (UT_LIST_GET_LEN(fil_system->space_list)
53 + * (sizeof(fil_space_t) + MEM_BLOCK_HEADER_SIZE));
58 diff -ruN mysql-5.0.67_highperf/innobase/include/fil0fil.h mysql-5.0.67_highperf_tmp/innobase/include/fil0fil.h
59 --- mysql-5.0.67_highperf/innobase/include/fil0fil.h 2008-11-12 09:26:07.000000000 +0900
60 +++ mysql-5.0.67_highperf_tmp/innobase/include/fil0fil.h 2008-11-12 09:27:52.000000000 +0900
62 written to page, the return value not defined */
63 byte* page); /* in: file page */
65 +/*************************************************************************
66 +Return local hash table informations. */
69 +fil_system_hash_cells(void);
70 +/*========================*/
73 +fil_system_hash_nodes(void);
74 +/*========================*/
76 typedef struct fil_space_struct fil_space_t;
78 diff -ruN mysql-5.0.67_highperf/innobase/include/thr0loc.h mysql-5.0.67_highperf_tmp/innobase/include/thr0loc.h
79 --- mysql-5.0.67_highperf/innobase/include/thr0loc.h 2008-11-12 09:24:58.000000000 +0900
80 +++ mysql-5.0.67_highperf_tmp/innobase/include/thr0loc.h 2008-11-12 09:27:52.000000000 +0900
82 /*=============================*/
83 /* out: pointer to the in_ibuf field */
85 +/*************************************************************************
86 +Return local hash table informations. */
89 +thr_local_hash_cells(void);
90 +/*=======================*/
93 +thr_local_hash_nodes(void);
94 +/*=======================*/
99 diff -ruN mysql-5.0.67_highperf/innobase/srv/srv0srv.c mysql-5.0.67_highperf_tmp/innobase/srv/srv0srv.c
100 --- mysql-5.0.67_highperf/innobase/srv/srv0srv.c 2008-11-12 09:26:07.000000000 +0900
101 +++ mysql-5.0.67_highperf_tmp/innobase/srv/srv0srv.c 2008-11-12 09:54:19.000000000 +0900
102 @@ -1645,6 +1645,14 @@
106 + ulint btr_search_sys_subtotal;
107 + ulint lock_sys_subtotal;
108 + ulint recv_sys_subtotal;
109 + ulint io_counter_subtotal;
114 mutex_enter(&srv_innodb_monitor_mutex);
116 current_time = time(NULL);
117 @@ -1747,6 +1755,91 @@
118 ut_total_allocated_memory,
119 mem_pool_get_reserved(mem_comm_pool));
121 + /* Calcurate reserved memories */
122 + if (btr_search_sys && btr_search_sys->hash_index->heap) {
123 + btr_search_sys_subtotal = mem_heap_get_size(btr_search_sys->hash_index->heap);
125 + btr_search_sys_subtotal = 0;
126 + for (i=0; i < btr_search_sys->hash_index->n_mutexes; i++) {
127 + btr_search_sys_subtotal += mem_heap_get_size(btr_search_sys->hash_index->heaps[i]);
131 + lock_sys_subtotal = 0;
133 + mutex_enter(&kernel_mutex);
134 + trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
136 + lock_sys_subtotal += ((trx->lock_heap) ? mem_heap_get_size(trx->lock_heap) : 0);
137 + trx = UT_LIST_GET_NEXT(mysql_trx_list, trx);
139 + mutex_exit(&kernel_mutex);
142 + recv_sys_subtotal = ((recv_sys && recv_sys->addr_hash)
143 + ? mem_heap_get_size(recv_sys->heap) : 0);
145 + io_counter_subtotal = ((buf_pool->io_counter_heap)
146 + ? mem_heap_get_size(buf_pool->io_counter_heap) : 0);
149 + "Internal hash tables (constant factor + variable factor)\n"
150 + " Adaptive hash index %lu \t(%lu + %lu)\n"
152 + " Dictionary cache %lu \t(%lu + %lu)\n"
153 + " File system %lu \t(%lu + %lu)\n"
154 + " Lock system %lu \t(%lu + %lu)\n"
155 + " Recovery system %lu \t(%lu + %lu)\n"
156 + " Threads %lu \t(%lu + %lu)\n"
157 + " innodb_io_pattern %lu \t(%lu + %lu)\n",
159 + (ulong) (btr_search_sys
160 + ? (btr_search_sys->hash_index->n_cells * sizeof(hash_cell_t)) : 0)
161 + + btr_search_sys_subtotal,
162 + (ulong) (btr_search_sys
163 + ? (btr_search_sys->hash_index->n_cells * sizeof(hash_cell_t)) : 0),
164 + (ulong) btr_search_sys_subtotal,
166 + (ulong) (buf_pool->page_hash->n_cells * sizeof(hash_cell_t)),
168 + (ulong) (dict_sys ? ((dict_sys->table_hash->n_cells
169 + + dict_sys->table_id_hash->n_cells
170 + + dict_sys->col_hash->n_cells) * sizeof(hash_cell_t)
171 + + dict_sys->size) : 0),
172 + (ulong) (dict_sys ? ((dict_sys->table_hash->n_cells
173 + + dict_sys->table_id_hash->n_cells
174 + + dict_sys->col_hash->n_cells) * sizeof(hash_cell_t)) : 0),
175 + (ulong) (dict_sys ? (dict_sys->size) : 0),
177 + (ulong) (fil_system_hash_cells() * sizeof(hash_cell_t)
178 + + fil_system_hash_nodes()),
179 + (ulong) (fil_system_hash_cells() * sizeof(hash_cell_t)),
180 + (ulong) fil_system_hash_nodes(),
182 + (ulong) ((lock_sys ? (lock_sys->rec_hash->n_cells * sizeof(hash_cell_t)) : 0)
183 + + lock_sys_subtotal),
184 + (ulong) (lock_sys ? (lock_sys->rec_hash->n_cells * sizeof(hash_cell_t)) : 0),
185 + (ulong) lock_sys_subtotal,
187 + (ulong) (((recv_sys && recv_sys->addr_hash)
188 + ? (recv_sys->addr_hash->n_cells * sizeof(hash_cell_t)) : 0)
189 + + recv_sys_subtotal),
190 + (ulong) ((recv_sys && recv_sys->addr_hash)
191 + ? (recv_sys->addr_hash->n_cells * sizeof(hash_cell_t)) : 0),
192 + (ulong) recv_sys_subtotal,
194 + (ulong) (thr_local_hash_cells() * sizeof(hash_cell_t)
195 + + thr_local_hash_nodes()),
196 + (ulong) (thr_local_hash_cells() * sizeof(hash_cell_t)),
197 + (ulong) thr_local_hash_nodes(),
199 + (ulong) (((buf_pool->io_counter_hash) /* needs &(buf_pool->mutex) ? */
200 + ? (buf_pool->io_counter_hash->n_cells * sizeof(hash_cell_t)) : 0)
201 + + io_counter_subtotal),
202 + (ulong) ((buf_pool->io_counter_hash) /* needs &(buf_pool->mutex) ? */
203 + ? (buf_pool->io_counter_hash->n_cells * sizeof(hash_cell_t)) : 0),
204 + (ulong) io_counter_subtotal);
208 "In addition to that %lu MB of AWE memory allocated\n",
209 diff -ruN mysql-5.0.67_highperf/innobase/thr/thr0loc.c mysql-5.0.67_highperf_tmp/innobase/thr/thr0loc.c
210 --- mysql-5.0.67_highperf/innobase/thr/thr0loc.c 2008-11-12 09:24:58.000000000 +0900
211 +++ mysql-5.0.67_highperf_tmp/innobase/thr/thr0loc.c 2008-11-12 09:27:52.000000000 +0900
214 /* The hash table. The module is not yet initialized when it is NULL. */
215 hash_table_t* thr_local_hash = NULL;
216 +ulint thr_local_hash_n_nodes = 0;
218 /* The private data for each thread should be put to
219 the structure below and the accessor functions written
221 HASH_INSERT(thr_local_t, hash, thr_local_hash,
222 os_thread_pf(os_thread_get_curr_id()),
224 + thr_local_hash_n_nodes++;
226 mutex_exit(&thr_local_mutex);
230 HASH_DELETE(thr_local_t, hash, thr_local_hash,
231 os_thread_pf(id), local);
232 + thr_local_hash_n_nodes--;
234 mutex_exit(&thr_local_mutex);
237 mutex_create(&thr_local_mutex);
238 mutex_set_level(&thr_local_mutex, SYNC_THR_LOCAL);
241 +/*************************************************************************
242 +Return local hash table informations. */
245 +thr_local_hash_cells(void)
246 +/*======================*/
248 + if (thr_local_hash) {
249 + return (thr_local_hash->n_cells);
256 +thr_local_hash_nodes(void)
257 +/*======================*/
259 + if (thr_local_hash) {
260 + return (thr_local_hash_n_nodes
261 + * (sizeof(thr_local_t) + MEM_BLOCK_HEADER_SIZE));
266 diff -ruN mysql-5.0.67_highperf/patch_info/innodb_show_hashed_memory.info mysql-5.0.67_highperf_tmp/patch_info/innodb_show_hashed_memory.info
267 --- /dev/null 1970-01-01 09:00:00.000000000 +0900
268 +++ mysql-5.0.67_highperf_tmp/patch_info/innodb_show_hashed_memory.info 2008-11-12 09:27:52.000000000 +0900
270 +File=innodb_show_hashed_memory.patch
271 +Name=Adds additional information of InnoDB internal hash table memories in SHOW INNODB STATUS
273 +Author=Percona <info@percona.com>