Skip to content

File page_buffer.c

FileList > cubrid > src > storage > page_buffer.c

Go to the source code of this file

  • #include "config.h"
  • #include <stdlib.h>
  • #include <stddef.h>
  • #include <string.h>
  • #include <assert.h>
  • #include <atomic>
  • #include "page_buffer.h"
  • #include "storage_common.h"
  • #include "memory_alloc.h"
  • #include "system_parameter.h"
  • #include "error_manager.h"
  • #include "file_io.h"
  • #include "lockfree_circular_queue.hpp"
  • #include "log_append.hpp"
  • #include "log_manager.h"
  • #include "log_impl.h"
  • #include "log_volids.hpp"
  • #include "transaction_sr.h"
  • #include "memory_hash.h"
  • #include "critical_section.h"
  • #include "perf_monitor.h"
  • #include "porting_inline.hpp"
  • #include "environment_variable.h"
  • #include "thread_looper.hpp"
  • #include "thread_daemon.hpp"
  • #include "thread_entry_task.hpp"
  • #include "thread_manager.hpp"
  • #include "list_file.h"
  • #include "tsc_timer.h"
  • #include "query_manager.h"
  • #include "xserver_interface.h"
  • #include "btree_load.h"
  • #include "boot_sr.h"
  • #include "double_write_buffer.hpp"
  • #include "resource_tracker.hpp"
  • #include "tde.h"
  • #include "show_scan.h"
  • #include "numeric_opfunc.h"
  • #include "dbtype.h"
  • #include "scope_exit.hpp"
  • #include "connection_error.h"
  • #include "thread_entry.hpp"
  • #include "memory_wrapper.hpp"

Classes

Type Name
struct pgbuf_aout_buf
struct pgbuf_aout_list
struct pgbuf_batch_flush_helper
struct pgbuf_bcb
struct pgbuf_buffer_hash
struct pgbuf_buffer_lock
struct pgbuf_buffer_pool
struct pgbuf_dealloc_undo_data
struct pgbuf_direct_victim
struct pgbuf_fix_perf
class pgbuf_flush_control_daemon_task
struct pgbuf_holder
struct pgbuf_holder_anchor
struct pgbuf_holder_info
struct pgbuf_holder_set
struct pgbuf_holder_stat
struct pgbuf_invalid_list
struct pgbuf_iopage_buffer
struct pgbuf_lru_list
struct pgbuf_monitor_bcb_mutex
class pgbuf_page_flush_daemon_task
struct pgbuf_page_monitor
struct pgbuf_page_quota
struct pgbuf_seq_flusher
struct pgbuf_status
struct pgbuf_status_old
struct pgbuf_status_snapshot
struct pgbuf_victim_candidate_list

Public Types

Type Name
typedef struct pgbuf_aout_buf PGBUF_AOUT_BUF
typedef struct pgbuf_aout_list PGBUF_AOUT_LIST
typedef std::atomic< uint64_t > PGBUF_ATOMIC_LATCH
typedef union pgbuf_atomic_latch_impl PGBUF_ATOMIC_LATCH_IMPL
typedef struct pgbuf_batch_flush_helper PGBUF_BATCH_FLUSH_HELPER
typedef struct pgbuf_bcb PGBUF_BCB
typedef struct pgbuf_buffer_hash PGBUF_BUFFER_HASH
typedef struct pgbuf_buffer_lock PGBUF_BUFFER_LOCK
typedef struct pgbuf_buffer_pool PGBUF_BUFFER_POOL
typedef struct pgbuf_dealloc_undo_data PGBUF_DEALLOC_UNDO_DATA
typedef struct pgbuf_direct_victim PGBUF_DIRECT_VICTIM
typedef struct pgbuf_fix_perf PGBUF_FIX_PERF
typedef struct pgbuf_holder PGBUF_HOLDER
typedef struct pgbuf_holder_anchor PGBUF_HOLDER_ANCHOR
typedef struct pgbuf_holder_info PGBUF_HOLDER_INFO
typedef struct pgbuf_holder_set PGBUF_HOLDER_SET
typedef struct pgbuf_holder_stat PGBUF_HOLDER_STAT
typedef struct pgbuf_invalid_list PGBUF_INVALID_LIST
typedef struct pgbuf_iopage_buffer PGBUF_IOPAGE_BUFFER
typedef struct pgbuf_lru_list PGBUF_LRU_LIST
typedef struct pgbuf_monitor_bcb_mutex PGBUF_MONITOR_BCB_MUTEX
typedef struct pgbuf_page_monitor PGBUF_PAGE_MONITOR
typedef struct pgbuf_page_quota PGBUF_PAGE_QUOTA
typedef struct pgbuf_seq_flusher PGBUF_SEQ_FLUSHER
typedef struct pgbuf_status PGBUF_STATUS
typedef struct pgbuf_status_old PGBUF_STATUS_OLD
typedef struct pgbuf_status_snapshot PGBUF_STATUS_SNAPSHOT
typedef struct pgbuf_victim_candidate_list PGBUF_VICTIM_CANDIDATE_LIST
enum PGBUF_ZONE
enum page__buffer_8c_1a5efefa44b296976f2147b8acbed1752c
enum page__buffer_8c_1a9d62e2a4d6edc3a479d15fdf213decd0
enum page__buffer_8c_1ade4ace78b27f5ceccade6e2e29404c48
union pgbuf_atomic_latch_impl

Public Attributes

