mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
srv0srv.c, mem0pool.c, mem0pool.h, buf0buf.h, buf0buf.c:
Make smaller buffer headers and the lock table; fix AWE high_end bug
This commit is contained in:
parent
5a107871c3
commit
be03863425
5 changed files with 30 additions and 32 deletions
|
@ -385,9 +385,6 @@ buf_block_init(
|
|||
|
||||
rw_lock_create(&(block->lock));
|
||||
ut_ad(rw_lock_validate(&(block->lock)));
|
||||
|
||||
rw_lock_create(&(block->read_lock));
|
||||
rw_lock_set_level(&(block->read_lock), SYNC_NO_ORDER_CHECK);
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
rw_lock_create(&(block->debug_latch));
|
||||
|
@ -484,7 +481,7 @@ buf_pool_init(
|
|||
frame = ut_align(buf_pool->frame_mem, UNIV_PAGE_SIZE);
|
||||
|
||||
buf_pool->frame_zero = frame;
|
||||
buf_pool->high_end = frame + UNIV_PAGE_SIZE * curr_size;
|
||||
buf_pool->high_end = frame + UNIV_PAGE_SIZE * n_frames;
|
||||
|
||||
if (srv_use_awe) {
|
||||
/*----------------------------------------*/
|
||||
|
@ -1099,8 +1096,26 @@ loop:
|
|||
} else if (rw_latch == RW_NO_LATCH) {
|
||||
|
||||
if (must_read) {
|
||||
rw_lock_x_lock(&(block->read_lock));
|
||||
rw_lock_x_unlock(&(block->read_lock));
|
||||
/* Let us wait until the read operation
|
||||
completes */
|
||||
|
||||
for (;;) {
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
if (block->io_fix == BUF_IO_READ) {
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
/* Sleep 20 milliseconds */
|
||||
|
||||
os_thread_sleep(20000);
|
||||
} else {
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fix_type = MTR_MEMO_BUF_FIX;
|
||||
|
@ -1523,8 +1538,6 @@ buf_page_init_for_read(
|
|||
is completed. The x-lock is cleared by the io-handler thread. */
|
||||
|
||||
rw_lock_x_lock_gen(&(block->lock), BUF_IO_READ);
|
||||
|
||||
rw_lock_x_lock_gen(&(block->read_lock), BUF_IO_READ);
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
|
@ -1747,9 +1760,7 @@ buf_page_io_complete(
|
|||
buf_pool->n_pend_reads--;
|
||||
buf_pool->n_pages_read++;
|
||||
|
||||
|
||||
rw_lock_x_unlock_gen(&(block->lock), BUF_IO_READ);
|
||||
rw_lock_x_unlock_gen(&(block->read_lock), BUF_IO_READ);
|
||||
|
||||
if (buf_debug_prints) {
|
||||
printf("Has read ");
|
||||
|
|
|
@ -693,14 +693,6 @@ struct buf_block_struct{
|
|||
record lock hash table */
|
||||
rw_lock_t lock; /* read-write lock of the buffer
|
||||
frame */
|
||||
rw_lock_t read_lock; /* rw-lock reserved when a page read
|
||||
to the frame is requested; a thread
|
||||
can wait for this rw-lock if it wants
|
||||
to wait for the read to complete;
|
||||
the usual way is to wait for lock,
|
||||
but if the thread just wants a
|
||||
bufferfix and no latch on the page,
|
||||
then it can wait for this rw-lock */
|
||||
buf_block_t* hash; /* node used in chaining to the page
|
||||
hash table */
|
||||
ibool check_index_page_at_flush;
|
||||
|
|
|
@ -19,6 +19,8 @@ typedef struct mem_pool_struct mem_pool_t;
|
|||
/* The common memory pool */
|
||||
extern mem_pool_t* mem_comm_pool;
|
||||
|
||||
extern ulint mem_out_of_mem_err_msg_count;
|
||||
|
||||
/* Memory area header */
|
||||
|
||||
struct mem_area_struct{
|
||||
|
|
|
@ -259,19 +259,6 @@ mem_pool_fill_free_list(
|
|||
/* We come here when we have run out of space in the
|
||||
memory pool: */
|
||||
|
||||
if (mem_out_of_mem_err_msg_count % 1000000000 == 0) {
|
||||
/* We do not print the message every time: */
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
|
||||
fprintf(stderr,
|
||||
" InnoDB: Out of memory in additional memory pool.\n"
|
||||
"InnoDB: InnoDB will start allocating memory from the OS.\n"
|
||||
"InnoDB: You may get better performance if you configure a bigger\n"
|
||||
"InnoDB: value in the MySQL my.cnf file for\n"
|
||||
"InnoDB: innodb_additional_mem_pool_size.\n");
|
||||
}
|
||||
|
||||
mem_out_of_mem_err_msg_count++;
|
||||
|
||||
return(FALSE);
|
||||
|
|
|
@ -1979,7 +1979,7 @@ srv_normalize_init_values(void)
|
|||
|
||||
srv_lock_table_size = 20 * srv_awe_window_size;
|
||||
} else {
|
||||
srv_lock_table_size = 20 * srv_pool_size;
|
||||
srv_lock_table_size = 5 * srv_pool_size;
|
||||
}
|
||||
|
||||
return(DB_SUCCESS);
|
||||
|
@ -2345,6 +2345,12 @@ srv_sprintf_innodb_monitor(
|
|||
"Total memory allocated %lu; in additional pool allocated %lu\n",
|
||||
ut_total_allocated_memory,
|
||||
mem_pool_get_reserved(mem_comm_pool));
|
||||
|
||||
if (mem_out_of_mem_err_msg_count > 0) {
|
||||
buf += sprintf(buf,
|
||||
"Mem allocation has spilled out of additional mem pool %lu times\n");
|
||||
}
|
||||
|
||||
if (srv_use_awe) {
|
||||
buf += sprintf(buf,
|
||||
"In addition to that %lu MB of AWE memory allocated\n",
|
||||
|
|
Loading…
Reference in a new issue