buf_buddy_get(): New function in buf0buddy.c, to replace the macro
in buf0buddy.h.
buf_buddy_get_offset(): Remove.
buf_buddy_get_slot(): Remove the prototype from buf0buddy.h. This function
is for internal use in buf0buddy.ic.
buf_page_get_gen(): Cache the result of fil_space_get_zip_size().
trx_commit_off_kernel(): Eliminate the flag must_flush_log. Initialize lsn = 0
to signify must_flush_log == FALSE.
log_flush_margin(): Eliminate the flag do_flush. Initialize lsn = 0
to signify do_flush == FALSE.
buf_buddy_block_free(): Remove the block from buf_pool->zip_hash.
buf_buddy_alloc_clean(): Test for buf_page_in_file() before
invoking buf_LRU_free_block(). The LRU list also contains "half-freed"
blocks (state == BUF_BLOCK_REMOVE_HASH).
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_free(), buf_buddy_free_low(): Document that the data must
not be pointed to by the buffer pool. Add ut_ad(!buf_pool_contains_zip())
assertions to catch pointers to freed blocks.
Validate the zip_free[] lists #ifdef UNIV_DEBUG.
buf_buddy_relocate(): Ensure that the size of the compressed page
matches. The buddy block can be split, and the control block can be
pointing to a smaller compressed page than the one whose relocation
is being attempted.
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_buddy_alloc_zip(): Calculate the address with char* aritmetics.
buf_buddy_alloc_clean(): Acquire a mutex on the block before
calling buf_LRU_free_block().
buf_buddy_relocate(): Remove the bogus assertion about src and dst
being buddies of each other. Use mach_read_from_4() instead of
page_get_space_id() and page_get_page_no() to avoid page alignment
assertions.
buf_buddy_free_low(): Replace bogus assertions.
buf_LRU_block_remove_hashed_page(): Return the new state of the block.
Only call buf_LRU_block_free_hashed_page()
if buf_LRU_block_remove_hashed_page() did not return BUF_BLOCK_ZIP_FREE,
that is, the control block was not freed.
buf_LRU_insert_zip_clean(): New function, for inserting a compressed-only
block into buf_pool->zip_clean in the LRU order.
buf_LRU_block_remove_hashed_page(), buf_LRU_free_block():
Add the flag "zip" for controlling if the compressed page of an uncompressed
page should be removed. For now, assume zip==TRUE.
buf_LRU_get_free_block(): Replace the test for UT_LIST_GET_LEN(buf_pool->free)
with a test for the return value of buf_LRU_get_free_only(). Do not
free zip.data, as it must already have been freed.
buf_flush_insert_into_flush_list(), buf_flush_insert_sorted_into_flush_list():
Remove compressed-only blocks from the buf_pool->zip_clean list.
buf_flush_remove(): Restore compressed-only blocks to
the buf_pool->zip_clean list.
buf_page_init_for_read(): Uncompress compressed-only blocks when possible.
Currently, there cannot be any compressed-only blocks in the buffer pool;
they would be inserted by buf_LRU_free_block(bpage, zip=FALSE).
buf_flush_remove(): New function, for removing a block from the flush list.
Sliced from buf_flush_write_complete().
buf_page_set_state(): Allow transitions between BUF_BLOCK_ZIP_PAGE
and BUF_BLOCK_ZIP_DIRTY.
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().
the LRU list regardless of their size.
buf_buddy_alloc_clean_zip(): Rename to buf_buddy_alloc_clean(),
now that also uncompressed blocks can be reclaimed.
Use buf_buddy_alloc_zip() instead of reusing the freed block
directly, since buf_buddy_free() may combine blocks.
buf_buddy_alloc(), buf_buddy_alloc_low(): Add parameter "lru" for
enabling allocation from the list of least-recently-used blocks.
buf_buddy_alloc_low(): Release buf_pool->mutex while calling
buf_LRU_get_free_block().
buf_LRU_free_block(): Free compressed-only pages and their
descriptors with buf_buddy_free().
buf_LRU_get_free_only(): New function for returning a block from
buf_pool->free if one is available. Split from buf_LRU_get_free_block().
buf_buddy_alloc_zip(): Rename from buf_buddy_alloc_low() and make static.
Remove parameter "split". Always try to split.
buf_buddy_free_block(): Rename to buf_buddy_block_free().
buf_buddy_block_register(): New function for registering buf_block_t
objects reserved by the allocator.
buf_buddy_alloc_from(): New function for allocating an object from a
bigger object, and putting the unused parts on the free list.
buf_buddy_alloc_clean_zip(): New function for allocating memory by
replacing an unmodified compressed page.
buf_buddy_alloc_low(): New function for allocating memory, either from
the free lists of compressed pages, from the global free list, or from
unmodified pages in the buffer pool.
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.
free block in order to create two adjacent free blocks that can be
recombined. Add some debug assertions.
buf_buddy_relocate(): New function: Try to relocate a free block.
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().
Add m_nonempty for facilitating the test in page_zip_alloc(). This
reduces the combined size of the bit-fields to 32 bits. Thus,
sizeof(page_zip_des_t) == 2 machine words on 32-bit and wider systems.
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.