1. 10 Jan, 2007 1 commit
    • marko's avatar
      branches/zip: Remove a race condition. · 1f7bc8e2
      marko authored
      buf_page_init_for_read(): Protect the buf_zip_decompress() call with
      an X-lock on the block.
      
      page_zip_validate(): Move the page_is_comp() assertion after the
      page header comparison.
      1f7bc8e2
  2. 09 Jan, 2007 6 commits
  3. 08 Jan, 2007 3 commits
  4. 05 Jan, 2007 7 commits
  5. 04 Jan, 2007 2 commits
    • marko's avatar
      branches/zip: Allow dirty blocks to be relocated. Allow a transition · 91c87cd3
      marko authored
      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.
      91c87cd3
    • marko's avatar
      branches/zip: Fix two bugs in the relocation of block descriptors. · ede8e7bc
      marko authored
      Improve diagnostics.
      
      buf_buddy_relocate(): Do not assume all small blocks to contain only one
      buf_page_t object.  Require an exact size match, as in the case of
      compressed pages.
      
      buf_relocate(): Relocate buf_pool->LRU_old if needed.
      Validate the LRU list in debug builds.
      
      buf_LRU_block_remove_hashed_page(): Do not overwrite FIL_PAGE_OFFSET
      or FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID.  The memory will be invalidated
      in debug builds of buf_buddy_free().
      
      buf0buddy.c: Add assertions for not holding buf_pool->zip_mutex.
      The calling thread should not be holding any block->mutex, but it might
      be too time-consuming to assert against that, even #ifdef UNIV_SYNC_DEBUG.
      ede8e7bc
  6. 03 Jan, 2007 5 commits
    • marko's avatar
      buf_flush_validate_low(): Minor cleanup. · 324df09d
      marko authored
      324df09d
    • marko's avatar
      branches/zip: Before calling buf_buddy_alloc() or buf_buddy_free(), · bb9217fa
      marko authored
      release any block mutexes but hold the buf_pool->mutex.
      bb9217fa
    • marko's avatar
      branches/zip: Use the buddy allocator for managing compressed pages. · f890ec15
      marko authored
      There is something wrong with the management of compressed-only blocks
      (BUF_BLOCK_ZIP_PAGE).  To disable the creation of such blocks, set zip=TRUE
      in buf_LRU_block_remove_hashed_page().
      
      buf_LRU_block_remove_hashed_page(): Release buf_pool->zip_mutex when
      freeing a compressed-only page and its control block, with buf_buddy_free().
      Adapt callers.
      
      buf_LRU_block_free_hashed_page(): Change the parameter type from buf_page_t*
      to buf_block_t*.
      
      buf_LRU_free_block(): Move below the definition of buf_LRU_add_block_low().
      Allocate block descriptor for compressed-only blocks.
      
      buf_LRU_block_free_non_file_page(): Replace ut_free() with buf_buddy_free().
      
      buf_zip_decompress(): New function, split from buf_page_io_complete().
      
      buf_page_init_for_read(): Do not allocate the compressed page until it is
      really needed, to avoid the overhead of the buddy allocator.  Decompress
      compressed-only blocks that are needed again.
      
      buf_page_create(): Do not allocate the compressed page until it is
      really needed, to avoid the overhead of the buddy allocator.
      
      buf_validate(): Replace some equality tests on the lengths of the LRU
      list and the flush lists with greater-or-equal tests, since the counted
      numbers do not include control blocks for compressed-only pages.
      f890ec15
    • marko's avatar
      branches/zip: Add __attribute__((const)) or __attribute__((pure)) · 0b89bb79
      marko authored
      to all fold functions.
      0b89bb79
    • marko's avatar
      branches/zip: trx_prepare_off_kernel(): Eliminate the local variable · 81334fe6
      marko authored
      must_flush_log, and remove warning about lsn being possibly uninitialized.
      81334fe6
  7. 02 Jan, 2007 2 commits
  8. 29 Dec, 2006 2 commits
    • marko's avatar
      branches/zip: Minor cleanup. · 75e35eb7
      marko authored
      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.
      75e35eb7
    • marko's avatar
      branches/zip: Minor cleanup. · c087a5d5
      marko authored
      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.
      c087a5d5
  9. 21 Dec, 2006 1 commit
    • marko's avatar
      branches/zip: Fix two bugs in the buddy allocator. · 631da97d
      marko authored
      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).
      631da97d
  10. 20 Dec, 2006 4 commits
    • marko's avatar
      branches/zip: Allow the buddy allocator to work for 16-kilobyte pages, · 9244a3a5
      marko authored
      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.
      9244a3a5
    • marko's avatar
      branches/zip: buf_page_get_gen(): Restore the "break" statement to a · 77417e46
      marko authored
      "for (;;)" loop that was accidentally removed in r1090.
      77417e46
    • marko's avatar
      branches/zip: buf_buddy_free_low(): When trying to relocate to a block on · cf96318a
      marko authored
      the free list, remove the free block from the free list, so that the list
      item pointers will not be overwritten.
      cf96318a
    • marko's avatar
      branches/zip: Fix bugs in the buddy allocator and add assertions. · fe1e339f
      marko authored
      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.
      fe1e339f
  11. 19 Dec, 2006 2 commits
  12. 18 Dec, 2006 3 commits
  13. 15 Dec, 2006 2 commits
    • marko's avatar
      branches/zip: Minor improvements. · 492cd8ce
      marko authored
      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).
      492cd8ce
    • marko's avatar
      branches/zip: Minor improvements. · 0fb620f5
      marko authored
      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.
      0fb620f5