Type Name
HFID * pgbuf_ordered_null_hfid = [**NULL**](freelistheap_8h.md#define-null)
const VPID vpid_Null_vpid = { (-1) , (-1) }

Public Static Attributes

Type Name
cubthread::daemon * pgbuf_Flush_control_daemon = [**NULL**](freelistheap_8h.md#define-null)
PGBUF_BATCH_FLUSH_HELPER pgbuf_Flush_helper
char pgbuf_Guard = /* multi line expression */
bool pgbuf_Monitor_locks = [**false**](broker__monitor_8c.md#function-timeout)
cubthread::daemon * pgbuf_Page_flush_daemon = [**NULL**](freelistheap_8h.md#define-null)
cubthread::daemon * pgbuf_Page_maintenance_daemon = [**NULL**](freelistheap_8h.md#define-null)
cubthread::daemon * pgbuf_Page_post_flush_daemon = [**NULL**](freelistheap_8h.md#define-null)
PGBUF_BUFFER_POOL pgbuf_Pool
int pgbuf_latch_timeout = 300 \* 1000

Public Functions

Type Name
REGISTER_DAEMON (pgbuf_page_maintenance)
REGISTER_DAEMON (pgbuf_page_flush)
REGISTER_DAEMON (pgbuf_page_post_flush)
REGISTER_DAEMON (pgbuf_flush_control)
void pgbuf_adjust_quotas (THREAD_ENTRY * thread_p)
bool pgbuf_assign_flushed_pages (THREAD_ENTRY * thread_p)
int pgbuf_assign_private_lru (THREAD_ENTRY * thread_p)
void pgbuf_attach_watcher_debug (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, PGBUF_LATCH_MODE latch_mode, HFID * hfid, PGBUF_WATCHER * watcher, const char * caller_file, const int caller_line)
bool pgbuf_check_page_ptype (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, PAGE_TYPE ptype)
bool pgbuf_check_page_type_no_error (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, PAGE_TYPE ptype)
int pgbuf_compare_vpid (const void * key_vpid1, const void * key_vpid2)
void * pgbuf_copy_from_area (THREAD_ENTRY * thread_p, const VPID * vpid, int start_offset, int length, void * area, bool do_fetch, TDE_ALGORITHM tde_algo)
void * pgbuf_copy_to_area (THREAD_ENTRY * thread_p, const VPID * vpid, int start_offset, int length, void * area, bool do_fetch)
void pgbuf_daemons_destroy ()
void pgbuf_daemons_get_stats (UINT64 * stats_out)
void pgbuf_daemons_init ()
void pgbuf_dealloc_page (THREAD_ENTRY * thread_p, PAGE_PTR page_dealloc)
int pgbuf_dealloc_temp_page (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, bool need_free)
void pgbuf_direct_victims_maintenance (THREAD_ENTRY * thread_p)
void pgbuf_dump_if_any_fixed (void)
void pgbuf_finalize (void)
PAGE_PTR pgbuf_fix_debug (THREAD_ENTRY * thread_p, const VPID * vpid, PAGE_FETCH_MODE fetch_mode, PGBUF_LATCH_MODE request_mode, PGBUF_LATCH_CONDITION condition, const char * caller_file, int caller_line, const char * caller_func)
int pgbuf_fix_if_not_deallocated_with_caller (THREAD_ENTRY * thread_p, const VPID * vpid, PGBUF_LATCH_MODE latch_mode, PGBUF_LATCH_CONDITION latch_condition, PAGE_PTR * page, const char * caller_file, int caller_line, const char * caller_func)
PAGE_PTR pgbuf_fix_with_retry (THREAD_ENTRY * thread_p, const VPID * vpid, PAGE_FETCH_MODE fetch_mode, PGBUF_LATCH_MODE request_mode, int retry)
void pgbuf_flush (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, bool free_page)
int pgbuf_flush_all (THREAD_ENTRY * thread_p, VOLID volid)
int pgbuf_flush_all_unfixed (THREAD_ENTRY * thread_p, VOLID volid)
int pgbuf_flush_all_unfixed_and_set_lsa_as_null (THREAD_ENTRY * thread_p, VOLID volid)
int pgbuf_flush_checkpoint (THREAD_ENTRY * thread_p, const LOG_LSA * flush_upto_lsa, const LOG_LSA * prev_chkpt_redo_lsa, LOG_LSA * smallest_lsa, int * flushed_page_cnt)
void pgbuf_flush_control_daemon_init ()
int pgbuf_flush_control_from_dirty_ratio (void)
void pgbuf_flush_if_requested (THREAD_ENTRY * thread_p, PAGE_PTR page)
int pgbuf_flush_victim_candidates (THREAD_ENTRY * thread_p, float flush_ratio, PERF_UTIME_TRACKER * perf_tracker, bool * stop)
PAGE_PTR pgbuf_flush_with_wal (THREAD_ENTRY * thread_p, PAGE_PTR pgptr)
void pgbuf_force_to_check_for_interrupts (void)
int pgbuf_get_condition_for_ordered_fix (const VPID * vpid_new_page, const VPID * vpid_fixed_page, const HFID * hfid)
int pgbuf_get_fix_count (PAGE_PTR pgptr)
int pgbuf_get_hold_count (THREAD_ENTRY * thread_p)
PGBUF_LATCH_MODE pgbuf_get_latch_mode (PAGE_PTR pgptr)
LOG_LSA * pgbuf_get_lsa (PAGE_PTR pgptr)
void pgbuf_get_page_flush_interval (bool & is_timed_wait, cubthread::delta_time & period)
PAGEID pgbuf_get_page_id (PAGE_PTR pgptr)
PAGE_TYPE pgbuf_get_page_ptype (THREAD_ENTRY * thread_p, PAGE_PTR pgptr)
PERF_PAGE_TYPE pgbuf_get_page_type_for_stat (THREAD_ENTRY * thread_p, PAGE_PTR pgptr)
TDE_ALGORITHM pgbuf_get_tde_algorithm (PAGE_PTR pgptr)
VOLID pgbuf_get_volume_id (PAGE_PTR pgptr)
const char * pgbuf_get_volume_label (PAGE_PTR pgptr)
void pgbuf_get_vpid (PAGE_PTR pgptr, VPID * vpid)
VPID * pgbuf_get_vpid_ptr (PAGE_PTR pgptr)
bool pgbuf_has_any_non_vacuum_waiters (PAGE_PTR pgptr)
bool pgbuf_has_any_waiters (PAGE_PTR pgptr)
bool pgbuf_has_perm_pages_fixed (THREAD_ENTRY * thread_p)
bool pgbuf_has_prevent_dealloc (PAGE_PTR pgptr)
unsigned int pgbuf_hash_vpid (const void * key_vpid, unsigned int htsize)
int pgbuf_initialize (void)
int pgbuf_invalidate_all_debug (THREAD_ENTRY * thread_p, VOLID volid, const char * caller_file, int caller_line)
int pgbuf_invalidate_debug (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, const char * caller_file, int caller_line)
bool pgbuf_is_io_stressful (void)
bool pgbuf_is_log_check_for_interrupts (THREAD_ENTRY * thread_p)
bool pgbuf_is_lsa_temporary (PAGE_PTR pgptr)
bool pgbuf_is_page_fixed_by_thread (THREAD_ENTRY * thread_p, const VPID * vpid_p)
DISK_ISVALID pgbuf_is_valid_page (THREAD_ENTRY * thread_p, const VPID * vpid, bool no_error)
bool pgbuf_keep_victim_flush_thread_running (void)
void pgbuf_log_new_page (THREAD_ENTRY * thread_p, PAGE_PTR page_new, int data_size, PAGE_TYPE ptype_new)
void pgbuf_log_redo_new_page (THREAD_ENTRY * thread_p, PAGE_PTR page_new, int data_size, PAGE_TYPE ptype_new)
void pgbuf_notify_vacuum_follows (THREAD_ENTRY * thread_p, PAGE_PTR page)
int pgbuf_ordered_fix_debug (THREAD_ENTRY * thread_p, const VPID * req_vpid, PAGE_FETCH_MODE fetch_mode, const PGBUF_LATCH_MODE request_mode, PGBUF_WATCHER * req_watcher, const char * caller_file, int caller_line, const char * caller_func)
void pgbuf_ordered_set_dirty_and_free (THREAD_ENTRY * thread_p, PGBUF_WATCHER * pg_watcher)
void pgbuf_ordered_unfix_debug (THREAD_ENTRY * thread_p, PGBUF_WATCHER * watcher_object, const char * caller_file, int caller_line, const char * caller_func)
void pgbuf_page_flush_daemon_init ()
void pgbuf_page_maintenance_daemon_init ()
void pgbuf_page_post_flush_daemon_init ()
void pgbuf_peek_stats (UINT64 * fixed_cnt, UINT64 * dirty_cnt, UINT64 * lru1_cnt, UINT64 * lru2_cnt, UINT64 * lru3_cnt, UINT64 * victim_candidates, UINT64 * avoid_dealloc_cnt, UINT64 * avoid_victim_cnt, UINT64 * private_quota, UINT64 * private_cnt, UINT64 * alloc_bcb_waiter_high, UINT64 * alloc_bcb_waiter_med, UINT64 * flushed_bcbs_waiting_direct_assign, UINT64 * lfcq_big_prv_num, UINT64 * lfcq_prv_num, UINT64 * lfcq_shr_num)
int pgbuf_promote_read_latch_debug (THREAD_ENTRY * thread_p, PAGE_PTR * pgptr_p, PGBUF_PROMOTE_CONDITION condition, const char * caller_file, int caller_line, const char * caller_func)
int pgbuf_release_private_lru (THREAD_ENTRY * thread_p, const int private_idx)
void pgbuf_replace_watcher_debug (THREAD_ENTRY * thread_p, PGBUF_WATCHER * old_watcher, PGBUF_WATCHER * new_watcher, const char * caller_file, const int caller_line)
void pgbuf_reset_temp_lsa (PAGE_PTR pgptr)
int pgbuf_rv_dealloc_redo (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int pgbuf_rv_dealloc_undo (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int pgbuf_rv_dealloc_undo_compensate (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int pgbuf_rv_flush_page (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
void pgbuf_rv_flush_page_dump (FILE * fp, int length, void * data)
int pgbuf_rv_new_page_redo (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int pgbuf_rv_new_page_undo (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int pgbuf_rv_set_tde_algorithm (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
void pgbuf_set_dirty_debug (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, bool free_page, const char * caller_file, int caller_line, const char * caller_func)
void pgbuf_set_lsa_as_temporary (THREAD_ENTRY * thread_p, PAGE_PTR pgptr)
const LOG_LSA * pgbuf_set_lsa_debug (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, const LOG_LSA * lsa_ptr, const char * caller_file, int caller_line, const char * caller_func)
void pgbuf_set_page_ptype (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, PAGE_TYPE ptype)
void pgbuf_set_tde_algorithm (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, TDE_ALGORITHM tde_algo, bool skip_logging)
PAGE_PTR pgbuf_simple_fix (THREAD_ENTRY * thread_p, const VPID * vpid, bool need_fix)
void pgbuf_simple_unfix (THREAD_ENTRY * thread_p, PAGE_PTR pgptr)
int pgbuf_start_scan (THREAD_ENTRY * thread_p, int type, DB_VALUE ** arg_values, int arg_cnt, void ** ptr)
void pgbuf_thread_variables_init (THREAD_ENTRY * thread_p)
void pgbuf_unfix_all (THREAD_ENTRY * thread_p)
void pgbuf_unfix_debug (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, const char * caller_file, int caller_line, const char * caller_func)
void pgbuf_watcher_init_debug (PGBUF_WATCHER * watcher, const char * caller_file, const int caller_line, bool add)

Public Static Functions

Type Name
bool PGBUF_THREAD_HAS_PRIVATE_LRU (THREAD_ENTRY * thread_p)
void add_fcnt (PGBUF_ATOMIC_LATCH * latch, int cnt)
void copy_bcb (PGBUF_BCB * dest_bcb, PGBUF_BCB * src_bcb)
int get_fcnt (PGBUF_ATOMIC_LATCH * latch)
PGBUF_ATOMIC_LATCH_IMPL get_impl (PGBUF_ATOMIC_LATCH * latch)
PGBUF_LATCH_MODE get_latch (PGBUF_ATOMIC_LATCH * latch)
bool get_waiter_exists (PGBUF_ATOMIC_LATCH * latch)
void pgbuf_add_bufptr_to_batch (PGBUF_BCB * bufptr, int idx)
void pgbuf_add_fixed_at (PGBUF_HOLDER * holder, const char * caller_file, int caller_line, bool reset)
void pgbuf_add_vpid_to_aout_list (THREAD_ENTRY * thread_p, const VPID * vpid, const int lru_idx)
void pgbuf_add_watch_instance_internal (PGBUF_HOLDER * holder, PAGE_PTR pgptr, PGBUF_WATCHER * watcher, const PGBUF_LATCH_MODE latch_mode, const bool clear_unfix_flag, const char * caller_file, const int caller_line)
PGBUF_BCB * pgbuf_allocate_bcb (THREAD_ENTRY * thread_p, const VPID * src_vpid)
PGBUF_HOLDER * pgbuf_allocate_thrd_holder_entry (THREAD_ENTRY * thread_p)
bool pgbuf_assign_direct_victim (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
bool pgbuf_bcb_avoid_victim (const PGBUF_BCB * bcb)
void pgbuf_bcb_change_zone (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, int lru_idx, PGBUF_ZONE zone)
void pgbuf_bcb_check_and_reset_fix_and_avoid_dealloc (PGBUF_BCB * bcb, const char * file, int line)
void pgbuf_bcb_clear_dirty (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
int pgbuf_bcb_flush_with_wal (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, bool is_page_flush_thread, bool * is_bcb_locked)
int pgbuf_bcb_get_lru_index (const PGBUF_BCB * bcb)
int pgbuf_bcb_get_pool_index (const PGBUF_BCB * bcb)
PGBUF_ZONE pgbuf_bcb_get_zone (const PGBUF_BCB * bcb)
bool pgbuf_bcb_is_async_flush_request (const PGBUF_BCB * bcb)
bool pgbuf_bcb_is_direct_victim (const PGBUF_BCB * bcb)
bool pgbuf_bcb_is_dirty (const PGBUF_BCB * bcb)
bool pgbuf_bcb_is_flushing (const PGBUF_BCB * bcb)
bool pgbuf_bcb_is_hot (const PGBUF_BCB * bcb)
bool pgbuf_bcb_is_invalid_direct_victim (const PGBUF_BCB * bcb)
bool pgbuf_bcb_is_to_vacuum (const PGBUF_BCB * bcb)
bool pgbuf_bcb_mark_is_flushing (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
void pgbuf_bcb_mark_was_flushed (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
void pgbuf_bcb_mark_was_not_flushed (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, bool mark_dirty)
void pgbuf_bcb_register_avoid_deallocation (PGBUF_BCB * bcb)
void pgbuf_bcb_register_fix (PGBUF_BCB * bcb)
void pgbuf_bcb_register_hit_for_lru (PGBUF_BCB * bcb)
int pgbuf_bcb_safe_flush_force_lock (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, bool synchronous)
int pgbuf_bcb_safe_flush_force_unlock (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, bool synchronous)
int pgbuf_bcb_safe_flush_internal (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, bool synchronous, bool * locked)
void pgbuf_bcb_set_dirty (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
bool pgbuf_bcb_should_avoid_deallocation (const PGBUF_BCB * bcb)
bool pgbuf_bcb_should_be_moved_to_bottom_lru (const PGBUF_BCB * bcb)
void pgbuf_bcb_unregister_avoid_deallocation (PGBUF_BCB * bcb)
void pgbuf_bcb_update_flags (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, int set_flags, int clear_flags)
void pgbuf_bcbmon_check_mutex_leaks (void)
void pgbuf_bcbmon_check_own (PGBUF_BCB * bcb)
void pgbuf_bcbmon_lock (PGBUF_BCB * bcb, int caller_line)
int pgbuf_bcbmon_trylock (PGBUF_BCB * bcb, int caller_line)
void pgbuf_bcbmon_unlock (PGBUF_BCB * bcb)
int pgbuf_block_bcb (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, PGBUF_LATCH_MODE request_mode, int request_fcnt, bool as_promote)
bool pgbuf_check_bcb_page_vpid (PGBUF_BCB * bufptr, bool maybe_deallocated)
bool pgbuf_check_page_ptype_internal (PAGE_PTR pgptr, PAGE_TYPE ptype, bool no_error)
PGBUF_BCB * pgbuf_claim_bcb_for_fix (THREAD_ENTRY * thread_p, const VPID * vpid, PAGE_FETCH_MODE fetch_mode, PGBUF_BUFFER_HASH * hash_anchor, PGBUF_FIX_PERF * perf, bool * try_again, bool already_locked)
int pgbuf_compare_hold_vpid_for_sort (const void * p1, const void * p2)
int pgbuf_compare_victim_list (const void * p1, const void * p2)
void pgbuf_compute_lru_vict_target (float * lru_sum_flush_priority)
const char * pgbuf_consistent_str (int consistent)
int pgbuf_delete_from_hash_chain (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
void pgbuf_dump (void)
int pgbuf_find_current_wait_msecs (THREAD_ENTRY * thread_p)
PGBUF_HOLDER * pgbuf_find_thrd_holder (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
void pgbuf_flags_mask_sanity_check (void)
int pgbuf_flush_all_helper (THREAD_ENTRY * thread_p, VOLID volid, bool is_only_fixed, bool is_set_lsa_as_null)
int pgbuf_flush_chkpt_seq_list (THREAD_ENTRY * thread_p, PGBUF_SEQ_FLUSHER * seq_flusher, const LOG_LSA * prev_chkpt_redo_lsa, LOG_LSA * chkpt_smallest_lsa)
int pgbuf_flush_neighbor_safe (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, VPID * expected_vpid, bool * flushed)
int pgbuf_flush_page_and_neighbors_fb (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, int * flushed_pages)
int pgbuf_flush_seq_list (THREAD_ENTRY * thread_p, PGBUF_SEQ_FLUSHER * seq_flusher, struct timeval * limit_time, const LOG_LSA * prev_chkpt_redo_lsa, LOG_LSA * chkpt_smallest_lsa, int * time_rem)
PGBUF_BCB * pgbuf_get_bcb_from_invalid_list (THREAD_ENTRY * thread_p)
bool pgbuf_get_check_page_validation_level (int page_validation_level)
PGBUF_BCB * pgbuf_get_direct_victim (THREAD_ENTRY * thread_p)
int pgbuf_get_groupid_and_unfix (THREAD_ENTRY * thread_p, const VPID * req_vpid, PAGE_PTR * pgptr, VPID * groupid, bool do_unfix)
PGBUF_HOLDER * pgbuf_get_holder (THREAD_ENTRY * thread_p, PAGE_PTR pgptr)
int pgbuf_get_shared_lru_index_for_add (void)
bool pgbuf_get_thread_waiting_for_direct_victim (REFPTR(THREAD_ENTRY, waiting_thread_out))
PGBUF_BCB * pgbuf_get_victim (THREAD_ENTRY * thread_p)
int pgbuf_get_victim_candidates_from_lru (THREAD_ENTRY * thread_p, int check_count, float lru_sum_flush_priority, bool * assigned_directly)
PGBUF_BCB * pgbuf_get_victim_from_lru_list (THREAD_ENTRY * thread_p, const int lru_idx)
unsigned int pgbuf_hash_func_mirror (const VPID * vpid)
void pgbuf_init_temp_page_lsa (FILEIO_PAGE * io_page, PGLENGTH page_size)
int pgbuf_initialize_aout_list (void)
int pgbuf_initialize_bcb_table (void)
int pgbuf_initialize_hash_table (void)
int pgbuf_initialize_invalid_list (void)
int pgbuf_initialize_lock_table (void)
int pgbuf_initialize_lru_list (void)
int pgbuf_initialize_page_monitor (void)
int pgbuf_initialize_page_quota (void)
int pgbuf_initialize_page_quota_parameters (void)
int pgbuf_initialize_seq_flusher (PGBUF_SEQ_FLUSHER * seq_flusher, PGBUF_VICTIM_CANDIDATE_LIST * f_list, const int cnt)
int pgbuf_initialize_thrd_holder (void)
int pgbuf_insert_into_hash_chain (THREAD_ENTRY * thread_p, PGBUF_BUFFER_HASH * hash_anchor, PGBUF_BCB * bufptr)
int pgbuf_invalidate_bcb (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
bool pgbuf_is_any_thread_waiting_for_direct_victim (void)
bool pgbuf_is_bcb_fixed_by_any (PGBUF_BCB * bcb, bool has_mutex_lock)
bool pgbuf_is_bcb_victimizable (PGBUF_BCB * bcb, bool has_mutex_lock)
int pgbuf_is_consistent (const PGBUF_BCB * bufptr, int likely_bad_after_fixcnt)
bool pgbuf_is_exist_blocked_reader_writer (PGBUF_BCB * bufptr)
bool pgbuf_is_hit_ratio_low (void)
bool pgbuf_is_page_flush_daemon_available ()
bool pgbuf_is_temp_lsa (const log_lsa & lsa)
bool pgbuf_is_temporary_volume (VOLID volid)
bool pgbuf_is_thread_high_priority (THREAD_ENTRY * thread_p)
bool pgbuf_is_valid_page_ptr (const PAGE_PTR pgptr)
int pgbuf_latch_bcb_upon_fix (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, PGBUF_LATCH_MODE request_mode, int buf_lock_acquired, PGBUF_LATCH_CONDITION condition, bool * is_latch_wait)
const char * pgbuf_latch_mode_str (PGBUF_LATCH_MODE latch_mode)
bool pgbuf_lfcq_add_lru_with_victims (PGBUF_LRU_LIST * lru_list)
void pgbuf_lfcq_assign_direct_victims (THREAD_ENTRY * thread_p, int lru_idx, int * nassign_inout)
PGBUF_BCB * pgbuf_lfcq_get_victim_from_private_lru (THREAD_ENTRY * thread_p, bool restricted)
PGBUF_BCB * pgbuf_lfcq_get_victim_from_shared_lru (THREAD_ENTRY * thread_p, bool multi_threaded)
int pgbuf_lock_page (THREAD_ENTRY * thread_p, PGBUF_BUFFER_HASH * hash_anchor, const VPID * vpid)
PAGE_PTR pgbuf_lockfree_fix_ro (THREAD_ENTRY * thread_p, const VPID * vpid, PAGE_FETCH_MODE fetch_mode)
bool pgbuf_lockfree_unfix_ro (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
void pgbuf_lru_add_bcb_to_bottom (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, PGBUF_LRU_LIST * lru_list)
void pgbuf_lru_add_bcb_to_middle (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, PGBUF_LRU_LIST * lru_list)
void pgbuf_lru_add_bcb_to_top (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, PGBUF_LRU_LIST * lru_list)
void pgbuf_lru_add_new_bcb_to_bottom (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, int lru_idx)
void pgbuf_lru_add_new_bcb_to_middle (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, int lru_idx)
void pgbuf_lru_add_new_bcb_to_top (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, int lru_idx)
void pgbuf_lru_add_victim_candidate (THREAD_ENTRY * thread_p, PGBUF_LRU_LIST * lru_list, PGBUF_BCB * bcb)
void pgbuf_lru_adjust_zone1 (THREAD_ENTRY * thread_p, PGBUF_LRU_LIST * lru_list, bool min_one)
void pgbuf_lru_adjust_zone2 (THREAD_ENTRY * thread_p, PGBUF_LRU_LIST * lru_list, bool min_one)
void pgbuf_lru_adjust_zones (THREAD_ENTRY * thread_p, PGBUF_LRU_LIST * lru_list, bool min_one)
void pgbuf_lru_advance_victim_hint (THREAD_ENTRY * thread_p, PGBUF_LRU_LIST * lru_list, PGBUF_BCB * bcb_prev_hint, PGBUF_BCB * bcb_new_hint, bool was_vict_count_updated)
void pgbuf_lru_boost_bcb (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
void pgbuf_lru_fall_bcb_to_zone_3 (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, PGBUF_LRU_LIST * lru_list)
PGBUF_LRU_LIST * pgbuf_lru_list_from_bcb (const PGBUF_BCB * bcb)
void pgbuf_lru_move_from_private_to_shared (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
void pgbuf_lru_remove_bcb (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
void pgbuf_lru_remove_victim_candidate (THREAD_ENTRY * thread_p, PGBUF_LRU_LIST * lru_list, PGBUF_BCB * bcb)
void pgbuf_lru_sanity_check (const PGBUF_LRU_LIST * lru)
void pgbuf_move_bcb_to_bottom_lru (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
void pgbuf_page_maintenance_execute (cubthread::entry & thread_ref)
void pgbuf_page_post_flush_execute (cubthread::entry & thread_ref)
int pgbuf_panic_assign_direct_victims_from_lru (THREAD_ENTRY * thread_p, PGBUF_LRU_LIST * lru_list, PGBUF_BCB * bcb_start)
int pgbuf_put_bcb_into_invalid_list (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
void pgbuf_remove_from_lru_list (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, PGBUF_LRU_LIST * lru_list)
int pgbuf_remove_private_from_aout_list (const int lru_idx)
int pgbuf_remove_thrd_holder (THREAD_ENTRY * thread_p, PGBUF_HOLDER * holder)
int pgbuf_remove_vpid_from_aout_list (THREAD_ENTRY * thread_p, const VPID * vpid)
void pgbuf_remove_watcher (PGBUF_HOLDER * holder, PGBUF_WATCHER * watcher_object)
void pgbuf_scan_bcb_table (THREAD_ENTRY * thread_p)
void pgbuf_scan_bcb_table ()
void pgbuf_scramble (FILEIO_PAGE * iopage)
PGBUF_BCB * pgbuf_search_hash_chain (THREAD_ENTRY * thread_p, PGBUF_BUFFER_HASH * hash_anchor, const VPID * vpid)
PGBUF_BCB * pgbuf_search_hash_chain_no_bcb_lock (THREAD_ENTRY * thread_p, PGBUF_BUFFER_HASH * hash_anchor, const VPID * vpid)
void pgbuf_set_bcb_page_vpid (PGBUF_BCB * bufptr)
void pgbuf_set_dirty_buffer_ptr (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
bool pgbuf_should_move_private_to_shared (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, int thread_private_lru_index)
void pgbuf_sleep (THREAD_ENTRY * thread_p, pthread_mutex_t * mutex_p)
int pgbuf_timed_sleep (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
int pgbuf_timed_sleep_error_handling (THREAD_ENTRY * thrd_entry, PGBUF_BCB * bufptr)
int pgbuf_unlatch_bcb_upon_unfix (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, int holder_status)
int pgbuf_unlatch_thrd_holder (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr, PGBUF_HOLDER_STAT * holder_perf_stat_p)
void pgbuf_unlatch_void_zone_bcb (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb, int thread_private_lru_index)
int pgbuf_unlock_page (THREAD_ENTRY * thread_p, PGBUF_BUFFER_HASH * hash_anchor, const VPID * vpid, int need_hash_mutex)
int pgbuf_victimize_bcb (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
void pgbuf_wake_flush_waiters (THREAD_ENTRY * thread_p, PGBUF_BCB * bcb)
int pgbuf_wakeup (THREAD_ENTRY * thread_p)
void pgbuf_wakeup_page_flush_daemon (THREAD_ENTRY * thread_p)
void pgbuf_wakeup_reader_writer (THREAD_ENTRY * thread_p, PGBUF_BCB * bufptr)
int pgbuf_wakeup_uncond (THREAD_ENTRY * thread_p)
const char * pgbuf_zone_str (PGBUF_ZONE zone)
void set_latch (PGBUF_ATOMIC_LATCH * latch, PGBUF_LATCH_MODE latch_mode)
void set_latch_and_add_fcnt (PGBUF_ATOMIC_LATCH * latch, PGBUF_LATCH_MODE latch_mode, int cnt)
void set_latch_and_fcnt (PGBUF_ATOMIC_LATCH * latch, PGBUF_LATCH_MODE latch_mode, int cnt)
void set_waiter_exists (PGBUF_ATOMIC_LATCH * latch, bool waiter_exists)

Macros

Type Name
define AOUT_HASH_DIVIDE_RATIO 1000
define AOUT_HASH_IDX (vpid, list) (([**vpid**](structvpid.md))-&gt;pageid % list-&gt;num\_hashes)
define CAST_BFPTR_TO_PGPTR (pgptr, bufptr) /* multi line expression */
define CAST_IOPGPTR_TO_PGPTR (pgptr, io_pgptr) /* multi line expression */
define CAST_PGPTR_TO_BFPTR (bufptr, pgptr) /* multi line expression */
define CAST_PGPTR_TO_IOPGPTR (io_pgptr, pgptr) /* multi line expression */
define DEFAULT_ASSIGNS_PER_ITERATION 5
define HASH_SIZE_BITS 20
define INIT_HOLDER_STAT (perf_stat) /* multi line expression */
define MAX_DEPTH 1000
define MAX_DEPTH 1000
define MAX_PRIVATE_RATIO 0.998f
define MIN_PRIVATE_RATIO 0.01f
define PAGE_ADD_REFRESH_STAT [**MAX**](broker__monitor_8c.md#function-timeout) (2 \* pgbuf\_Pool.num\_buffers / [**PGBUF\_SHARED\_LRU\_COUNT**](page__buffer_8c.md#define-pgbuf_shared_lru_count), 10000)
define PBGUF_BIG_PRIVATE_MIN_SIZE 100
define PERF (id) [**if**](dynamic__load_8c.md#function-if) ([**detailed\_perf**](broker__monitor_8c.md#function-timeout)) [**perfmon\_inc\_stat**](perf__monitor_8h.md#function-perfmon_inc_stat) (thread\_p, [**id**](thread__worker__pool__impl_8hpp.md#enum-id))
define PERF (pstatid) [**if**](dynamic__load_8c.md#function-if) ([**perf\_tracking**](broker__monitor_8c.md#function-timeout)) [**perfmon\_inc\_stat**](perf__monitor_8h.md#function-perfmon_inc_stat) (thread\_p, [**pstatid**](broker__monitor_8c.md#function-timeout))
define PERF (id) [**if**](dynamic__load_8c.md#function-if) ([**detailed\_perf**](broker__monitor_8c.md#function-timeout)) [**perfmon\_inc\_stat**](perf__monitor_8h.md#function-perfmon_inc_stat) (thread\_p, [**id**](thread__worker__pool__impl_8hpp.md#enum-id))
define PERF (id) [**if**](dynamic__load_8c.md#function-if) ([**detailed\_perf**](broker__monitor_8c.md#function-timeout)) [**perfmon\_inc\_stat**](perf__monitor_8h.md#function-perfmon_inc_stat) (thread\_p, [**id**](thread__worker__pool__impl_8hpp.md#enum-id))
define PGBUF_ABORT_RELEASE () [**assert**](malloc__2__8__3_8c.md#define-assert) ([**false**](broker__monitor_8c.md#function-timeout))
define PGBUF_AGE_DIFF (bcb_age, list_age) ((([**list\_age**](broker__monitor_8c.md#function-timeout)) &gt;= ([**bcb\_age**](broker__monitor_8c.md#function-timeout))) ? (([**list\_age**](broker__monitor_8c.md#function-timeout)) - ([**bcb\_age**](broker__monitor_8c.md#function-timeout))) : ([**DB\_INT32\_MAX**](dbtype__def_8h.md#define-db_int32_max) - (([**bcb\_age**](broker__monitor_8c.md#function-timeout)) - ([**list\_age**](broker__monitor_8c.md#function-timeout)))))
define PGBUF_AOUT_NOT_FOUND -2
define PGBUF_BCB_ASYNC_FLUSH_REQ (([**int**](broker__monitor_8c.md#function-timeout)) 0x02000000)
define PGBUF_BCB_AVOID_DEALLOC_MASK (([**int**](broker__monitor_8c.md#function-timeout)) 0x0000FFFF)
define PGBUF_BCB_CHECK_MUTEX_LEAKS () [**if**](dynamic__load_8c.md#function-if) ([**pgbuf\_Monitor\_locks**](page__buffer_8c.md#variable-pgbuf_monitor_locks)) [**pgbuf\_bcbmon\_check\_mutex\_leaks**](page__buffer_8c.md#function-pgbuf_bcbmon_check_mutex_leaks) ()
define PGBUF_BCB_CHECK_OWN (bcb) [**if**](dynamic__load_8c.md#function-if) ([**pgbuf\_Monitor\_locks**](page__buffer_8c.md#variable-pgbuf_monitor_locks)) [**pgbuf\_bcbmon\_check\_own**](page__buffer_8c.md#function-pgbuf_bcbmon_check_own) (bcb)
define PGBUF_BCB_COUNT_FIX_SHIFT_BITS 16
define PGBUF_BCB_DIRTY_FLAG (([**int**](broker__monitor_8c.md#function-timeout)) 0x80000000)
define PGBUF_BCB_FLAGS_MASK /* multi line expression */
define PGBUF_BCB_FLUSHING_TO_DISK_FLAG (([**int**](broker__monitor_8c.md#function-timeout)) 0x40000000)
define PGBUF_BCB_INIT_FLAGS PGBUF\_INVALID\_ZONE
define PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG (([**int**](broker__monitor_8c.md#function-timeout)) 0x10000000)
define PGBUF_BCB_INVALID_VICTIM_CANDIDATE_MASK /* multi line expression */
define PGBUF_BCB_LOCK (bcb) ([**pgbuf\_Monitor\_locks**](page__buffer_8c.md#variable-pgbuf_monitor_locks) ? [**pgbuf\_bcbmon\_lock**](page__buffer_8c.md#function-pgbuf_bcbmon_lock) (bcb, [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) : ([**void**](broker__monitor_8c.md#function-timeout)) [**pthread\_mutex\_lock**](broker__monitor_8c.md#function-timeout) (&(bcb)-&gt;mutex))
define PGBUF_BCB_MOVE_TO_LRU_BOTTOM_FLAG (([**int**](broker__monitor_8c.md#function-timeout)) 0x08000000)
define PGBUF_BCB_SIZEOF ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**PGBUF\_BCB**](page__buffer_8c.md#typedef-pgbuf_bcb)))
define PGBUF_BCB_TO_VACUUM_FLAG (([**int**](broker__monitor_8c.md#function-timeout)) 0x04000000)
define PGBUF_BCB_TRYLOCK (bcb) ([**pgbuf\_Monitor\_locks**](page__buffer_8c.md#variable-pgbuf_monitor_locks) ? [**pgbuf\_bcbmon\_trylock**](page__buffer_8c.md#function-pgbuf_bcbmon_trylock) (bcb, [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) : [**pthread\_mutex\_trylock**](broker__monitor_8c.md#function-timeout) (&(bcb)-&gt;mutex))
define PGBUF_BCB_UNLOCK (bcb) ([**pgbuf\_Monitor\_locks**](page__buffer_8c.md#variable-pgbuf_monitor_locks) ? [**pgbuf\_bcbmon\_unlock**](page__buffer_8c.md#function-pgbuf_bcbmon_unlock) (bcb) : ([**void**](broker__monitor_8c.md#function-timeout)) [**pthread\_mutex\_unlock**](broker__monitor_8c.md#function-timeout) (&(bcb)-&gt;mutex))
define PGBUF_BCB_VICTIM_DIRECT_FLAG (([**int**](broker__monitor_8c.md#function-timeout)) 0x20000000)
define PGBUF_BUFFER_HASH_SIZEOF ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**PGBUF\_BUFFER\_HASH**](page__buffer_8c.md#typedef-pgbuf_buffer_hash)))
define PGBUF_BUFFER_LOCK_SIZEOF ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**PGBUF\_BUFFER\_LOCK**](page__buffer_8c.md#typedef-pgbuf_buffer_lock)))
define PGBUF_CHKPT_BURST_PAGES 16
define PGBUF_CHKPT_MAX_FLUSH_RATE 1200
define PGBUF_CHKPT_MIN_FLUSH_RATE 50
define PGBUF_DEFAULT_FIX_COUNT 7
define PGBUF_DESIRED_HIT_VS_MISS_RATE 1000 /\* 99.9% hit [**ratio**](mprec_8h.md#define-ratio) \*/
define PGBUF_FIND_BCB_PTR (i) (([**PGBUF\_BCB**](page__buffer_8c.md#typedef-pgbuf_bcb) \*) (([**char**](broker__monitor_8c.md#function-timeout) \*) &(pgbuf\_Pool.BCB\_table[0]) + ([**PGBUF\_BCB\_SIZEOF**](page__buffer_8c.md#define-pgbuf_bcb_sizeof) \* ([**i**](dynamic__load_8c.md#variable-i)))))
define PGBUF_FIND_BUFFER_GUARD (bufptr) (&bufptr-&gt;iopage\_buffer-&gt;iopage.page[[**DB\_PAGESIZE**](storage__common_8h.md#define-db_pagesize)])
define PGBUF_FIND_IOPAGE_PTR (i) (([**PGBUF\_IOPAGE\_BUFFER**](page__buffer_8c.md#typedef-pgbuf_iopage_buffer) \*) (([**char**](broker__monitor_8c.md#function-timeout) \*) &(pgbuf\_Pool.iopage\_table[0]) + ([**PGBUF\_IOPAGE\_BUFFER\_SIZE**](page__buffer_8c.md#define-pgbuf_iopage_buffer_size) \* ([**i**](dynamic__load_8c.md#variable-i)))))
define PGBUF_FIND_IOPAGE_PTR_FROM_EXTERNAL_ALLOCATE (alloc_memory, i) (([**PGBUF\_IOPAGE\_BUFFER**](page__buffer_8c.md#typedef-pgbuf_iopage_buffer) \*) (([**char**](broker__monitor_8c.md#function-timeout) \*) ([**alloc\_memory**](broker__monitor_8c.md#function-timeout)) + ([**PGBUF\_IOPAGE\_BUFFER\_SIZE**](page__buffer_8c.md#define-pgbuf_iopage_buffer_size) \* ([**i**](dynamic__load_8c.md#variable-i)))))
define PGBUF_FIX_COUNT_THRESHOLD 64 /\* fix count threshold. used [**as**](broker__monitor_8c.md#function-timeout) [**indicator**](broker__monitor_8c.md#function-timeout) [**for**](dynamic__load_8c.md#function-for) [**hot**](broker__monitor_8c.md#function-timeout) pages. \*/
define PGBUF_FLUSHED_BCBS_BUFFER_SIZE (8 \* 1024) /\* 8[**k**](broker__monitor_8c.md#function-timeout) \*/
define PGBUF_FLUSH_VICTIM_BOOST_MULT 10
define PGBUF_GET_LRU_INDEX (flags) ((flags) & [**PGBUF\_LRU\_INDEX\_MASK**](page__buffer_8c.md#define-pgbuf_lru_index_mask))
define PGBUF_GET_LRU_LIST (lru_idx) (&pgbuf\_Pool.buf\_LRU\_list[lru\_idx])
define PGBUF_GET_ZONE (flags) (([**PGBUF\_ZONE**](page__buffer_8c.md#enum-pgbuf_zone)) ((flags) & PGBUF\_ZONE\_MASK))
define PGBUF_HASH_SIZE (1 &lt;&lt; [**HASH\_SIZE\_BITS**](page__buffer_8c.md#define-hash_size_bits))
define PGBUF_HASH_VALUE (vpid) [**pgbuf\_hash\_func\_mirror**](page__buffer_8c.md#function-pgbuf_hash_func_mirror)([**vpid**](structvpid.md))
define PGBUF_HOLDER_ANCHOR_SIZEOF ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**PGBUF\_HOLDER\_ANCHOR**](page__buffer_8c.md#typedef-pgbuf_holder_anchor)))
define PGBUF_HOLDER_SET_SIZEOF ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**PGBUF\_HOLDER\_SET**](page__buffer_8c.md#typedef-pgbuf_holder_set)))
define PGBUF_HOLDER_SIZEOF ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**PGBUF\_HOLDER**](page__buffer_8c.md#typedef-pgbuf_holder)))
define PGBUF_IOPAGE_BUFFER_SIZE /* multi line expression */
define PGBUF_IS_AUXILIARY_VOLUME (volid) ((volid) &lt; [**LOG\_DBFIRST\_VOLID**](log__volids_8hpp.md#variable-log_dbfirst_volid) ? [**true**](broker__monitor_8c.md#function-timeout) : [**false**](broker__monitor_8c.md#function-timeout))
define PGBUF_IS_BCB_IN_LRU (bcb) (([**pgbuf\_bcb\_get\_zone**](page__buffer_8c.md#function-pgbuf_bcb_get_zone) (bcb) & PGBUF\_LRU\_ZONE\_MASK) != 0)
define PGBUF_IS_BCB_IN_LRU_VICTIM_ZONE (bcb) ([**pgbuf\_bcb\_get\_zone**](page__buffer_8c.md#function-pgbuf_bcb_get_zone) (bcb) == PGBUF\_LRU\_3\_ZONE)
define PGBUF_IS_BCB_OLD_ENOUGH (bcb, lru_list) ([**PGBUF\_AGE\_DIFF**](page__buffer_8c.md#define-pgbuf_age_diff) ((bcb)-&gt;tick\_lru\_list, ([**lru\_list**](broker__monitor_8c.md#function-timeout))-&gt;tick\_list) &gt;= (([**lru\_list**](broker__monitor_8c.md#function-timeout))-&gt;count\_lru2 / 2))
define PGBUF_IS_PRIVATE_LRU_INDEX (lru_idx) ((lru\_idx) &gt;= [**PGBUF\_SHARED\_LRU\_COUNT**](page__buffer_8c.md#define-pgbuf_shared_lru_count))
define PGBUF_IS_PRIVATE_LRU_ONE_TWO_OVER_QUOTA (lru_idx) ([**PGBUF\_IS\_PRIVATE\_LRU\_INDEX**](page__buffer_8c.md#define-pgbuf_is_private_lru_index) (lru\_idx) && [**PGBUF\_LRU\_LIST\_IS\_ONE\_TWO\_OVER\_QUOTA**](page__buffer_8c.md#define-pgbuf_lru_list_is_one_two_over_quota) ([**PGBUF\_GET\_LRU\_LIST**](page__buffer_8c.md#define-pgbuf_get_lru_list) (lru\_idx)))
define PGBUF_IS_PRIVATE_LRU_OVER_QUOTA (lru_idx) ([**PGBUF\_IS\_PRIVATE\_LRU\_INDEX**](page__buffer_8c.md#define-pgbuf_is_private_lru_index) (lru\_idx) && [**PGBUF\_LRU\_LIST\_IS\_OVER\_QUOTA**](page__buffer_8c.md#define-pgbuf_lru_list_is_over_quota) ([**PGBUF\_GET\_LRU\_LIST**](page__buffer_8c.md#define-pgbuf_get_lru_list) (lru\_idx)))
define PGBUF_IS_SHARED_LRU_INDEX (lru_idx) ((lru\_idx) &lt; [**PGBUF\_SHARED\_LRU\_COUNT**](page__buffer_8c.md#define-pgbuf_shared_lru_count))
define PGBUF_LIMIT_AOUT_BUFFERS 32768
define PGBUF_LRU_ARE_ZONES_ONE_TWO_OVER_THRESHOLD (list) ((list)-&gt;threshold\_lru1 + (list)-&gt;threshold\_lru2 &lt; [**PGBUF\_LRU\_ZONE\_ONE\_TWO\_COUNT**](page__buffer_8c.md#define-pgbuf_lru_zone_one_two_count)(list))
define PGBUF_LRU_INDEX_FROM_PRIVATE (private_id) ([**PGBUF\_SHARED\_LRU\_COUNT**](page__buffer_8c.md#define-pgbuf_shared_lru_count) + ([**private\_id**](broker__monitor_8c.md#function-timeout)))
define PGBUF_LRU_INDEX_MASK ([**PGBUF\_LRU\_LIST\_MAX\_COUNT**](page__buffer_8c.md#define-pgbuf_lru_list_max_count) - 1) /\* 0x0000FFFF \*/
define PGBUF_LRU_IS_ZONE_ONE_OVER_THRESHOLD (list) ((list)-&gt;threshold\_lru1 &lt; (list)-&gt;count\_lru1)
define PGBUF_LRU_IS_ZONE_TWO_OVER_THRESHOLD (list) ((list)-&gt;threshold\_lru2 &lt; (list)-&gt;count\_lru2)
define PGBUF_LRU_LIST_COUNT (list) ([**PGBUF\_LRU\_ZONE\_ONE\_TWO\_COUNT**](page__buffer_8c.md#define-pgbuf_lru_zone_one_two_count)(list) + (list)-&gt;count\_lru3)
define PGBUF_LRU_LIST_IS_ONE_TWO_OVER_QUOTA (list) (([**PGBUF\_LRU\_ZONE\_ONE\_TWO\_COUNT**](page__buffer_8c.md#define-pgbuf_lru_zone_one_two_count) (list) &gt; (list)-&gt;quota))
define PGBUF_LRU_LIST_IS_OVER_QUOTA (list) ([**PGBUF\_LRU\_LIST\_COUNT**](page__buffer_8c.md#define-pgbuf_lru_list_count) (list) &gt; (list)-&gt;quota)
define PGBUF_LRU_LIST_IS_OVER_QUOTA_WITH_BUFFER (list) ([**PGBUF\_LRU\_LIST\_COUNT**](page__buffer_8c.md#define-pgbuf_lru_list_count) (list) &gt; (list)-&gt;quota + [**PGBUF\_OVER\_QUOTA\_BUFFER**](page__buffer_8c.md#define-pgbuf_over_quota_buffer) ((list)-&gt;quota))
define PGBUF_LRU_LIST_MAX_COUNT (([**int**](broker__monitor_8c.md#function-timeout)) 1 &lt;&lt; [**PGBUF\_LRU\_NBITS**](page__buffer_8c.md#define-pgbuf_lru_nbits)) /\* 64[**k**](broker__monitor_8c.md#function-timeout) \*/
define PGBUF_LRU_LIST_OVER_QUOTA_COUNT (list) ([**PGBUF\_LRU\_LIST\_COUNT**](page__buffer_8c.md#define-pgbuf_lru_list_count) (list) - (list)-&gt;quota)
define PGBUF_LRU_LIST_SIZEOF ([**sizeof**](broker__monitor_8c.md#function-timeout) ([**PGBUF\_LRU\_LIST**](page__buffer_8c.md#typedef-pgbuf_lru_list)))
define PGBUF_LRU_NBITS 16
define PGBUF_LRU_VICTIM_LFCQ_FLAG (([**int**](broker__monitor_8c.md#function-timeout)) 0x80000000)
define PGBUF_LRU_VICTIM_ZONE_COUNT (list) ((list)-&gt;count\_lru3)
define PGBUF_LRU_ZONE_MAX_RATIO 0.90f
define PGBUF_LRU_ZONE_MIN_RATIO 0.05f
define PGBUF_LRU_ZONE_ONE_TWO_COUNT (list) ((list)-&gt;count\_lru1 + (list)-&gt;count\_lru2)
define PGBUF_MAKE_ZONE (list_id, zone) ((list\_id) \| (zone))
define PGBUF_MAX_NEIGHBOR_PAGES 32
define PGBUF_MAX_PAGE_FIXED_BY_TRAN 64
define PGBUF_MAX_PAGE_WATCHERS 64
define PGBUF_MINIMUM_BUFFERS ([**MAX\_NTRANS**](log__common__impl_8h.md#define-max_ntrans) \* 10)
define PGBUF_MIN_PAGES_IN_SHARED_LIST 1000
define PGBUF_MIN_SHARED_LIST_ADJUST_SIZE 50
define PGBUF_MIN_VICTIM_REQ 10 /\* set [**a**](broker__monitor_8c.md#function-timeout) [**minimum**](broker__monitor_8c.md#function-timeout) number [**of**](broker__monitor_8c.md#function-timeout) [**requests**](broker__monitor_8c.md#function-timeout) \*/
define PGBUF_NEIGHBOR_FLUSH_NONDIRTY ([**prm\_get\_bool\_value**](system__parameter_8h.md#function-prm_get_bool_value) (PRM\_ID\_PB\_NEIGHBOR\_FLUSH\_NONDIRTY))
define PGBUF_NEIGHBOR_PAGES ([**prm\_get\_integer\_value**](system__parameter_8h.md#function-prm_get_integer_value) (PRM\_ID\_PB\_NEIGHBOR\_FLUSH\_PAGES))
define PGBUF_NEIGHBOR_POS (idx) ([**PGBUF\_NEIGHBOR\_PAGES**](page__buffer_8c.md#define-pgbuf_neighbor_pages) - 1 + (idx))
define PGBUF_NUM_ALLOC_HOLDER 10
define PGBUF_OVER_QUOTA_BUFFER (quota) [**MAX**](broker__monitor_8c.md#function-timeout) (10, ([**int**](broker__monitor_8c.md#function-timeout)) (quota \* 0.01f))
define PGBUF_PAGES_COUNT_THRESHOLD 4
define PGBUF_PAGE_QUOTA_IS_ENABLED (pgbuf\_Pool.quota.num\_private\_LRU\_list &gt; 0)
define PGBUF_PRIVATE_LIST_FROM_LRU_INDEX (i) (([**i**](dynamic__load_8c.md#variable-i)) - [**PGBUF\_SHARED\_LRU\_COUNT**](page__buffer_8c.md#define-pgbuf_shared_lru_count))
define PGBUF_PRIVATE_LRU_COUNT (pgbuf\_Pool.quota.num\_private\_LRU\_list)
define PGBUF_PRIVATE_LRU_FROM_THREAD (thread_p) ((thread\_p) != [**NULL**](freelistheap_8h.md#define-null)) ? ((thread\_p)-&gt;private\_lru\_index) : (0)
define PGBUF_PRIVATE_LRU_MAX_HARD_QUOTA 5000
define PGBUF_PRIVATE_LRU_MIN_COUNT 4
define PGBUF_SHARED_LRU_COUNT (pgbuf\_Pool.num\_LRU\_list)
define PGBUF_SHOULD_IGNORE_UNFIX (th, buf) [**VACUUM\_IS\_THREAD\_VACUUM\_WORKER**](vacuum_8h.md#define-vacuum_is_thread_vacuum_worker) ([**th**](broker__monitor_8c.md#function-timeout)) \|\| [**pgbuf\_is\_temporary\_volume**](page__buffer_8c.md#function-pgbuf_is_temporary_volume) (buf-&gt;[**vpid.volid**](structvpid.md#variable-volid))
define PGBUF_TOTAL_LRU_COUNT ([**PGBUF\_SHARED\_LRU\_COUNT**](page__buffer_8c.md#define-pgbuf_shared_lru_count) + [**PGBUF\_PRIVATE\_LRU\_COUNT**](page__buffer_8c.md#define-pgbuf_private_lru_count))
define PGBUF_TRAN_MAX_ACTIVITY (10 \* [**PGBUF\_TRAN\_THRESHOLD\_ACTIVITY**](page__buffer_8c.md#define-pgbuf_tran_threshold_activity))
define PGBUF_TRAN_THRESHOLD_ACTIVITY (pgbuf\_Pool.num\_buffers / 4)
define PGBUF_VACUUM_SHOULD_IGNORE_UNFIX (th) [**VACUUM\_IS\_THREAD\_VACUUM\_WORKER**](vacuum_8h.md#define-vacuum_is_thread_vacuum_worker) ([**th**](broker__monitor_8c.md#function-timeout))
define SIZEOF_IOPAGE_PAGESIZE_AND_GUARD () ([**IO\_PAGESIZE**](storage__common_8h.md#define-io_pagesize) + [**sizeof**](broker__monitor_8c.md#function-timeout) ([**pgbuf\_Guard**](page__buffer_8c.md#variable-pgbuf_guard)))
define UINT16MAX 65534
define VOLID_LSB_BITS 8
define WAIT_FLUSH_VICTIMS_MAX_MSEC 1500.0f
define detailed_er_log (...) [**if**](dynamic__load_8c.md#function-if) ([**detailed\_logging**](broker__monitor_8c.md#function-timeout)) [**\_er\_log\_debug**](error__manager_8c.md#function-_er_log_debug) ([**ARG\_FILE\_LINE**](error__manager_8h.md#define-arg_file_line), [**\_\_VA\_ARGS\_\_**](broker__monitor_8c.md#function-timeout))
define detailed_er_log (...) [**if**](dynamic__load_8c.md#function-if) ([**detailed\_logging**](broker__monitor_8c.md#function-timeout)) [**\_er\_log\_debug**](error__manager_8c.md#function-_er_log_debug) ([**ARG\_FILE\_LINE**](error__manager_8h.md#define-arg_file_line), [**\_\_VA\_ARGS\_\_**](broker__monitor_8c.md#function-timeout))

Public Types Documentation

typedef PGBUF_AOUT_BUF

typedef struct pgbuf_aout_buf PGBUF_AOUT_BUF;

typedef PGBUF_AOUT_LIST

typedef struct pgbuf_aout_list PGBUF_AOUT_LIST;

typedef PGBUF_ATOMIC_LATCH

typedef std::atomic<uint64_t> PGBUF_ATOMIC_LATCH;

typedef PGBUF_ATOMIC_LATCH_IMPL

typedef union pgbuf_atomic_latch_impl PGBUF_ATOMIC_LATCH_IMPL;

typedef PGBUF_BATCH_FLUSH_HELPER

typedef struct pgbuf_batch_flush_helper PGBUF_BATCH_FLUSH_HELPER;

typedef PGBUF_BCB

typedef struct pgbuf_bcb PGBUF_BCB;

typedef PGBUF_BUFFER_HASH

typedef struct pgbuf_buffer_hash PGBUF_BUFFER_HASH;

typedef PGBUF_BUFFER_LOCK

typedef struct pgbuf_buffer_lock PGBUF_BUFFER_LOCK;

typedef PGBUF_BUFFER_POOL

typedef struct pgbuf_buffer_pool PGBUF_BUFFER_POOL;

typedef PGBUF_DEALLOC_UNDO_DATA

typedef struct pgbuf_dealloc_undo_data PGBUF_DEALLOC_UNDO_DATA;

typedef PGBUF_DIRECT_VICTIM

typedef struct pgbuf_direct_victim PGBUF_DIRECT_VICTIM;

typedef PGBUF_FIX_PERF

typedef struct pgbuf_fix_perf PGBUF_FIX_PERF;

typedef PGBUF_HOLDER

typedef struct pgbuf_holder PGBUF_HOLDER;

typedef PGBUF_HOLDER_ANCHOR

typedef struct pgbuf_holder_anchor PGBUF_HOLDER_ANCHOR;

typedef PGBUF_HOLDER_INFO

typedef struct pgbuf_holder_info PGBUF_HOLDER_INFO;

typedef PGBUF_HOLDER_SET

typedef struct pgbuf_holder_set PGBUF_HOLDER_SET;

typedef PGBUF_HOLDER_STAT

typedef struct pgbuf_holder_stat PGBUF_HOLDER_STAT;

typedef PGBUF_INVALID_LIST

typedef struct pgbuf_invalid_list PGBUF_INVALID_LIST;

typedef PGBUF_IOPAGE_BUFFER

typedef struct pgbuf_iopage_buffer PGBUF_IOPAGE_BUFFER;

typedef PGBUF_LRU_LIST

typedef struct pgbuf_lru_list PGBUF_LRU_LIST;

typedef PGBUF_MONITOR_BCB_MUTEX

typedef struct pgbuf_monitor_bcb_mutex PGBUF_MONITOR_BCB_MUTEX;

typedef PGBUF_PAGE_MONITOR

typedef struct pgbuf_page_monitor PGBUF_PAGE_MONITOR;

typedef PGBUF_PAGE_QUOTA

typedef struct pgbuf_page_quota PGBUF_PAGE_QUOTA;

typedef PGBUF_SEQ_FLUSHER

typedef struct pgbuf_seq_flusher PGBUF_SEQ_FLUSHER;

typedef PGBUF_STATUS

typedef struct pgbuf_status PGBUF_STATUS;

typedef PGBUF_STATUS_OLD

typedef struct pgbuf_status_old PGBUF_STATUS_OLD;

typedef PGBUF_STATUS_SNAPSHOT

typedef struct pgbuf_status_snapshot PGBUF_STATUS_SNAPSHOT;

typedef PGBUF_VICTIM_CANDIDATE_LIST

typedef struct pgbuf_victim_candidate_list PGBUF_VICTIM_CANDIDATE_LIST;

enum PGBUF_ZONE

enum PGBUF_ZONE {
    PGBUF_LRU_1_ZONE = 1 <<  16,
    PGBUF_LRU_2_ZONE = 2 <<  16,
    PGBUF_LRU_3_ZONE = 3 <<  16,
    PGBUF_LRU_ZONE_MASK = PGBUF_LRU_1_ZONE | PGBUF_LRU_2_ZONE | PGBUF_LRU_3_ZONE,
    PGBUF_INVALID_ZONE = 1 << ( 16  + 2),
    PGBUF_VOID_ZONE = 2 << ( 16  + 2),
    PGBUF_ZONE_MASK = (PGBUF_LRU_ZONE_MASK | PGBUF_INVALID_ZONE | PGBUF_VOID_ZONE)
};

enum page__buffer_8c_1a5efefa44b296976f2147b8acbed1752c

enum page__buffer_8c_1a5efefa44b296976f2147b8acbed1752c {
    PGBUF_LOCK_WAITER = 0,
    PGBUF_LOCK_HOLDER
};

enum page__buffer_8c_1a9d62e2a4d6edc3a479d15fdf213decd0

enum page__buffer_8c_1a9d62e2a4d6edc3a479d15fdf213decd0 {
    NEIGHBOR_ABORT_RANGE = 1,
    NEIGHBOR_ABORT_NOTFOUND_NONDIRTY_BACK,
    NEIGHBOR_ABORT_NOTFOUND_DIRTY_BACK,
    NEIGHBOR_ABORT_LATCH_NONDIRTY_BACK,
    NEIGHBOR_ABORT_LATCH_DIRTY_BACK,
    NEIGHBOR_ABORT_NONDIRTY_NOT_ALLOWED,
    NEIGHBOR_ABORT_TWO_CONSECTIVE_NONDIRTIES,
    NEIGHBOR_ABORT_TOO_MANY_NONDIRTIES
};

enum page__buffer_8c_1ade4ace78b27f5ceccade6e2e29404c48

enum page__buffer_8c_1ade4ace78b27f5ceccade6e2e29404c48 {
    PGBUF_CONTENT_BAD = 0,
    PGBUF_CONTENT_GOOD,
    PGBUF_CONTENT_LIKELY_BAD,
    PGBUF_CONTENT_ERROR
};

union pgbuf_atomic_latch_impl



Public Attributes Documentation

variable pgbuf_ordered_null_hfid

HFID* pgbuf_ordered_null_hfid;

variable vpid_Null_vpid

const VPID vpid_Null_vpid;

Public Static Attributes Documentation

variable pgbuf_Flush_control_daemon

cubthread::daemon* pgbuf_Flush_control_daemon;

variable pgbuf_Flush_helper

PGBUF_BATCH_FLUSH_HELPER pgbuf_Flush_helper;

variable pgbuf_Guard

char pgbuf_Guard[8];

variable pgbuf_Monitor_locks

bool pgbuf_Monitor_locks;

variable pgbuf_Page_flush_daemon

cubthread::daemon* pgbuf_Page_flush_daemon;

variable pgbuf_Page_maintenance_daemon

cubthread::daemon* pgbuf_Page_maintenance_daemon;

variable pgbuf_Page_post_flush_daemon

cubthread::daemon* pgbuf_Page_post_flush_daemon;

variable pgbuf_Pool

PGBUF_BUFFER_POOL pgbuf_Pool;

variable pgbuf_latch_timeout

int pgbuf_latch_timeout;

Public Functions Documentation

function REGISTER_DAEMON

REGISTER_DAEMON (
    pgbuf_page_maintenance
) 

function REGISTER_DAEMON

REGISTER_DAEMON (
    pgbuf_page_flush
) 

function REGISTER_DAEMON

REGISTER_DAEMON (
    pgbuf_page_post_flush
) 

function REGISTER_DAEMON

REGISTER_DAEMON (
    pgbuf_flush_control
) 

function pgbuf_adjust_quotas

void pgbuf_adjust_quotas (
    THREAD_ENTRY * thread_p
) 

function pgbuf_assign_flushed_pages

bool pgbuf_assign_flushed_pages (
    THREAD_ENTRY * thread_p
) 

function pgbuf_assign_private_lru

int pgbuf_assign_private_lru (
    THREAD_ENTRY * thread_p
) 

function pgbuf_attach_watcher_debug

void pgbuf_attach_watcher_debug (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    PGBUF_LATCH_MODE latch_mode,
    HFID * hfid,
    PGBUF_WATCHER * watcher,
    const  char * caller_file,
    const  int caller_line
) 

function pgbuf_check_page_ptype

bool pgbuf_check_page_ptype (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    PAGE_TYPE ptype
) 

function pgbuf_check_page_type_no_error

bool pgbuf_check_page_type_no_error (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    PAGE_TYPE ptype
) 

function pgbuf_compare_vpid

int pgbuf_compare_vpid (
    const  void * key_vpid1,
    const  void * key_vpid2
) 

function pgbuf_copy_from_area

void * pgbuf_copy_from_area (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    int start_offset,
    int length,
    void * area,
    bool do_fetch,
    TDE_ALGORITHM tde_algo
) 

function pgbuf_copy_to_area

void * pgbuf_copy_to_area (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    int start_offset,
    int length,
    void * area,
    bool do_fetch
) 

function pgbuf_daemons_destroy

void pgbuf_daemons_destroy () 

function pgbuf_daemons_get_stats

void pgbuf_daemons_get_stats (
    UINT64 * stats_out
) 

function pgbuf_daemons_init

void pgbuf_daemons_init () 

function pgbuf_dealloc_page

void pgbuf_dealloc_page (
    THREAD_ENTRY * thread_p,
    PAGE_PTR page_dealloc
) 

function pgbuf_dealloc_temp_page

int pgbuf_dealloc_temp_page (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    bool need_free
) 

function pgbuf_direct_victims_maintenance

void pgbuf_direct_victims_maintenance (
    THREAD_ENTRY * thread_p
) 

function pgbuf_dump_if_any_fixed

void pgbuf_dump_if_any_fixed (
    void
) 

function pgbuf_finalize

void pgbuf_finalize (
    void
) 

function pgbuf_fix_debug

PAGE_PTR pgbuf_fix_debug (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    PAGE_FETCH_MODE fetch_mode,
    PGBUF_LATCH_MODE request_mode,
    PGBUF_LATCH_CONDITION condition,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_fix_if_not_deallocated_with_caller

int pgbuf_fix_if_not_deallocated_with_caller (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    PGBUF_LATCH_MODE latch_mode,
    PGBUF_LATCH_CONDITION latch_condition,
    PAGE_PTR * page,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_fix_with_retry

PAGE_PTR pgbuf_fix_with_retry (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    PAGE_FETCH_MODE fetch_mode,
    PGBUF_LATCH_MODE request_mode,
    int retry
) 

function pgbuf_flush

void pgbuf_flush (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    bool free_page
) 

function pgbuf_flush_all

int pgbuf_flush_all (
    THREAD_ENTRY * thread_p,
    VOLID volid
) 

function pgbuf_flush_all_unfixed

int pgbuf_flush_all_unfixed (
    THREAD_ENTRY * thread_p,
    VOLID volid
) 

function pgbuf_flush_all_unfixed_and_set_lsa_as_null

int pgbuf_flush_all_unfixed_and_set_lsa_as_null (
    THREAD_ENTRY * thread_p,
    VOLID volid
) 

function pgbuf_flush_checkpoint

int pgbuf_flush_checkpoint (
    THREAD_ENTRY * thread_p,
    const  LOG_LSA * flush_upto_lsa,
    const  LOG_LSA * prev_chkpt_redo_lsa,
    LOG_LSA * smallest_lsa,
    int * flushed_page_cnt
) 

function pgbuf_flush_control_daemon_init

void pgbuf_flush_control_daemon_init () 

function pgbuf_flush_control_from_dirty_ratio

int pgbuf_flush_control_from_dirty_ratio (
    void
) 

function pgbuf_flush_if_requested

void pgbuf_flush_if_requested (
    THREAD_ENTRY * thread_p,
    PAGE_PTR page
) 

function pgbuf_flush_victim_candidates

int pgbuf_flush_victim_candidates (
    THREAD_ENTRY * thread_p,
    float flush_ratio,
    PERF_UTIME_TRACKER * perf_tracker,
    bool * stop
) 

function pgbuf_flush_with_wal

PAGE_PTR pgbuf_flush_with_wal (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr
) 

function pgbuf_force_to_check_for_interrupts

void pgbuf_force_to_check_for_interrupts (
    void
) 

function pgbuf_get_condition_for_ordered_fix

int pgbuf_get_condition_for_ordered_fix (
    const  VPID * vpid_new_page,
    const  VPID * vpid_fixed_page,
    const  HFID * hfid
) 

function pgbuf_get_fix_count

int pgbuf_get_fix_count (
    PAGE_PTR pgptr
) 

function pgbuf_get_hold_count

int pgbuf_get_hold_count (
    THREAD_ENTRY * thread_p
) 

function pgbuf_get_latch_mode

PGBUF_LATCH_MODE pgbuf_get_latch_mode (
    PAGE_PTR pgptr
) 

function pgbuf_get_lsa

LOG_LSA * pgbuf_get_lsa (
    PAGE_PTR pgptr
) 

function pgbuf_get_page_flush_interval

void pgbuf_get_page_flush_interval (
    bool & is_timed_wait,
    cubthread::delta_time & period
) 

function pgbuf_get_page_id

PAGEID pgbuf_get_page_id (
    PAGE_PTR pgptr
) 

function pgbuf_get_page_ptype

PAGE_TYPE pgbuf_get_page_ptype (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr
) 

function pgbuf_get_page_type_for_stat

PERF_PAGE_TYPE pgbuf_get_page_type_for_stat (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr
) 

function pgbuf_get_tde_algorithm

TDE_ALGORITHM pgbuf_get_tde_algorithm (
    PAGE_PTR pgptr
) 

function pgbuf_get_volume_id

VOLID pgbuf_get_volume_id (
    PAGE_PTR pgptr
) 

function pgbuf_get_volume_label

const  char * pgbuf_get_volume_label (
    PAGE_PTR pgptr
) 

function pgbuf_get_vpid

void pgbuf_get_vpid (
    PAGE_PTR pgptr,
    VPID * vpid
) 

function pgbuf_get_vpid_ptr

VPID * pgbuf_get_vpid_ptr (
    PAGE_PTR pgptr
) 

function pgbuf_has_any_non_vacuum_waiters

bool pgbuf_has_any_non_vacuum_waiters (
    PAGE_PTR pgptr
) 

function pgbuf_has_any_waiters

bool pgbuf_has_any_waiters (
    PAGE_PTR pgptr
) 

function pgbuf_has_perm_pages_fixed

bool pgbuf_has_perm_pages_fixed (
    THREAD_ENTRY * thread_p
) 

function pgbuf_has_prevent_dealloc

bool pgbuf_has_prevent_dealloc (
    PAGE_PTR pgptr
) 

function pgbuf_hash_vpid

unsigned  int pgbuf_hash_vpid (
    const  void * key_vpid,
    unsigned  int htsize
) 

function pgbuf_initialize

int pgbuf_initialize (
    void
) 

function pgbuf_invalidate_all_debug

int pgbuf_invalidate_all_debug (
    THREAD_ENTRY * thread_p,
    VOLID volid,
    const  char * caller_file,
    int caller_line
) 

function pgbuf_invalidate_debug

int pgbuf_invalidate_debug (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    const  char * caller_file,
    int caller_line
) 

function pgbuf_is_io_stressful

bool pgbuf_is_io_stressful (
    void
) 

function pgbuf_is_log_check_for_interrupts

bool pgbuf_is_log_check_for_interrupts (
    THREAD_ENTRY * thread_p
) 

function pgbuf_is_lsa_temporary

bool pgbuf_is_lsa_temporary (
    PAGE_PTR pgptr
) 

function pgbuf_is_page_fixed_by_thread

bool pgbuf_is_page_fixed_by_thread (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid_p
) 

function pgbuf_is_valid_page

DISK_ISVALID pgbuf_is_valid_page (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    bool no_error
) 

function pgbuf_keep_victim_flush_thread_running

bool pgbuf_keep_victim_flush_thread_running (
    void
) 

function pgbuf_log_new_page

void pgbuf_log_new_page (
    THREAD_ENTRY * thread_p,
    PAGE_PTR page_new,
    int data_size,
    PAGE_TYPE ptype_new
) 

function pgbuf_log_redo_new_page

void pgbuf_log_redo_new_page (
    THREAD_ENTRY * thread_p,
    PAGE_PTR page_new,
    int data_size,
    PAGE_TYPE ptype_new
) 

function pgbuf_notify_vacuum_follows

void pgbuf_notify_vacuum_follows (
    THREAD_ENTRY * thread_p,
    PAGE_PTR page
) 

function pgbuf_ordered_fix_debug

int pgbuf_ordered_fix_debug (
    THREAD_ENTRY * thread_p,
    const  VPID * req_vpid,
    PAGE_FETCH_MODE fetch_mode,
    const  PGBUF_LATCH_MODE request_mode,
    PGBUF_WATCHER * req_watcher,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_ordered_set_dirty_and_free

void pgbuf_ordered_set_dirty_and_free (
    THREAD_ENTRY * thread_p,
    PGBUF_WATCHER * pg_watcher
) 

function pgbuf_ordered_unfix_debug

void pgbuf_ordered_unfix_debug (
    THREAD_ENTRY * thread_p,
    PGBUF_WATCHER * watcher_object,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_page_flush_daemon_init

void pgbuf_page_flush_daemon_init () 

function pgbuf_page_maintenance_daemon_init

void pgbuf_page_maintenance_daemon_init () 

function pgbuf_page_post_flush_daemon_init

void pgbuf_page_post_flush_daemon_init () 

function pgbuf_peek_stats

void pgbuf_peek_stats (
    UINT64 * fixed_cnt,
    UINT64 * dirty_cnt,
    UINT64 * lru1_cnt,
    UINT64 * lru2_cnt,
    UINT64 * lru3_cnt,
    UINT64 * victim_candidates,
    UINT64 * avoid_dealloc_cnt,
    UINT64 * avoid_victim_cnt,
    UINT64 * private_quota,
    UINT64 * private_cnt,
    UINT64 * alloc_bcb_waiter_high,
    UINT64 * alloc_bcb_waiter_med,
    UINT64 * flushed_bcbs_waiting_direct_assign,
    UINT64 * lfcq_big_prv_num,
    UINT64 * lfcq_prv_num,
    UINT64 * lfcq_shr_num
) 

function pgbuf_promote_read_latch_debug

int pgbuf_promote_read_latch_debug (
    THREAD_ENTRY * thread_p,
    PAGE_PTR * pgptr_p,
    PGBUF_PROMOTE_CONDITION condition,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_release_private_lru

int pgbuf_release_private_lru (
    THREAD_ENTRY * thread_p,
    const  int private_idx
) 

function pgbuf_replace_watcher_debug

void pgbuf_replace_watcher_debug (
    THREAD_ENTRY * thread_p,
    PGBUF_WATCHER * old_watcher,
    PGBUF_WATCHER * new_watcher,
    const  char * caller_file,
    const  int caller_line
) 

function pgbuf_reset_temp_lsa

void pgbuf_reset_temp_lsa (
    PAGE_PTR pgptr
) 

function pgbuf_rv_dealloc_redo

int pgbuf_rv_dealloc_redo (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function pgbuf_rv_dealloc_undo

int pgbuf_rv_dealloc_undo (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function pgbuf_rv_dealloc_undo_compensate

int pgbuf_rv_dealloc_undo_compensate (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function pgbuf_rv_flush_page

int pgbuf_rv_flush_page (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function pgbuf_rv_flush_page_dump

void pgbuf_rv_flush_page_dump (
    FILE * fp,
    int length,
    void * data
) 

function pgbuf_rv_new_page_redo

int pgbuf_rv_new_page_redo (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function pgbuf_rv_new_page_undo

int pgbuf_rv_new_page_undo (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function pgbuf_rv_set_tde_algorithm

int pgbuf_rv_set_tde_algorithm (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function pgbuf_set_dirty_debug

void pgbuf_set_dirty_debug (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    bool free_page,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_set_lsa_as_temporary

void pgbuf_set_lsa_as_temporary (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr
) 

function pgbuf_set_lsa_debug

const  LOG_LSA * pgbuf_set_lsa_debug (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    const  LOG_LSA * lsa_ptr,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_set_page_ptype

void pgbuf_set_page_ptype (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    PAGE_TYPE ptype
) 

function pgbuf_set_tde_algorithm

void pgbuf_set_tde_algorithm (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    TDE_ALGORITHM tde_algo,
    bool skip_logging
) 

function pgbuf_simple_fix

PAGE_PTR pgbuf_simple_fix (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    bool need_fix
) 

function pgbuf_simple_unfix

void pgbuf_simple_unfix (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr
) 

function pgbuf_start_scan

int pgbuf_start_scan (
    THREAD_ENTRY * thread_p,
    int type,
    DB_VALUE ** arg_values,
    int arg_cnt,
    void ** ptr
) 

function pgbuf_thread_variables_init

void pgbuf_thread_variables_init (
    THREAD_ENTRY * thread_p
) 

function pgbuf_unfix_all

void pgbuf_unfix_all (
    THREAD_ENTRY * thread_p
) 

function pgbuf_unfix_debug

void pgbuf_unfix_debug (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr,
    const  char * caller_file,
    int caller_line,
    const  char * caller_func
) 

function pgbuf_watcher_init_debug

void pgbuf_watcher_init_debug (
    PGBUF_WATCHER * watcher,
    const  char * caller_file,
    const  int caller_line,
    bool add
) 

Public Static Functions Documentation

function PGBUF_THREAD_HAS_PRIVATE_LRU

static bool PGBUF_THREAD_HAS_PRIVATE_LRU (
    THREAD_ENTRY * thread_p
) 

function add_fcnt

static void add_fcnt (
    PGBUF_ATOMIC_LATCH * latch,
    int cnt
) 

function copy_bcb

static void copy_bcb (
    PGBUF_BCB * dest_bcb,
    PGBUF_BCB * src_bcb
) 

function get_fcnt

static int get_fcnt (
    PGBUF_ATOMIC_LATCH * latch
) 

function get_impl

static PGBUF_ATOMIC_LATCH_IMPL get_impl (
    PGBUF_ATOMIC_LATCH * latch
) 

function get_latch

static PGBUF_LATCH_MODE get_latch (
    PGBUF_ATOMIC_LATCH * latch
) 

function get_waiter_exists

static bool get_waiter_exists (
    PGBUF_ATOMIC_LATCH * latch
) 

function pgbuf_add_bufptr_to_batch

static void pgbuf_add_bufptr_to_batch (
    PGBUF_BCB * bufptr,
    int idx
) 

function pgbuf_add_fixed_at

static void pgbuf_add_fixed_at (
    PGBUF_HOLDER * holder,
    const  char * caller_file,
    int caller_line,
    bool reset
) 

function pgbuf_add_vpid_to_aout_list

static void pgbuf_add_vpid_to_aout_list (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    const  int lru_idx
) 

function pgbuf_add_watch_instance_internal

static void pgbuf_add_watch_instance_internal (
    PGBUF_HOLDER * holder,
    PAGE_PTR pgptr,
    PGBUF_WATCHER * watcher,
    const  PGBUF_LATCH_MODE latch_mode,
    const  bool clear_unfix_flag,
    const  char * caller_file,
    const  int caller_line
) 

function pgbuf_allocate_bcb

static PGBUF_BCB * pgbuf_allocate_bcb (
    THREAD_ENTRY * thread_p,
    const  VPID * src_vpid
) 

function pgbuf_allocate_thrd_holder_entry

static PGBUF_HOLDER * pgbuf_allocate_thrd_holder_entry (
    THREAD_ENTRY * thread_p
) 

function pgbuf_assign_direct_victim

static bool pgbuf_assign_direct_victim (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_avoid_victim

static bool pgbuf_bcb_avoid_victim (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_change_zone

static void pgbuf_bcb_change_zone (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    int lru_idx,
    PGBUF_ZONE zone
) 

function pgbuf_bcb_check_and_reset_fix_and_avoid_dealloc

static void pgbuf_bcb_check_and_reset_fix_and_avoid_dealloc (
    PGBUF_BCB * bcb,
    const  char * file,
    int line
) 

function pgbuf_bcb_clear_dirty

static void pgbuf_bcb_clear_dirty (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_flush_with_wal

static int pgbuf_bcb_flush_with_wal (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    bool is_page_flush_thread,
    bool * is_bcb_locked
) 

function pgbuf_bcb_get_lru_index

static int pgbuf_bcb_get_lru_index (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_get_pool_index

static int pgbuf_bcb_get_pool_index (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_get_zone

static PGBUF_ZONE pgbuf_bcb_get_zone (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_is_async_flush_request

static bool pgbuf_bcb_is_async_flush_request (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_is_direct_victim

static bool pgbuf_bcb_is_direct_victim (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_is_dirty

static bool pgbuf_bcb_is_dirty (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_is_flushing

static bool pgbuf_bcb_is_flushing (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_is_hot

static bool pgbuf_bcb_is_hot (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_is_invalid_direct_victim

static bool pgbuf_bcb_is_invalid_direct_victim (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_is_to_vacuum

static bool pgbuf_bcb_is_to_vacuum (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_mark_is_flushing

static bool pgbuf_bcb_mark_is_flushing (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_mark_was_flushed

static void pgbuf_bcb_mark_was_flushed (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_mark_was_not_flushed

static void pgbuf_bcb_mark_was_not_flushed (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    bool mark_dirty
) 

function pgbuf_bcb_register_avoid_deallocation

static void pgbuf_bcb_register_avoid_deallocation (
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_register_fix

static void pgbuf_bcb_register_fix (
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_register_hit_for_lru

static void pgbuf_bcb_register_hit_for_lru (
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_safe_flush_force_lock

static int pgbuf_bcb_safe_flush_force_lock (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    bool synchronous
) 

function pgbuf_bcb_safe_flush_force_unlock

static int pgbuf_bcb_safe_flush_force_unlock (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    bool synchronous
) 

function pgbuf_bcb_safe_flush_internal

static int pgbuf_bcb_safe_flush_internal (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    bool synchronous,
    bool * locked
) 

function pgbuf_bcb_set_dirty

static void pgbuf_bcb_set_dirty (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_should_avoid_deallocation

static bool pgbuf_bcb_should_avoid_deallocation (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_should_be_moved_to_bottom_lru

static bool pgbuf_bcb_should_be_moved_to_bottom_lru (
    const  PGBUF_BCB * bcb
) 

function pgbuf_bcb_unregister_avoid_deallocation

static void pgbuf_bcb_unregister_avoid_deallocation (
    PGBUF_BCB * bcb
) 

function pgbuf_bcb_update_flags

static void pgbuf_bcb_update_flags (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    int set_flags,
    int clear_flags
) 

function pgbuf_bcbmon_check_mutex_leaks

static void pgbuf_bcbmon_check_mutex_leaks (
    void
) 

function pgbuf_bcbmon_check_own

static void pgbuf_bcbmon_check_own (
    PGBUF_BCB * bcb
) 

function pgbuf_bcbmon_lock

static void pgbuf_bcbmon_lock (
    PGBUF_BCB * bcb,
    int caller_line
) 

function pgbuf_bcbmon_trylock

static int pgbuf_bcbmon_trylock (
    PGBUF_BCB * bcb,
    int caller_line
) 

function pgbuf_bcbmon_unlock

static void pgbuf_bcbmon_unlock (
    PGBUF_BCB * bcb
) 

function pgbuf_block_bcb

static int pgbuf_block_bcb (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    PGBUF_LATCH_MODE request_mode,
    int request_fcnt,
    bool as_promote
) 

function pgbuf_check_bcb_page_vpid

static bool pgbuf_check_bcb_page_vpid (
    PGBUF_BCB * bufptr,
    bool maybe_deallocated
) 

function pgbuf_check_page_ptype_internal

static bool pgbuf_check_page_ptype_internal (
    PAGE_PTR pgptr,
    PAGE_TYPE ptype,
    bool no_error
) 

function pgbuf_claim_bcb_for_fix

static PGBUF_BCB * pgbuf_claim_bcb_for_fix (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    PAGE_FETCH_MODE fetch_mode,
    PGBUF_BUFFER_HASH * hash_anchor,
    PGBUF_FIX_PERF * perf,
    bool * try_again,
    bool already_locked
) 

function pgbuf_compare_hold_vpid_for_sort

static int pgbuf_compare_hold_vpid_for_sort (
    const  void * p1,
    const  void * p2
) 

function pgbuf_compare_victim_list

static int pgbuf_compare_victim_list (
    const  void * p1,
    const  void * p2
) 

function pgbuf_compute_lru_vict_target

static void pgbuf_compute_lru_vict_target (
    float * lru_sum_flush_priority
) 

function pgbuf_consistent_str

static const  char * pgbuf_consistent_str (
    int consistent
) 

function pgbuf_delete_from_hash_chain

static int pgbuf_delete_from_hash_chain (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_dump

static void pgbuf_dump (
    void
) 

function pgbuf_find_current_wait_msecs

static int pgbuf_find_current_wait_msecs (
    THREAD_ENTRY * thread_p
) 

function pgbuf_find_thrd_holder

static PGBUF_HOLDER * pgbuf_find_thrd_holder (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_flags_mask_sanity_check

static void pgbuf_flags_mask_sanity_check (
    void
) 

function pgbuf_flush_all_helper

static int pgbuf_flush_all_helper (
    THREAD_ENTRY * thread_p,
    VOLID volid,
    bool is_only_fixed,
    bool is_set_lsa_as_null
) 

function pgbuf_flush_chkpt_seq_list

static int pgbuf_flush_chkpt_seq_list (
    THREAD_ENTRY * thread_p,
    PGBUF_SEQ_FLUSHER * seq_flusher,
    const  LOG_LSA * prev_chkpt_redo_lsa,
    LOG_LSA * chkpt_smallest_lsa
) 

function pgbuf_flush_neighbor_safe

static int pgbuf_flush_neighbor_safe (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    VPID * expected_vpid,
    bool * flushed
) 

function pgbuf_flush_page_and_neighbors_fb

static int pgbuf_flush_page_and_neighbors_fb (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    int * flushed_pages
) 

function pgbuf_flush_seq_list

static int pgbuf_flush_seq_list (
    THREAD_ENTRY * thread_p,
    PGBUF_SEQ_FLUSHER * seq_flusher,
    struct  timeval * limit_time,
    const  LOG_LSA * prev_chkpt_redo_lsa,
    LOG_LSA * chkpt_smallest_lsa,
    int * time_rem
) 

function pgbuf_get_bcb_from_invalid_list

static PGBUF_BCB * pgbuf_get_bcb_from_invalid_list (
    THREAD_ENTRY * thread_p
) 

function pgbuf_get_check_page_validation_level

static bool pgbuf_get_check_page_validation_level (
    int page_validation_level
) 

function pgbuf_get_direct_victim

static PGBUF_BCB * pgbuf_get_direct_victim (
    THREAD_ENTRY * thread_p
) 

function pgbuf_get_groupid_and_unfix

static int pgbuf_get_groupid_and_unfix (
    THREAD_ENTRY * thread_p,
    const  VPID * req_vpid,
    PAGE_PTR * pgptr,
    VPID * groupid,
    bool do_unfix
) 

function pgbuf_get_holder

static PGBUF_HOLDER * pgbuf_get_holder (
    THREAD_ENTRY * thread_p,
    PAGE_PTR pgptr
) 

function pgbuf_get_shared_lru_index_for_add

static int pgbuf_get_shared_lru_index_for_add (
    void
) 

function pgbuf_get_thread_waiting_for_direct_victim

static bool pgbuf_get_thread_waiting_for_direct_victim (
    REFPTR ( THREAD_ENTRY , waiting_thread_out )
) 

function pgbuf_get_victim

static PGBUF_BCB * pgbuf_get_victim (
    THREAD_ENTRY * thread_p
) 

function pgbuf_get_victim_candidates_from_lru

static int pgbuf_get_victim_candidates_from_lru (
    THREAD_ENTRY * thread_p,
    int check_count,
    float lru_sum_flush_priority,
    bool * assigned_directly
) 

function pgbuf_get_victim_from_lru_list

static PGBUF_BCB * pgbuf_get_victim_from_lru_list (
    THREAD_ENTRY * thread_p,
    const  int lru_idx
) 

function pgbuf_hash_func_mirror

static inline unsigned  int pgbuf_hash_func_mirror (
    const  VPID * vpid
) 

function pgbuf_init_temp_page_lsa

static void pgbuf_init_temp_page_lsa (
    FILEIO_PAGE * io_page,
    PGLENGTH page_size
) 

function pgbuf_initialize_aout_list

static int pgbuf_initialize_aout_list (
    void
) 

function pgbuf_initialize_bcb_table

static int pgbuf_initialize_bcb_table (
    void
) 

function pgbuf_initialize_hash_table

static int pgbuf_initialize_hash_table (
    void
) 

function pgbuf_initialize_invalid_list

static int pgbuf_initialize_invalid_list (
    void
) 

function pgbuf_initialize_lock_table

static int pgbuf_initialize_lock_table (
    void
) 

function pgbuf_initialize_lru_list

static int pgbuf_initialize_lru_list (
    void
) 

function pgbuf_initialize_page_monitor

static int pgbuf_initialize_page_monitor (
    void
) 

function pgbuf_initialize_page_quota

static int pgbuf_initialize_page_quota (
    void
) 

function pgbuf_initialize_page_quota_parameters

static int pgbuf_initialize_page_quota_parameters (
    void
) 

function pgbuf_initialize_seq_flusher

static int pgbuf_initialize_seq_flusher (
    PGBUF_SEQ_FLUSHER * seq_flusher,
    PGBUF_VICTIM_CANDIDATE_LIST * f_list,
    const  int cnt
) 

function pgbuf_initialize_thrd_holder

static int pgbuf_initialize_thrd_holder (
    void
) 

function pgbuf_insert_into_hash_chain

static int pgbuf_insert_into_hash_chain (
    THREAD_ENTRY * thread_p,
    PGBUF_BUFFER_HASH * hash_anchor,
    PGBUF_BCB * bufptr
) 

function pgbuf_invalidate_bcb

static int pgbuf_invalidate_bcb (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_is_any_thread_waiting_for_direct_victim

static bool pgbuf_is_any_thread_waiting_for_direct_victim (
    void
) 

function pgbuf_is_bcb_fixed_by_any

static bool pgbuf_is_bcb_fixed_by_any (
    PGBUF_BCB * bcb,
    bool has_mutex_lock
) 

function pgbuf_is_bcb_victimizable

static bool pgbuf_is_bcb_victimizable (
    PGBUF_BCB * bcb,
    bool has_mutex_lock
) 

function pgbuf_is_consistent

static int pgbuf_is_consistent (
    const  PGBUF_BCB * bufptr,
    int likely_bad_after_fixcnt
) 

function pgbuf_is_exist_blocked_reader_writer

static bool pgbuf_is_exist_blocked_reader_writer (
    PGBUF_BCB * bufptr
) 

function pgbuf_is_hit_ratio_low

static bool pgbuf_is_hit_ratio_low (
    void
) 

function pgbuf_is_page_flush_daemon_available

static bool pgbuf_is_page_flush_daemon_available () 

function pgbuf_is_temp_lsa

static bool pgbuf_is_temp_lsa (
    const  log_lsa & lsa
) 

function pgbuf_is_temporary_volume

static inline bool pgbuf_is_temporary_volume (
    VOLID volid
) 

function pgbuf_is_thread_high_priority

static bool pgbuf_is_thread_high_priority (
    THREAD_ENTRY * thread_p
) 

function pgbuf_is_valid_page_ptr

static bool pgbuf_is_valid_page_ptr (
    const  PAGE_PTR pgptr
) 

function pgbuf_latch_bcb_upon_fix

static int pgbuf_latch_bcb_upon_fix (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    PGBUF_LATCH_MODE request_mode,
    int buf_lock_acquired,
    PGBUF_LATCH_CONDITION condition,
    bool * is_latch_wait
) 

function pgbuf_latch_mode_str

static const  char * pgbuf_latch_mode_str (
    PGBUF_LATCH_MODE latch_mode
) 

function pgbuf_lfcq_add_lru_with_victims

static bool pgbuf_lfcq_add_lru_with_victims (
    PGBUF_LRU_LIST * lru_list
) 

function pgbuf_lfcq_assign_direct_victims

static void pgbuf_lfcq_assign_direct_victims (
    THREAD_ENTRY * thread_p,
    int lru_idx,
    int * nassign_inout
) 

function pgbuf_lfcq_get_victim_from_private_lru

static PGBUF_BCB * pgbuf_lfcq_get_victim_from_private_lru (
    THREAD_ENTRY * thread_p,
    bool restricted
) 

function pgbuf_lfcq_get_victim_from_shared_lru

static PGBUF_BCB * pgbuf_lfcq_get_victim_from_shared_lru (
    THREAD_ENTRY * thread_p,
    bool multi_threaded
) 

function pgbuf_lock_page

static int pgbuf_lock_page (
    THREAD_ENTRY * thread_p,
    PGBUF_BUFFER_HASH * hash_anchor,
    const  VPID * vpid
) 

function pgbuf_lockfree_fix_ro

static PAGE_PTR pgbuf_lockfree_fix_ro (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid,
    PAGE_FETCH_MODE fetch_mode
) 

function pgbuf_lockfree_unfix_ro

static bool pgbuf_lockfree_unfix_ro (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_lru_add_bcb_to_bottom

static void pgbuf_lru_add_bcb_to_bottom (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    PGBUF_LRU_LIST * lru_list
) 

function pgbuf_lru_add_bcb_to_middle

static void pgbuf_lru_add_bcb_to_middle (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    PGBUF_LRU_LIST * lru_list
) 

function pgbuf_lru_add_bcb_to_top

static void pgbuf_lru_add_bcb_to_top (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    PGBUF_LRU_LIST * lru_list
) 

function pgbuf_lru_add_new_bcb_to_bottom

static void pgbuf_lru_add_new_bcb_to_bottom (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    int lru_idx
) 

function pgbuf_lru_add_new_bcb_to_middle

static void pgbuf_lru_add_new_bcb_to_middle (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    int lru_idx
) 

function pgbuf_lru_add_new_bcb_to_top

static void pgbuf_lru_add_new_bcb_to_top (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    int lru_idx
) 

function pgbuf_lru_add_victim_candidate

static void pgbuf_lru_add_victim_candidate (
    THREAD_ENTRY * thread_p,
    PGBUF_LRU_LIST * lru_list,
    PGBUF_BCB * bcb
) 

function pgbuf_lru_adjust_zone1

static void pgbuf_lru_adjust_zone1 (
    THREAD_ENTRY * thread_p,
    PGBUF_LRU_LIST * lru_list,
    bool min_one
) 

function pgbuf_lru_adjust_zone2

static void pgbuf_lru_adjust_zone2 (
    THREAD_ENTRY * thread_p,
    PGBUF_LRU_LIST * lru_list,
    bool min_one
) 

function pgbuf_lru_adjust_zones

static void pgbuf_lru_adjust_zones (
    THREAD_ENTRY * thread_p,
    PGBUF_LRU_LIST * lru_list,
    bool min_one
) 

function pgbuf_lru_advance_victim_hint

static void pgbuf_lru_advance_victim_hint (
    THREAD_ENTRY * thread_p,
    PGBUF_LRU_LIST * lru_list,
    PGBUF_BCB * bcb_prev_hint,
    PGBUF_BCB * bcb_new_hint,
    bool was_vict_count_updated
) 

function pgbuf_lru_boost_bcb

static void pgbuf_lru_boost_bcb (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_lru_fall_bcb_to_zone_3

static void pgbuf_lru_fall_bcb_to_zone_3 (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    PGBUF_LRU_LIST * lru_list
) 

function pgbuf_lru_list_from_bcb

static PGBUF_LRU_LIST * pgbuf_lru_list_from_bcb (
    const  PGBUF_BCB * bcb
) 

function pgbuf_lru_move_from_private_to_shared

static void pgbuf_lru_move_from_private_to_shared (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_lru_remove_bcb

static void pgbuf_lru_remove_bcb (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_lru_remove_victim_candidate

static void pgbuf_lru_remove_victim_candidate (
    THREAD_ENTRY * thread_p,
    PGBUF_LRU_LIST * lru_list,
    PGBUF_BCB * bcb
) 

function pgbuf_lru_sanity_check

static void pgbuf_lru_sanity_check (
    const  PGBUF_LRU_LIST * lru
) 

function pgbuf_move_bcb_to_bottom_lru

static void pgbuf_move_bcb_to_bottom_lru (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_page_maintenance_execute

static void pgbuf_page_maintenance_execute (
    cubthread::entry & thread_ref
) 

function pgbuf_page_post_flush_execute

static void pgbuf_page_post_flush_execute (
    cubthread::entry & thread_ref
) 

function pgbuf_panic_assign_direct_victims_from_lru

static int pgbuf_panic_assign_direct_victims_from_lru (
    THREAD_ENTRY * thread_p,
    PGBUF_LRU_LIST * lru_list,
    PGBUF_BCB * bcb_start
) 

function pgbuf_put_bcb_into_invalid_list

static int pgbuf_put_bcb_into_invalid_list (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_remove_from_lru_list

static void pgbuf_remove_from_lru_list (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    PGBUF_LRU_LIST * lru_list
) 

function pgbuf_remove_private_from_aout_list

static int pgbuf_remove_private_from_aout_list (
    const  int lru_idx
) 

function pgbuf_remove_thrd_holder

static int pgbuf_remove_thrd_holder (
    THREAD_ENTRY * thread_p,
    PGBUF_HOLDER * holder
) 

function pgbuf_remove_vpid_from_aout_list

static int pgbuf_remove_vpid_from_aout_list (
    THREAD_ENTRY * thread_p,
    const  VPID * vpid
) 

function pgbuf_remove_watcher

static void pgbuf_remove_watcher (
    PGBUF_HOLDER * holder,
    PGBUF_WATCHER * watcher_object
) 

function pgbuf_scan_bcb_table

static void pgbuf_scan_bcb_table (
    THREAD_ENTRY * thread_p
) 

function pgbuf_scan_bcb_table

static void pgbuf_scan_bcb_table () 

function pgbuf_scramble

static void pgbuf_scramble (
    FILEIO_PAGE * iopage
) 

function pgbuf_search_hash_chain

static PGBUF_BCB * pgbuf_search_hash_chain (
    THREAD_ENTRY * thread_p,
    PGBUF_BUFFER_HASH * hash_anchor,
    const  VPID * vpid
) 

function pgbuf_search_hash_chain_no_bcb_lock

static PGBUF_BCB * pgbuf_search_hash_chain_no_bcb_lock (
    THREAD_ENTRY * thread_p,
    PGBUF_BUFFER_HASH * hash_anchor,
    const  VPID * vpid
) 

function pgbuf_set_bcb_page_vpid

static void pgbuf_set_bcb_page_vpid (
    PGBUF_BCB * bufptr
) 

function pgbuf_set_dirty_buffer_ptr

static void pgbuf_set_dirty_buffer_ptr (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_should_move_private_to_shared

static bool pgbuf_should_move_private_to_shared (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    int thread_private_lru_index
) 

function pgbuf_sleep

static void pgbuf_sleep (
    THREAD_ENTRY * thread_p,
    pthread_mutex_t * mutex_p
) 

function pgbuf_timed_sleep

static int pgbuf_timed_sleep (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_timed_sleep_error_handling

static int pgbuf_timed_sleep_error_handling (
    THREAD_ENTRY * thrd_entry,
    PGBUF_BCB * bufptr
) 

function pgbuf_unlatch_bcb_upon_unfix

static int pgbuf_unlatch_bcb_upon_unfix (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    int holder_status
) 

function pgbuf_unlatch_thrd_holder

static int pgbuf_unlatch_thrd_holder (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr,
    PGBUF_HOLDER_STAT * holder_perf_stat_p
) 

function pgbuf_unlatch_void_zone_bcb

static void pgbuf_unlatch_void_zone_bcb (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb,
    int thread_private_lru_index
) 

function pgbuf_unlock_page

static int pgbuf_unlock_page (
    THREAD_ENTRY * thread_p,
    PGBUF_BUFFER_HASH * hash_anchor,
    const  VPID * vpid,
    int need_hash_mutex
) 

function pgbuf_victimize_bcb

static int pgbuf_victimize_bcb (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_wake_flush_waiters

static void pgbuf_wake_flush_waiters (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bcb
) 

function pgbuf_wakeup

static int pgbuf_wakeup (
    THREAD_ENTRY * thread_p
) 

function pgbuf_wakeup_page_flush_daemon

static void pgbuf_wakeup_page_flush_daemon (
    THREAD_ENTRY * thread_p
) 

function pgbuf_wakeup_reader_writer

static void pgbuf_wakeup_reader_writer (
    THREAD_ENTRY * thread_p,
    PGBUF_BCB * bufptr
) 

function pgbuf_wakeup_uncond

static int pgbuf_wakeup_uncond (
    THREAD_ENTRY * thread_p
) 

function pgbuf_zone_str

static const  char * pgbuf_zone_str (
    PGBUF_ZONE zone
) 

function set_latch

static void set_latch (
    PGBUF_ATOMIC_LATCH * latch,
    PGBUF_LATCH_MODE latch_mode
) 

function set_latch_and_add_fcnt

static void set_latch_and_add_fcnt (
    PGBUF_ATOMIC_LATCH * latch,
    PGBUF_LATCH_MODE latch_mode,
    int cnt
) 

function set_latch_and_fcnt

static void set_latch_and_fcnt (
    PGBUF_ATOMIC_LATCH * latch,
    PGBUF_LATCH_MODE latch_mode,
    int cnt
) 

function set_waiter_exists

static void set_waiter_exists (
    PGBUF_ATOMIC_LATCH * latch,
    bool waiter_exists
) 

Macro Definition Documentation

define AOUT_HASH_DIVIDE_RATIO

#define AOUT_HASH_DIVIDE_RATIO `1000`

define AOUT_HASH_IDX

#define AOUT_HASH_IDX (
    vpid,
    list
) `(( vpid )->pageid % list->num_hashes)`

define CAST_BFPTR_TO_PGPTR

#define CAST_BFPTR_TO_PGPTR (
    pgptr,
    bufptr
) `/* multi line expression */`

define CAST_IOPGPTR_TO_PGPTR

#define CAST_IOPGPTR_TO_PGPTR (
    pgptr,
    io_pgptr
) `/* multi line expression */`

define CAST_PGPTR_TO_BFPTR

#define CAST_PGPTR_TO_BFPTR (
    bufptr,
    pgptr
) `/* multi line expression */`

define CAST_PGPTR_TO_IOPGPTR

#define CAST_PGPTR_TO_IOPGPTR (
    io_pgptr,
    pgptr
) `/* multi line expression */`

define DEFAULT_ASSIGNS_PER_ITERATION

#define DEFAULT_ASSIGNS_PER_ITERATION `5`

define HASH_SIZE_BITS

#define HASH_SIZE_BITS `20`

define INIT_HOLDER_STAT

#define INIT_HOLDER_STAT (
    perf_stat
) `/* multi line expression */`

define MAX_DEPTH

#define MAX_DEPTH `1000`

define MAX_DEPTH

#define MAX_DEPTH `1000`

define MAX_PRIVATE_RATIO

#define MAX_PRIVATE_RATIO `0.998f`

define MIN_PRIVATE_RATIO

#define MIN_PRIVATE_RATIO `0.01f`

define PAGE_ADD_REFRESH_STAT

#define PAGE_ADD_REFRESH_STAT `MAX (2 * pgbuf_Pool.num_buffers / PGBUF_SHARED_LRU_COUNT , 10000)`

define PBGUF_BIG_PRIVATE_MIN_SIZE

#define PBGUF_BIG_PRIVATE_MIN_SIZE `100`

define PERF

#define PERF (
    id
) `if ( detailed_perf ) perfmon_inc_stat (thread_p, id )`

define PERF

#define PERF (
    pstatid
) `if ( perf_tracking ) perfmon_inc_stat (thread_p, pstatid )`

define PERF

#define PERF (
    id
) `if ( detailed_perf ) perfmon_inc_stat (thread_p, id )`

define PERF

#define PERF (
    id
) `if ( detailed_perf ) perfmon_inc_stat (thread_p, id )`

define PGBUF_ABORT_RELEASE

#define PGBUF_ABORT_RELEASE (

) `assert ( false )`

define PGBUF_AGE_DIFF

#define PGBUF_AGE_DIFF (
    bcb_age,
    list_age
) `((( list_age ) >= ( bcb_age )) ? (( list_age ) - ( bcb_age )) : ( DB_INT32_MAX - (( bcb_age ) - ( list_age ))))`

define PGBUF_AOUT_NOT_FOUND

#define PGBUF_AOUT_NOT_FOUND `-2`

define PGBUF_BCB_ASYNC_FLUSH_REQ

#define PGBUF_BCB_ASYNC_FLUSH_REQ `(( int ) 0x02000000)`

define PGBUF_BCB_AVOID_DEALLOC_MASK

#define PGBUF_BCB_AVOID_DEALLOC_MASK `(( int ) 0x0000FFFF)`

define PGBUF_BCB_CHECK_MUTEX_LEAKS

#define PGBUF_BCB_CHECK_MUTEX_LEAKS (

) `if ( pgbuf_Monitor_locks ) pgbuf_bcbmon_check_mutex_leaks ()`

define PGBUF_BCB_CHECK_OWN

#define PGBUF_BCB_CHECK_OWN (
    bcb
) `if ( pgbuf_Monitor_locks ) pgbuf_bcbmon_check_own (bcb)`

define PGBUF_BCB_COUNT_FIX_SHIFT_BITS

#define PGBUF_BCB_COUNT_FIX_SHIFT_BITS `16`

define PGBUF_BCB_DIRTY_FLAG

#define PGBUF_BCB_DIRTY_FLAG `(( int ) 0x80000000)`

define PGBUF_BCB_FLAGS_MASK

#define PGBUF_BCB_FLAGS_MASK `/* multi line expression */`

define PGBUF_BCB_FLUSHING_TO_DISK_FLAG

#define PGBUF_BCB_FLUSHING_TO_DISK_FLAG `(( int ) 0x40000000)`

define PGBUF_BCB_INIT_FLAGS

#define PGBUF_BCB_INIT_FLAGS `PGBUF_INVALID_ZONE`

define PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG

#define PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG `(( int ) 0x10000000)`

define PGBUF_BCB_INVALID_VICTIM_CANDIDATE_MASK

#define PGBUF_BCB_INVALID_VICTIM_CANDIDATE_MASK `/* multi line expression */`

define PGBUF_BCB_LOCK

#define PGBUF_BCB_LOCK (
    bcb
) `( pgbuf_Monitor_locks ? pgbuf_bcbmon_lock (bcb, __LINE__ ) : ( void ) pthread_mutex_lock (&(bcb)->mutex))`

define PGBUF_BCB_MOVE_TO_LRU_BOTTOM_FLAG

#define PGBUF_BCB_MOVE_TO_LRU_BOTTOM_FLAG `(( int ) 0x08000000)`

define PGBUF_BCB_SIZEOF

#define PGBUF_BCB_SIZEOF `( sizeof ( PGBUF_BCB ))`

define PGBUF_BCB_TO_VACUUM_FLAG

#define PGBUF_BCB_TO_VACUUM_FLAG `(( int ) 0x04000000)`

define PGBUF_BCB_TRYLOCK

#define PGBUF_BCB_TRYLOCK (
    bcb
) `( pgbuf_Monitor_locks ? pgbuf_bcbmon_trylock (bcb, __LINE__ ) : pthread_mutex_trylock (&(bcb)->mutex))`

define PGBUF_BCB_UNLOCK

#define PGBUF_BCB_UNLOCK (
    bcb
) `( pgbuf_Monitor_locks ? pgbuf_bcbmon_unlock (bcb) : ( void ) pthread_mutex_unlock (&(bcb)->mutex))`

define PGBUF_BCB_VICTIM_DIRECT_FLAG

#define PGBUF_BCB_VICTIM_DIRECT_FLAG `(( int ) 0x20000000)`

define PGBUF_BUFFER_HASH_SIZEOF

#define PGBUF_BUFFER_HASH_SIZEOF `( sizeof ( PGBUF_BUFFER_HASH ))`

define PGBUF_BUFFER_LOCK_SIZEOF

#define PGBUF_BUFFER_LOCK_SIZEOF `( sizeof ( PGBUF_BUFFER_LOCK ))`

define PGBUF_CHKPT_BURST_PAGES

#define PGBUF_CHKPT_BURST_PAGES `16`

define PGBUF_CHKPT_MAX_FLUSH_RATE

#define PGBUF_CHKPT_MAX_FLUSH_RATE `1200`

define PGBUF_CHKPT_MIN_FLUSH_RATE

#define PGBUF_CHKPT_MIN_FLUSH_RATE `50`

define PGBUF_DEFAULT_FIX_COUNT

#define PGBUF_DEFAULT_FIX_COUNT `7`

define PGBUF_DESIRED_HIT_VS_MISS_RATE

#define PGBUF_DESIRED_HIT_VS_MISS_RATE `1000    /* 99.9% hit ratio */`

define PGBUF_FIND_BCB_PTR

#define PGBUF_FIND_BCB_PTR (
    i
) `(( PGBUF_BCB *) (( char *) &(pgbuf_Pool.BCB_table[0]) + ( PGBUF_BCB_SIZEOF * ( i ))))`

define PGBUF_FIND_BUFFER_GUARD

#define PGBUF_FIND_BUFFER_GUARD (
    bufptr
) `(&bufptr->iopage_buffer->iopage.page[ DB_PAGESIZE ])`

define PGBUF_FIND_IOPAGE_PTR

#define PGBUF_FIND_IOPAGE_PTR (
    i
) `(( PGBUF_IOPAGE_BUFFER *) (( char *) &(pgbuf_Pool.iopage_table[0]) + ( PGBUF_IOPAGE_BUFFER_SIZE * ( i ))))`

define PGBUF_FIND_IOPAGE_PTR_FROM_EXTERNAL_ALLOCATE

#define PGBUF_FIND_IOPAGE_PTR_FROM_EXTERNAL_ALLOCATE (
    alloc_memory,
    i
) `(( PGBUF_IOPAGE_BUFFER *) (( char *) ( alloc_memory ) + ( PGBUF_IOPAGE_BUFFER_SIZE * ( i ))))`

define PGBUF_FIX_COUNT_THRESHOLD

#define PGBUF_FIX_COUNT_THRESHOLD `64   /* fix count threshold. used as  indicator  for  hot pages. */`

define PGBUF_FLUSHED_BCBS_BUFFER_SIZE

#define PGBUF_FLUSHED_BCBS_BUFFER_SIZE `(8 * 1024)  /* 8 k */`

define PGBUF_FLUSH_VICTIM_BOOST_MULT

#define PGBUF_FLUSH_VICTIM_BOOST_MULT `10`

define PGBUF_GET_LRU_INDEX

#define PGBUF_GET_LRU_INDEX (
    flags
) `((flags) & PGBUF_LRU_INDEX_MASK )`

define PGBUF_GET_LRU_LIST

#define PGBUF_GET_LRU_LIST (
    lru_idx
) `(&pgbuf_Pool.buf_LRU_list[lru_idx])`

define PGBUF_GET_ZONE

#define PGBUF_GET_ZONE (
    flags
) `(( PGBUF_ZONE ) ((flags) & PGBUF_ZONE_MASK ))`

define PGBUF_HASH_SIZE

#define PGBUF_HASH_SIZE `(1 << HASH_SIZE_BITS )`

define PGBUF_HASH_VALUE

#define PGBUF_HASH_VALUE (
    vpid
) `pgbuf_hash_func_mirror ( vpid )`

define PGBUF_HOLDER_ANCHOR_SIZEOF

#define PGBUF_HOLDER_ANCHOR_SIZEOF `( sizeof ( PGBUF_HOLDER_ANCHOR ))`

define PGBUF_HOLDER_SET_SIZEOF

#define PGBUF_HOLDER_SET_SIZEOF `( sizeof ( PGBUF_HOLDER_SET ))`

define PGBUF_HOLDER_SIZEOF

#define PGBUF_HOLDER_SIZEOF `( sizeof ( PGBUF_HOLDER ))`

define PGBUF_IOPAGE_BUFFER_SIZE

#define PGBUF_IOPAGE_BUFFER_SIZE `(( size_t )( offsetof ( PGBUF_IOPAGE_BUFFER , iopage) + \ SIZEOF_IOPAGE_PAGESIZE_AND_GUARD ()))`

define PGBUF_IS_AUXILIARY_VOLUME

#define PGBUF_IS_AUXILIARY_VOLUME (
    volid
) `((volid) < LOG_DBFIRST_VOLID ? true : false )`

define PGBUF_IS_BCB_IN_LRU

#define PGBUF_IS_BCB_IN_LRU (
    bcb
) `(( pgbuf_bcb_get_zone (bcb) & PGBUF_LRU_ZONE_MASK ) != 0)`

define PGBUF_IS_BCB_IN_LRU_VICTIM_ZONE

#define PGBUF_IS_BCB_IN_LRU_VICTIM_ZONE (
    bcb
) `( pgbuf_bcb_get_zone (bcb) == PGBUF_LRU_3_ZONE )`

define PGBUF_IS_BCB_OLD_ENOUGH

#define PGBUF_IS_BCB_OLD_ENOUGH (
    bcb,
    lru_list
) `( PGBUF_AGE_DIFF ((bcb)->tick_lru_list, ( lru_list )->tick_list) >= (( lru_list )->count_lru2 / 2))`

define PGBUF_IS_PRIVATE_LRU_INDEX

#define PGBUF_IS_PRIVATE_LRU_INDEX (
    lru_idx
) `((lru_idx) >= PGBUF_SHARED_LRU_COUNT )`

define PGBUF_IS_PRIVATE_LRU_ONE_TWO_OVER_QUOTA

#define PGBUF_IS_PRIVATE_LRU_ONE_TWO_OVER_QUOTA (
    lru_idx
) `( PGBUF_IS_PRIVATE_LRU_INDEX (lru_idx) && PGBUF_LRU_LIST_IS_ONE_TWO_OVER_QUOTA ( PGBUF_GET_LRU_LIST (lru_idx)))`

define PGBUF_IS_PRIVATE_LRU_OVER_QUOTA

#define PGBUF_IS_PRIVATE_LRU_OVER_QUOTA (
    lru_idx
) `( PGBUF_IS_PRIVATE_LRU_INDEX (lru_idx) && PGBUF_LRU_LIST_IS_OVER_QUOTA ( PGBUF_GET_LRU_LIST (lru_idx)))`

define PGBUF_IS_SHARED_LRU_INDEX

#define PGBUF_IS_SHARED_LRU_INDEX (
    lru_idx
) `((lru_idx) < PGBUF_SHARED_LRU_COUNT )`

define PGBUF_LIMIT_AOUT_BUFFERS

#define PGBUF_LIMIT_AOUT_BUFFERS `32768`

define PGBUF_LRU_ARE_ZONES_ONE_TWO_OVER_THRESHOLD

#define PGBUF_LRU_ARE_ZONES_ONE_TWO_OVER_THRESHOLD (
    list
) `((list)->threshold_lru1 + (list)->threshold_lru2 < PGBUF_LRU_ZONE_ONE_TWO_COUNT (list))`

define PGBUF_LRU_INDEX_FROM_PRIVATE

#define PGBUF_LRU_INDEX_FROM_PRIVATE (
    private_id
) `( PGBUF_SHARED_LRU_COUNT + ( private_id ))`

define PGBUF_LRU_INDEX_MASK

#define PGBUF_LRU_INDEX_MASK `( PGBUF_LRU_LIST_MAX_COUNT - 1)   /* 0x0000FFFF */`

define PGBUF_LRU_IS_ZONE_ONE_OVER_THRESHOLD

#define PGBUF_LRU_IS_ZONE_ONE_OVER_THRESHOLD (
    list
) `((list)->threshold_lru1 < (list)->count_lru1)`

define PGBUF_LRU_IS_ZONE_TWO_OVER_THRESHOLD

#define PGBUF_LRU_IS_ZONE_TWO_OVER_THRESHOLD (
    list
) `((list)->threshold_lru2 < (list)->count_lru2)`

define PGBUF_LRU_LIST_COUNT

#define PGBUF_LRU_LIST_COUNT (
    list
) `( PGBUF_LRU_ZONE_ONE_TWO_COUNT (list) + (list)->count_lru3)`

define PGBUF_LRU_LIST_IS_ONE_TWO_OVER_QUOTA

#define PGBUF_LRU_LIST_IS_ONE_TWO_OVER_QUOTA (
    list
) `(( PGBUF_LRU_ZONE_ONE_TWO_COUNT (list) > (list)->quota))`

define PGBUF_LRU_LIST_IS_OVER_QUOTA

#define PGBUF_LRU_LIST_IS_OVER_QUOTA (
    list
) `( PGBUF_LRU_LIST_COUNT (list) > (list)->quota)`

define PGBUF_LRU_LIST_IS_OVER_QUOTA_WITH_BUFFER

#define PGBUF_LRU_LIST_IS_OVER_QUOTA_WITH_BUFFER (
    list
) `( PGBUF_LRU_LIST_COUNT (list) > (list)->quota + PGBUF_OVER_QUOTA_BUFFER ((list)->quota))`

define PGBUF_LRU_LIST_MAX_COUNT

#define PGBUF_LRU_LIST_MAX_COUNT `(( int ) 1 << PGBUF_LRU_NBITS )   /* 64 k */`

define PGBUF_LRU_LIST_OVER_QUOTA_COUNT

#define PGBUF_LRU_LIST_OVER_QUOTA_COUNT (
    list
) `( PGBUF_LRU_LIST_COUNT (list) - (list)->quota)`

define PGBUF_LRU_LIST_SIZEOF

#define PGBUF_LRU_LIST_SIZEOF `( sizeof ( PGBUF_LRU_LIST ))`

define PGBUF_LRU_NBITS

#define PGBUF_LRU_NBITS `16`

define PGBUF_LRU_VICTIM_LFCQ_FLAG

#define PGBUF_LRU_VICTIM_LFCQ_FLAG `(( int ) 0x80000000)`

define PGBUF_LRU_VICTIM_ZONE_COUNT

#define PGBUF_LRU_VICTIM_ZONE_COUNT (
    list
) `((list)->count_lru3)`

define PGBUF_LRU_ZONE_MAX_RATIO

#define PGBUF_LRU_ZONE_MAX_RATIO `0.90f`

define PGBUF_LRU_ZONE_MIN_RATIO

#define PGBUF_LRU_ZONE_MIN_RATIO `0.05f`

define PGBUF_LRU_ZONE_ONE_TWO_COUNT

#define PGBUF_LRU_ZONE_ONE_TWO_COUNT (
    list
) `((list)->count_lru1 + (list)->count_lru2)`

define PGBUF_MAKE_ZONE

#define PGBUF_MAKE_ZONE (
    list_id,
    zone
) `((list_id) | (zone))`

define PGBUF_MAX_NEIGHBOR_PAGES

#define PGBUF_MAX_NEIGHBOR_PAGES `32`

define PGBUF_MAX_PAGE_FIXED_BY_TRAN

#define PGBUF_MAX_PAGE_FIXED_BY_TRAN `64`

define PGBUF_MAX_PAGE_WATCHERS

#define PGBUF_MAX_PAGE_WATCHERS `64`

define PGBUF_MINIMUM_BUFFERS

#define PGBUF_MINIMUM_BUFFERS `( MAX_NTRANS * 10)`

define PGBUF_MIN_PAGES_IN_SHARED_LIST

#define PGBUF_MIN_PAGES_IN_SHARED_LIST `1000`

define PGBUF_MIN_SHARED_LIST_ADJUST_SIZE

#define PGBUF_MIN_SHARED_LIST_ADJUST_SIZE `50`

define PGBUF_MIN_VICTIM_REQ

#define PGBUF_MIN_VICTIM_REQ `10    /* set a  minimum number of  requests */`

define PGBUF_NEIGHBOR_FLUSH_NONDIRTY

#define PGBUF_NEIGHBOR_FLUSH_NONDIRTY `( prm_get_bool_value ( PRM_ID_PB_NEIGHBOR_FLUSH_NONDIRTY ))`

define PGBUF_NEIGHBOR_PAGES

#define PGBUF_NEIGHBOR_PAGES `( prm_get_integer_value ( PRM_ID_PB_NEIGHBOR_FLUSH_PAGES ))`

define PGBUF_NEIGHBOR_POS

#define PGBUF_NEIGHBOR_POS (
    idx
) `( PGBUF_NEIGHBOR_PAGES - 1 + (idx))`

define PGBUF_NUM_ALLOC_HOLDER

#define PGBUF_NUM_ALLOC_HOLDER `10`

define PGBUF_OVER_QUOTA_BUFFER

#define PGBUF_OVER_QUOTA_BUFFER (
    quota
) `MAX (10, ( int ) (quota * 0.01f))`

define PGBUF_PAGES_COUNT_THRESHOLD

#define PGBUF_PAGES_COUNT_THRESHOLD `4`

define PGBUF_PAGE_QUOTA_IS_ENABLED

#define PGBUF_PAGE_QUOTA_IS_ENABLED `(pgbuf_Pool.quota.num_private_LRU_list > 0)`

define PGBUF_PRIVATE_LIST_FROM_LRU_INDEX

#define PGBUF_PRIVATE_LIST_FROM_LRU_INDEX (
    i
) `(( i ) - PGBUF_SHARED_LRU_COUNT )`

define PGBUF_PRIVATE_LRU_COUNT

#define PGBUF_PRIVATE_LRU_COUNT `(pgbuf_Pool.quota.num_private_LRU_list)`

define PGBUF_PRIVATE_LRU_FROM_THREAD

#define PGBUF_PRIVATE_LRU_FROM_THREAD (
    thread_p
) `((thread_p) != NULL ) ? ((thread_p)->private_lru_index) : (0)`

define PGBUF_PRIVATE_LRU_MAX_HARD_QUOTA

#define PGBUF_PRIVATE_LRU_MAX_HARD_QUOTA `5000`

define PGBUF_PRIVATE_LRU_MIN_COUNT

#define PGBUF_PRIVATE_LRU_MIN_COUNT `4`

define PGBUF_SHARED_LRU_COUNT

#define PGBUF_SHARED_LRU_COUNT `(pgbuf_Pool.num_LRU_list)`

define PGBUF_SHOULD_IGNORE_UNFIX

#define PGBUF_SHOULD_IGNORE_UNFIX (
    th,
    buf
) `VACUUM_IS_THREAD_VACUUM_WORKER ( th ) || pgbuf_is_temporary_volume (buf-> vpid.volid )`

define PGBUF_TOTAL_LRU_COUNT

#define PGBUF_TOTAL_LRU_COUNT `( PGBUF_SHARED_LRU_COUNT + PGBUF_PRIVATE_LRU_COUNT )`

define PGBUF_TRAN_MAX_ACTIVITY

#define PGBUF_TRAN_MAX_ACTIVITY `(10 * PGBUF_TRAN_THRESHOLD_ACTIVITY )`

define PGBUF_TRAN_THRESHOLD_ACTIVITY

#define PGBUF_TRAN_THRESHOLD_ACTIVITY `(pgbuf_Pool.num_buffers / 4)`

define PGBUF_VACUUM_SHOULD_IGNORE_UNFIX

#define PGBUF_VACUUM_SHOULD_IGNORE_UNFIX (
    th
) `VACUUM_IS_THREAD_VACUUM_WORKER ( th )`

define SIZEOF_IOPAGE_PAGESIZE_AND_GUARD

#define SIZEOF_IOPAGE_PAGESIZE_AND_GUARD (

) `( IO_PAGESIZE + sizeof ( pgbuf_Guard ))`

define UINT16MAX

#define UINT16MAX `65534`

define VOLID_LSB_BITS

#define VOLID_LSB_BITS `8`

define WAIT_FLUSH_VICTIMS_MAX_MSEC

#define WAIT_FLUSH_VICTIMS_MAX_MSEC `1500.0f`

define detailed_er_log

#define detailed_er_log (
    ...
) `if ( detailed_logging ) _er_log_debug ( ARG_FILE_LINE , __VA_ARGS__ )`

define detailed_er_log

#define detailed_er_log (
    ...
) `if ( detailed_logging ) _er_log_debug ( ARG_FILE_LINE , __VA_ARGS__ )`


The documentation for this class was generated from the following file cubrid/src/storage/page_buffer.c