InnoDB Plugin  1.0
Data Fields
buf_page_t Struct Reference
Collaboration diagram for buf_page_t:
Collaboration graph

Data Fields

page_zip_des_t zip
ibool in_page_hash
ibool in_zip_hash
unsigned access_time
ibool file_page_was_freed
General fields

None of these bit-fields must be modified without holding buf_page_get_mutex() [buf_block_t::mutex or buf_pool->zip_mutex], since they can be stored in the same machine word. Some of these fields are additionally protected by buf_pool->mutex.

ib_uint32_t space
ib_uint32_t offset
unsigned buf_fix_count:19
unsigned io_fix:2
unsigned state:BUF_PAGE_STATE_BITS
unsigned flush_type:2
unsigned buf_pool_index:6
Page flushing fields

All these are protected by buf_pool->mutex.

ut_list_node< buf_page_tlist
ibool in_flush_list
ibool in_free_list
lsn_t newest_modification
lsn_t oldest_modification
LRU replacement algorithm fields

These fields are protected by buf_pool->mutex only (not buf_pool->zip_mutex or buf_block_t::mutex).

ut_list_node< buf_page_tLRU
ibool in_LRU_list
unsigned old:1
unsigned freed_page_clock:31

Field Documentation

unsigned buf_page_t::access_time

time of first access, or 0 if the block was never accessed in the buffer pool. Protected by block mutex

unsigned buf_page_t::buf_fix_count

count of how manyfold this block is currently bufferfixed

unsigned buf_page_t::buf_pool_index

index number of the buffer pool that this block belongs to

ibool buf_page_t::file_page_was_freed

this is set to TRUE when fsp frees a page in buffer pool; protected by buf_pool->zip_mutex or buf_block_t::mutex.

unsigned buf_page_t::flush_type

if this block is currently being flushed to disk, this tells the flush_type.

See Also
unsigned buf_page_t::freed_page_clock

the value of buf_pool->freed_page_clock when this block was the last time put to the head of the LRU list; a thread is allowed to read this for heuristic purposes without holding any mutex or latch

buf_page_t* buf_page_t::hash

node used in chaining to buf_pool->page_hash or buf_pool->zip_hash

ibool buf_page_t::in_flush_list

TRUE if in buf_pool->flush_list; when buf_pool->flush_list_mutex is free, the following should hold: in_flush_list == (state == BUF_BLOCK_FILE_PAGE || state == BUF_BLOCK_ZIP_DIRTY) Writes to this field must be covered by both block->mutex and buf_pool->flush_list_mutex. Hence reads can happen while holding any one of the two mutexes

ibool buf_page_t::in_free_list

TRUE if in buf_pool->free; when buf_pool->mutex is free, the following should hold: in_free_list == (state == BUF_BLOCK_NOT_USED)

ibool buf_page_t::in_LRU_list

TRUE if the page is in the LRU list; used in debugging

ibool buf_page_t::in_page_hash

TRUE if in buf_pool->page_hash

ibool buf_page_t::in_zip_hash

TRUE if in buf_pool->zip_hash

unsigned buf_page_t::io_fix
type of pending I/O operation; also protected by

buf_pool->mutex for writes only

See Also
enum buf_io_fix state of the control block; also protected by buf_pool->mutex. State transitions from BUF_BLOCK_READY_FOR_USE to BUF_BLOCK_MEMORY need not be protected by buf_page_get_mutex().
enum buf_page_state. State changes that are relevant to page_hash are additionally protected by the appropriate page_hash mutex i.e.: if a page is in page_hash or is being added to/removed from page_hash then the corresponding changes must also be protected by page_hash mutex.
ut_list_node< buf_page_t > buf_page_t::list

based on state, this is a list node, protected either by buf_pool->mutex or by buf_pool->flush_list_mutex, in one of the following lists in buf_pool:

  • BUF_BLOCK_FILE_PAGE: flush_list
  • BUF_BLOCK_ZIP_DIRTY: flush_list
  • BUF_BLOCK_ZIP_PAGE: zip_clean

If bpage is part of flush_list then the node pointers are covered by buf_pool->flush_list_mutex. Otherwise these pointers are protected by buf_pool->mutex.

The contents of the list node is undefined if !in_flush_list && state == BUF_BLOCK_FILE_PAGE, or if state is one of BUF_BLOCK_MEMORY, BUF_BLOCK_REMOVE_HASH or BUF_BLOCK_READY_IN_USE.

ut_list_node< buf_page_t > buf_page_t::LRU

node of the LRU list

lsn_t buf_page_t::newest_modification

log sequence number of the youngest modification to this block, zero if not modified. Protected by block mutex

ib_uint32_t buf_page_t::offset

page number; also protected by buf_pool->mutex.

unsigned buf_page_t::old

TRUE if the block is in the old blocks in buf_pool->LRU_old

lsn_t buf_page_t::oldest_modification

log sequence number of the START of the log entry written of the oldest modification to this block which has not yet been flushed on disk; zero if all modifications are on disk. Writes to this field must be covered by both block->mutex and buf_pool->flush_list_mutex. Hence reads can happen while holding any one of the two mutexes

ib_uint32_t buf_page_t::space

tablespace id; also protected by buf_pool->mutex.

page_zip_des_t buf_page_t::zip

compressed page; (but not the data it points to) is also protected by buf_pool->mutex; state == BUF_BLOCK_ZIP_PAGE and == NULL means an active buf_pool->watch

The documentation for this struct was generated from the following file: