For some reason, GCC 4.2.1 ignores casts (for removing constness)
in calls to inline functions.
page_align(), ut_align_down(): Make the parameter const void*, but still
return a non-const pointer. This is ugly, but these functions cannot be
replaced with a const-preserving macro in a portable way, given that
the pointer argument is not always pointing to bytes.
buf_block_get_page_zip(): Implement as a const-preserving macro.
buf_frame_get_page_zip(), buf_block_align(): Add const qualifiers.
lock_rec_get_prev(): Silence GCC 4.2.1 warnings.
mlog_write_initial_log_record(), mlog_write_initial_log_record_fast(),
mtr_memo_contains(): Add const qualifier to the pointer.
page_header_get_ptr(): Rewrite as page_header_get_offs(), and
implement as a macro that calls this function.
buf_block_hash_get(): New function, similar to buf_page_hash_get().
buf_page_get_block(): Remove the const qualifiers. This is a low-level
function, and the operations on block->mutex are non-const.
buf_page_try_get_func(): Implement with lower-level predicates, somewhat
similar to buf_page_get_known_nowait().
lock_rec_print(): Remove the unused variable zip_size and the
call to fil_space_get_zip_size(). Adapt to buf_page_try_get() returning
a const pointer.
Move part of the code from lock_rec_print() in a separate function
buf_page_try_get() because the same functionality is needed in
INFORMATION SCHEMA code.
Approved by: Heikki
frame when reading compressed pages, unless crash recovery is in progress.
buf_page_read_low(): Adapt for buf_page_init_for_read() returning
buf_page_t* instead of buf_block_t*.
but in buf_page_get_gen(). Adjust comments. This prevents
unnecessary decompression in read-ahead when the compressed block
exists in the buffer pool.
If the block does not exist in the buffer pool, read-ahead will still
allocate an uncompressed page and decompress the block.
Move buf_block_init_low() and buf_zip_decompress() earlier in the file,
because some compilers are unable to inline functions that are defined
after the invocation.
buf_page_get_gen(): Decompress the block if needed.
buf_page_init_for_read(): Do not decompress.
uncompressed page frames.
buf_page_get_zip(), buf_page_release_zip(): New functions, used
by btr_copy_zblob_prefix().
btr_copy_zblob_prefix(): Do not call inflateEnd().
buf_page_get_gen(). This saves one mutex operation per block request.
buf_page_get_gen(), various macros and functions: Add parameter zip_size.
btr_node_ptr_get_child(): Add parameter index.
fil_space_get_latch(): Add optional output parameter zip_size.
fil_space_get_zip_size(): Return 0 for space id==0, because the
system tablespace is never compressed.
fsp_header_init(): Remove the parameter zip_size.
ibuf_free_excess_pages(): Remove the parameter zip_size.
trx_rseg_t, trx_undo_t: Add field zip_size.
xdes_lst_get_next(): Remove, unused.
and add compressed-only pages to buf_pool->page_hash.
BUF_POOL_ZIP_FOLD(), BUF_POOL_ZIP_FOLD_PTR(), BUF_POOL_ZIP_FOLD_BPAGE():
Macros for computing buf_pool->zip_hash fold values. Make use of these
in buf0buddy.c.
buf0buddy.c: Replace some ptr == ut_align_down(ptr, ...) in assertions with
!ut_align_offset(ptr, ...).
to BUF_BLOCK_ZIP_DIRTY (discarding the uncompressed page corresponding
to a modified compressed page that has not been flushed to disk).
buf_page_can_relocate(): New function, modelled after
buf_flush_ready_for_replace().
buf_LRU_free_block(): Allow the transition to BUF_BLOCK_ZIP_DIRTY.
buf_flush_insert_into_flush_list(): Make the prototype public.
buf_buddy_relocate(): Remove an unnecessary switch statement.
Use buf_page_can_relocate() instead of buf_flush_ready_for_replace().
buf_page_peek(): Made UNIV_INLINE.
Document UNIV_ZIP_DEBUG.
twice the maximum block size of the buddy system.
buf_page_t: Note that state may change from BUF_BLOCK_READY_FOR_USE
to BUF_BLOCK_MEMORY without buf_page_get_mutex() protection
[only buf_pool->mutex].
buf_buddy_get_slot(): Extend the output to BUF_BUDDY_SIZES.
buf_buddy_alloc(), buf_buddy_free(): Allow sizes up to UNIV_PAGE_SIZE.
buf_buddy_alloc_low(), buf_buddy_free_low(), buf_buddy_alloc_clean():
Allow i==BUF_BUDDY_SIZES.
buf_buddy_alloc_zip() [UNIV_DEBUG]: Byte-fill the allocated blocks with ~i.
buf_buddy_block_free() [UNIV_DEBUG]: Clear the frame before releasing it
to the buffer pool.
buf_buddy_alloc_from() [UNIV_DEBUG]: Byte-fill the free blocks with j.
buf_buddy_relocate(): Allow the buf_page_hash_get() lookup to fail,
and note the reason.
buf_buddy_free_low(): Correctly compute the address of the combined free block.
buf_page_struct: Clarify the mutex protection rules. Note that
the pointer zip.data is also protected by buf_pool->mutex.
buf_LRU_get_free_block(): Document that the block is in the state
BUF_BLOCK_READY_FOR_USE.
buf_block_alloc(): Change the state of the block to BUF_BLOCK_MEMORY
and document it.
Replace those invocations of buf_block_alloc() with
buf_LRU_get_free_block() where the allocated block is used for buffer
pool input and output. However, temporary copies of B-tree pages
during reorganization are not used for file I/O, and such blocks are
still allocated with buf_block_alloc().
to the buddy system for allocating compressed pages and their descriptors.
buf_buddy_free_block(): New function: Deallocate the buffer frame.
buf_buddy_free(), buf_buddy_free_low(): Return void instead of a pointer
to a freed buffer frame.
introduced ib_longlong and %ll length specifier are not C89.)
row_ext_t: Change char* buf to byte* buf to avoid signedness warnings.
Change the type of all bit fields to unsigned.
rec_get_next_ptr(): Add (byte*) casts to avoid arithmetics on void*.
page_zip_decompress_clust(): Do not mix declarations and code.
compressed pages from the buffer pool.
Makefile.am: Add buf0buddy.h, buf0buddy.ic.
buf/Makefile.am: Add buf0buddy.c.
Introduce the constants BUF_BUDDY_LOW and BUF_BUDDY_SIZES.
buf_pool_t: Add zip_mutex and the lists zip_clean and zip_free[].
buf_page_get_mutex(): Return &buf_pool->zip_mutex instead of NULL.
buf_buddy_get_offset(), buf_buddy_get(), buf_buddy_get_slot(),
buf_buddy_alloc_free(), buf_buddy_alloc_free_low(): New functions.
(state == BUF_BLOCK_ZIP_PAGE). Make use of buf_page_in_file()
and buf_page_get_mutex().
buf_block_get_newest_modification(): Rename to
buf_page_get_newest_modification().
LRU_position and possibly freed_page_clock. All these fields are
protected by buf_pool->mutex rather than buf_page_get_mutex().
buf_page_set_accessed(): Add a mutex_own() assertion.
decompression from page_zip_des_t to buf_page_t, because the fields
needed in compression are modified without holding the block mutex.
All writes to bit-fields sharing a machine word must be protected
by the same mutex or rw-lock.
buf_block_t. Move the fields "hash" and "file_page_was_freed" from
buf_block_t to buf_page_t.
buf_page_in_file(): New function, for checking block state in assertions.
and uncompressed buffer pool pages.
buf_block_t: Replace page_zip, space, and offset with buf_page_t page.
Replace some integers with bit-fields.
enum buf_block_state: Rename to buf_page_state. Add BUF_BLOCK_ZIP_PAGE.
page_zip_des_t: Add the field "state". Make the integer fields bit-fields.
page_zip_copy(): Document which fields are copied.
and block->space with buf_block_get_state(block), buf_block_get_page_no(block),
and buf_block_get_space(block).
enum buf_block_state: Replaces the #define'd buf_block_t.state values.
buf_block_get_state(): New function.
buf_block_get_frame(): Add __attribute__((const)).
enclose all related debug code in #ifdef UNIV_DEBUG_FILE_ACCESSES.
This should have no effect on the behaviour, as the symbol is
not defined by default. It only reduces the size of buf_block_t
and removes some assignments and debug functions.
mysql.patch: Patch to change or add variables to MySQL
innodb.patch: Patch to make the master thread poll requests to resize
the buffer pool.
Replace srv_pool_size and innobase_buffer_pool_size
with srv_buf_pool_size, srv_buf_pool_old_size,
and srv_buf_pool_curr_size.
Add buf_chunk_t, a collection of buf_block_t.