diff options
author | Marko Mäkelä <marko.makela@oracle.com> | 2010-10-27 09:56:56 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@oracle.com> | 2010-10-27 09:56:56 +0300 |
commit | 26d81a2a9835bc16b59010ebd4017ac508215643 (patch) | |
tree | 7bf147f56ff8476e56cbe5c59784baba9cf043da /storage/innobase/include/buf0buf.h | |
parent | 0fbc74a451b33b10b66c4f47000ac0f2733c69f4 (diff) | |
download | mariadb-git-26d81a2a9835bc16b59010ebd4017ac508215643.tar.gz |
Bug #57707 InnoDB buf_page_t size has doubled on 32-bit systems
buf_page_t: Remove the buf_pool pointer. Add buf_pool_index:6 next to
buf_fix_count:19 (it was buf_fix_count:25). This will limit the number
of concurrent transactions to somewhere around 524,288.
buf_pool_index(buf_pool): A new function to determine the index of a
buffer pool in buf_pool_ptr[].
buf_pool_ptr: Make this a dynamically allocated array instead of an
array of pointers. Allocate the array in buf_pool_init() and free in
buf_pool_free().
buf_pool_free_instance(): No longer free the buf_pool object, as it is
allocated from a big array.
buf_pool_from_bpage(), buf_pool_from_block(): Move the definitions to
the beginning of the files, because some compilers have (had) problems
with forward definitions of inline functions. Calculate the buffer
pool from buf_pool_index.
buf_pool_from_array(): Add debug assertions for input validation.
Diffstat (limited to 'storage/innobase/include/buf0buf.h')
-rw-r--r-- | storage/innobase/include/buf0buf.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index b0fff919918..a42eba57fd2 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -69,7 +69,7 @@ Created 11/5/1995 Heikki Tuuri #define BUF_POOL_WATCH_SIZE 1 /*!< Maximum number of concurrent buffer pool watches */ -extern buf_pool_t* buf_pool_ptr[MAX_BUFFER_POOLS]; /*!< The buffer pools +extern buf_pool_t* buf_pool_ptr; /*!< The buffer pools of the database */ #ifdef UNIV_DEBUG extern ibool buf_debug_prints;/*!< If this is set TRUE, the program @@ -1034,6 +1034,15 @@ buf_page_address_fold( ulint space, /*!< in: space id */ ulint offset) /*!< in: offset of the page within space */ __attribute__((const)); +/********************************************************************//** +Calculates the index of a buffer pool to the buf_pool[] array. +@return the position of the buffer pool in buf_pool[] */ +UNIV_INLINE +ulint +buf_pool_index( +/*===========*/ + const buf_pool_t* buf_pool) /*!< in: buffer pool */ + __attribute__((nonnull, const)); /******************************************************************//** Returns the buffer pool instance given a page instance @return buf_pool */ @@ -1065,8 +1074,9 @@ Returns the buffer pool instance given its array index UNIV_INLINE buf_pool_t* buf_pool_from_array( -/*====================*/ - ulint index); /*!< in: array index to get buffer pool instance from */ +/*================*/ + ulint index); /*!< in: array index to get + buffer pool instance from */ /******************************************************************//** Returns the control block of a file page, NULL if not found. @return block, NULL if not found */ @@ -1204,8 +1214,13 @@ struct buf_page_struct{ unsigned io_fix:2; /*!< type of pending I/O operation; also protected by buf_pool->mutex @see enum buf_io_fix */ - unsigned buf_fix_count:25;/*!< count of how manyfold this block + unsigned buf_fix_count:19;/*!< count of how manyfold this block is currently bufferfixed */ + unsigned buf_pool_index:6;/*!< index number of the buffer pool + that this block belongs to */ +# if MAX_BUFFER_POOLS > 64 +# error "MAX_BUFFER_POOLS > 64; redefine buf_pool_index:6" +# endif /* @} */ #endif /* !UNIV_HOTBACKUP */ page_zip_des_t zip; /*!< compressed page; zip.data @@ -1324,8 +1339,6 @@ struct buf_page_struct{ frees a page in buffer pool */ # endif /* UNIV_DEBUG_FILE_ACCESSES */ #endif /* !UNIV_HOTBACKUP */ - buf_pool_t* buf_pool; /*!< buffer pool instance this - page belongs to */ }; /** The buffer control block structure */ |