CUBRID Engine  latest
page_buffer.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <assert.h>
#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_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.h"
#include "resource_tracker.hpp"
#include "tde.h"
#include "show_scan.h"
#include "numeric_opfunc.h"
#include "dbtype.h"
#include "thread_entry.hpp"

Go to the source code of this file.

Classes

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

Macros

#define PGBUF_MINIMUM_BUFFERS   (MAX_NTRANS * 10)
 
#define PGBUF_DEFAULT_FIX_COUNT   7
 
#define PGBUF_NUM_ALLOC_HOLDER   10
 
#define pthread_mutex_init(a, b)
 
#define pthread_mutex_destroy(a)
 
#define pthread_mutex_lock(a)   0
 
#define pthread_mutex_unlock(a)
 
#define PGBUF_TIMEOUT   300 /* timeout seconds */
 
#define PGBUF_FIX_COUNT_THRESHOLD   64 /* fix count threshold. used as indicator for hot pages. */
 
#define SIZEOF_IOPAGE_PAGESIZE_AND_GUARD()   (IO_PAGESIZE)
 
#define PGBUF_BCB_SIZEOF   (sizeof (PGBUF_BCB))
 
#define PGBUF_IOPAGE_BUFFER_SIZE
 
#define PGBUF_BUFFER_HASH_SIZEOF   (sizeof (PGBUF_BUFFER_HASH))
 
#define PGBUF_BUFFER_LOCK_SIZEOF   (sizeof (PGBUF_BUFFER_LOCK))
 
#define PGBUF_LRU_LIST_SIZEOF   (sizeof (PGBUF_LRU_LIST))
 
#define PGBUF_HOLDER_SIZEOF   (sizeof (PGBUF_HOLDER))
 
#define PGBUF_HOLDER_SET_SIZEOF   (sizeof (PGBUF_HOLDER_SET))
 
#define PGBUF_HOLDER_ANCHOR_SIZEOF   (sizeof (PGBUF_HOLDER_ANCHOR))
 
#define PGBUF_FIND_BCB_PTR(i)   ((PGBUF_BCB *) ((char *) &(pgbuf_Pool.BCB_table[0]) + (PGBUF_BCB_SIZEOF * (i))))
 
#define PGBUF_FIND_IOPAGE_PTR(i)   ((PGBUF_IOPAGE_BUFFER *) ((char *) &(pgbuf_Pool.iopage_table[0]) + (PGBUF_IOPAGE_BUFFER_SIZE * (i))))
 
#define PGBUF_FIND_BUFFER_GUARD(bufptr)   (&bufptr->iopage_buffer->iopage.page[DB_PAGESIZE])
 
#define CAST_PGPTR_TO_BFPTR(bufptr, pgptr)
 
#define CAST_PGPTR_TO_IOPGPTR(io_pgptr, pgptr)
 
#define CAST_IOPGPTR_TO_PGPTR(pgptr, io_pgptr)
 
#define CAST_BFPTR_TO_PGPTR(pgptr, bufptr)
 
#define PGBUF_IS_AUXILIARY_VOLUME(volid)   ((volid) < LOG_DBFIRST_VOLID ? true : false)
 
#define PGBUF_LRU_NBITS   16
 
#define PGBUF_LRU_LIST_MAX_COUNT   ((int) 1 << PGBUF_LRU_NBITS) /* 64k */
 
#define PGBUF_LRU_INDEX_MASK   (PGBUF_LRU_LIST_MAX_COUNT - 1) /* 0x0000FFFF */
 
#define PGBUF_MAKE_ZONE(list_id, zone)   ((list_id) | (zone))
 
#define PGBUF_GET_ZONE(flags)   ((PGBUF_ZONE) ((flags) & PGBUF_ZONE_MASK))
 
#define PGBUF_GET_LRU_INDEX(flags)   ((flags) & PGBUF_LRU_INDEX_MASK)
 
#define PGBUF_BCB_DIRTY_FLAG   ((int) 0x80000000)
 
#define PGBUF_BCB_FLUSHING_TO_DISK_FLAG   ((int) 0x40000000)
 
#define PGBUF_BCB_VICTIM_DIRECT_FLAG   ((int) 0x20000000)
 
#define PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG   ((int) 0x10000000)
 
#define PGBUF_BCB_MOVE_TO_LRU_BOTTOM_FLAG   ((int) 0x08000000)
 
#define PGBUF_BCB_TO_VACUUM_FLAG   ((int) 0x04000000)
 
#define PGBUF_BCB_ASYNC_FLUSH_REQ   ((int) 0x02000000)
 
#define PGBUF_BCB_FLAGS_MASK
 
#define PGBUF_BCB_INVALID_VICTIM_CANDIDATE_MASK
 
#define PGBUF_BCB_INIT_FLAGS   PGBUF_INVALID_ZONE
 
#define PGBUF_BCB_COUNT_FIX_SHIFT_BITS   16
 
#define PGBUF_BCB_AVOID_DEALLOC_MASK   ((int) 0x0000FFFF)
 
#define PGBUF_TRAN_THRESHOLD_ACTIVITY   (pgbuf_Pool.num_buffers / 4)
 
#define PGBUF_TRAN_MAX_ACTIVITY   (10 * PGBUF_TRAN_THRESHOLD_ACTIVITY)
 
#define PGBUF_AOUT_NOT_FOUND   -2
 
#define PGBUF_THREAD_SHOULD_IGNORE_UNFIX(th)   false
 
#define HASH_SIZE_BITS   20
 
#define PGBUF_HASH_SIZE   (1 << HASH_SIZE_BITS)
 
#define PGBUF_HASH_VALUE(vpid)   pgbuf_hash_func_mirror(vpid)
 
#define PGBUF_FLUSH_VICTIM_BOOST_MULT   10
 
#define PGBUF_NEIGHBOR_FLUSH_NONDIRTY   (prm_get_bool_value (PRM_ID_PB_NEIGHBOR_FLUSH_NONDIRTY))
 
#define PGBUF_MAX_NEIGHBOR_PAGES   32
 
#define PGBUF_NEIGHBOR_PAGES   (prm_get_integer_value (PRM_ID_PB_NEIGHBOR_FLUSH_PAGES))
 
#define PGBUF_NEIGHBOR_POS(idx)   (PGBUF_NEIGHBOR_PAGES - 1 + (idx))
 
#define PGBUF_MAX_PAGE_WATCHERS   64
 
#define PGBUF_MAX_PAGE_FIXED_BY_TRAN   64
 
#define PGBUF_CHKPT_MAX_FLUSH_RATE   1200
 
#define PGBUF_CHKPT_MIN_FLUSH_RATE   50
 
#define PGBUF_CHKPT_BURST_PAGES   16
 
#define INIT_HOLDER_STAT(perf_stat)
 
#define PGBUF_LRU_ZONE_MIN_RATIO   0.05f
 
#define PGBUF_LRU_ZONE_MAX_RATIO   0.90f
 
#define AOUT_HASH_DIVIDE_RATIO   1000
 
#define AOUT_HASH_IDX(vpid, list)   ((vpid)->pageid % list->num_hashes)
 
#define PGBUF_BCB_LOCK(bcb)
 
#define PGBUF_BCB_TRYLOCK(bcb)   (0)
 
#define PGBUF_BCB_UNLOCK(bcb)
 
#define PGBUF_BCB_CHECK_OWN(bcb)   (true)
 
#define PGBUF_BCB_CHECK_MUTEX_LEAKS()
 
#define PGBUF_GET_LRU_LIST(lru_idx)   (&pgbuf_Pool.buf_LRU_list[lru_idx])
 
#define PGBUF_IS_BCB_IN_LRU_VICTIM_ZONE(bcb)   (pgbuf_bcb_get_zone (bcb) == PGBUF_LRU_3_ZONE)
 
#define PGBUF_IS_BCB_IN_LRU(bcb)   ((pgbuf_bcb_get_zone (bcb) & PGBUF_LRU_ZONE_MASK) != 0)
 
#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_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_LRU_ZONE_ONE_TWO_COUNT(list)   ((list)->count_lru1 + (list)->count_lru2)
 
#define PGBUF_LRU_LIST_COUNT(list)   (PGBUF_LRU_ZONE_ONE_TWO_COUNT(list) + (list)->count_lru3)
 
#define PGBUF_LRU_VICTIM_ZONE_COUNT(list)   ((list)->count_lru3)
 
#define PGBUF_LRU_IS_ZONE_ONE_OVER_THRESHOLD(list)   ((list)->threshold_lru1 < (list)->count_lru1)
 
#define PGBUF_LRU_IS_ZONE_TWO_OVER_THRESHOLD(list)   ((list)->threshold_lru2 < (list)->count_lru2)
 
#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_PRIVATE_LRU_MIN_COUNT   4
 
#define PGBUF_PRIVATE_LRU_MAX_HARD_QUOTA   5000
 
#define PGBUF_MIN_PAGES_IN_SHARED_LIST   1000
 
#define PGBUF_MIN_SHARED_LIST_ADJUST_SIZE   50
 
#define PGBUF_PAGE_QUOTA_IS_ENABLED   (pgbuf_Pool.quota.num_private_LRU_list > 0)
 
#define PGBUF_PRIVATE_LRU_FROM_THREAD(thread_p)   0
 
#define PGBUF_THREAD_HAS_PRIVATE_LRU(thread_p)   false
 
#define PGBUF_SHARED_LRU_COUNT   (pgbuf_Pool.num_LRU_list)
 
#define PGBUF_PRIVATE_LRU_COUNT   (pgbuf_Pool.quota.num_private_LRU_list)
 
#define PGBUF_TOTAL_LRU_COUNT   (PGBUF_SHARED_LRU_COUNT + PGBUF_PRIVATE_LRU_COUNT)
 
#define PGBUF_PRIVATE_LIST_FROM_LRU_INDEX(i)   ((i) - PGBUF_SHARED_LRU_COUNT)
 
#define PGBUF_LRU_INDEX_FROM_PRIVATE(private_id)   (PGBUF_SHARED_LRU_COUNT + (private_id))
 
#define PGBUF_IS_SHARED_LRU_INDEX(lru_idx)   ((lru_idx) < PGBUF_SHARED_LRU_COUNT)
 
#define PGBUF_IS_PRIVATE_LRU_INDEX(lru_idx)   ((lru_idx) >= PGBUF_SHARED_LRU_COUNT)
 
#define PGBUF_LRU_LIST_IS_OVER_QUOTA(list)   (PGBUF_LRU_LIST_COUNT (list) > (list)->quota)
 
#define PGBUF_LRU_LIST_IS_ONE_TWO_OVER_QUOTA(list)   ((PGBUF_LRU_ZONE_ONE_TWO_COUNT (list) > (list)->quota))
 
#define PGBUF_LRU_LIST_OVER_QUOTA_COUNT(list)   (PGBUF_LRU_LIST_COUNT (list) - (list)->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_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_OVER_QUOTA_BUFFER(quota)   MAX (10, (int) (quota * 0.01f))
 
#define PGBUF_LRU_LIST_IS_OVER_QUOTA_WITH_BUFFER(list)   (PGBUF_LRU_LIST_COUNT (list) > (list)->quota + PGBUF_OVER_QUOTA_BUFFER ((list)->quota))
 
#define PBGUF_BIG_PRIVATE_MIN_SIZE   100
 
#define PGBUF_LRU_VICTIM_LFCQ_FLAG   ((int) 0x80000000)
 
#define PGBUF_ABORT_RELEASE()   assert (false)
 
#define VOLID_LSB_BITS   8
 
#define detailed_er_log(...)   if (detailed_logging) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)
 
#define WAIT_FLUSH_VICTIMS_MAX_MSEC   1500.0f
 
#define detailed_er_log(...)   if (detailed_logging) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)
 
#define PGBUF_LIMIT_AOUT_BUFFERS   32768
 
#define PAGE_ADD_REFRESH_STAT   MAX (2 * pgbuf_Pool.num_buffers / PGBUF_SHARED_LRU_COUNT, 10000)
 
#define PERF(id)   if (detailed_perf) perfmon_inc_stat (thread_p, id)
 
#define PERF(pstatid)   if (perf_tracking) perfmon_inc_stat (thread_p, pstatid)
 
#define MAX_DEPTH   1000
 
#define PGBUF_PAGES_COUNT_THRESHOLD   4
 
#define MAX_PRIVATE_RATIO   0.998f
 
#define MIN_PRIVATE_RATIO   0.01f
 
#define PERF(id)   if (detailed_perf) perfmon_inc_stat (thread_p, id)
 
#define PERF(id)   if (detailed_perf) perfmon_inc_stat (thread_p, id)
 
#define PGBUF_MIN_VICTIM_REQ   10 /* set a minimum number of requests */
 
#define PGBUF_DESIRED_HIT_VS_MISS_RATE   1000 /* 99.9% hit ratio */
 

Typedefs

typedef struct pgbuf_holder PGBUF_HOLDER
 
typedef struct pgbuf_holder_anchor PGBUF_HOLDER_ANCHOR
 
typedef struct pgbuf_holder_set PGBUF_HOLDER_SET
 
typedef struct pgbuf_bcb PGBUF_BCB
 
typedef struct pgbuf_iopage_buffer PGBUF_IOPAGE_BUFFER
 
typedef struct pgbuf_aout_buf PGBUF_AOUT_BUF
 
typedef struct pgbuf_buffer_lock PGBUF_BUFFER_LOCK
 
typedef struct pgbuf_buffer_hash PGBUF_BUFFER_HASH
 
typedef struct pgbuf_lru_list PGBUF_LRU_LIST
 
typedef struct pgbuf_aout_list PGBUF_AOUT_LIST
 
typedef struct pgbuf_seq_flusher PGBUF_SEQ_FLUSHER
 
typedef struct pgbuf_invalid_list PGBUF_INVALID_LIST
 
typedef struct pgbuf_victim_candidate_list PGBUF_VICTIM_CANDIDATE_LIST
 
typedef struct pgbuf_buffer_pool PGBUF_BUFFER_POOL
 
typedef struct pgbuf_monitor_bcb_mutex PGBUF_MONITOR_BCB_MUTEX
 
typedef struct pgbuf_holder_info PGBUF_HOLDER_INFO
 
typedef struct pgbuf_status PGBUF_STATUS
 
typedef struct pgbuf_status_snapshot PGBUF_STATUS_SNAPSHOT
 
typedef struct pgbuf_status_old PGBUF_STATUS_OLD
 
typedef struct pgbuf_holder_stat PGBUF_HOLDER_STAT
 
typedef struct pgbuf_batch_flush_helper PGBUF_BATCH_FLUSH_HELPER
 
typedef struct pgbuf_page_monitor PGBUF_PAGE_MONITOR
 
typedef struct pgbuf_page_quota PGBUF_PAGE_QUOTA
 
typedef struct pgbuf_fix_perf PGBUF_FIX_PERF
 
typedef struct pgbuf_dealloc_undo_data PGBUF_DEALLOC_UNDO_DATA
 

Enumerations

enum  PGBUF_ZONE {
  PGBUF_LRU_1_ZONE = 1 << PGBUF_LRU_NBITS, PGBUF_LRU_2_ZONE = 2 << PGBUF_LRU_NBITS, PGBUF_LRU_3_ZONE = 3 << PGBUF_LRU_NBITS, PGBUF_LRU_ZONE_MASK = PGBUF_LRU_1_ZONE | PGBUF_LRU_2_ZONE | PGBUF_LRU_3_ZONE,
  PGBUF_INVALID_ZONE = 1 << (PGBUF_LRU_NBITS + 2), PGBUF_VOID_ZONE = 2 << (PGBUF_LRU_NBITS + 2), PGBUF_ZONE_MASK = (PGBUF_LRU_ZONE_MASK | PGBUF_INVALID_ZONE | PGBUF_VOID_ZONE)
}
 
enum  { PGBUF_LOCK_WAITER = 0, PGBUF_LOCK_HOLDER }
 
enum  { PGBUF_CONTENT_BAD = 0, PGBUF_CONTENT_GOOD, PGBUF_CONTENT_LIKELY_BAD, PGBUF_CONTENT_ERROR }
 
enum  {
  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
}
 

Functions

static INLINE unsigned int pgbuf_hash_func_mirror (const VPID *vpid) __attribute__((ALWAYS_INLINE))
 
static INLINE bool pgbuf_is_temporary_volume (VOLID volid) __attribute__((ALWAYS_INLINE))
 
static int pgbuf_initialize_bcb_table (void)
 
static int pgbuf_initialize_hash_table (void)
 
static int pgbuf_initialize_lock_table (void)
 
static int pgbuf_initialize_lru_list (void)
 
static int pgbuf_initialize_aout_list (void)
 
static int pgbuf_initialize_invalid_list (void)
 
static int pgbuf_initialize_page_quota_parameters (void)
 
static int pgbuf_initialize_page_quota (void)
 
static int pgbuf_initialize_page_monitor (void)
 
static int pgbuf_initialize_thrd_holder (void)
 
STATIC_INLINE PGBUF_HOLDERpgbuf_allocate_thrd_holder_entry (THREAD_ENTRY *thread_p) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE PGBUF_HOLDERpgbuf_find_thrd_holder (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int pgbuf_remove_thrd_holder (THREAD_ENTRY *thread_p, PGBUF_HOLDER *holder) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int pgbuf_unlatch_thrd_holder (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, PGBUF_HOLDER_STAT *holder_perf_stat_p) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int pgbuf_unlatch_bcb_upon_unfix (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, int holder_status) __attribute__((ALWAYS_INLINE))
 
static void pgbuf_unlatch_void_zone_bcb (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, int thread_private_lru_index)
 
STATIC_INLINE bool pgbuf_should_move_private_to_shared (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, int thread_private_lru_index) __attribute__((ALWAYS_INLINE))
 
static int pgbuf_block_bcb (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, PGBUF_LATCH_MODE request_mode, int request_fcnt, bool as_promote)
 
STATIC_INLINE 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) __attribute__((ALWAYS_INLINE))
 
static int pgbuf_latch_idle_page (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, PGBUF_LATCH_MODE request_mode)
 
STATIC_INLINE PGBUF_BCBpgbuf_search_hash_chain (THREAD_ENTRY *thread_p, PGBUF_BUFFER_HASH *hash_anchor, const VPID *vpid) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int pgbuf_insert_into_hash_chain (THREAD_ENTRY *thread_p, PGBUF_BUFFER_HASH *hash_anchor, PGBUF_BCB *bufptr) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int pgbuf_delete_from_hash_chain (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr) __attribute__((ALWAYS_INLINE))
 
static int pgbuf_lock_page (THREAD_ENTRY *thread_p, PGBUF_BUFFER_HASH *hash_anchor, const VPID *vpid)
 
static int pgbuf_unlock_page (THREAD_ENTRY *thread_p, PGBUF_BUFFER_HASH *hash_anchor, const VPID *vpid, int need_hash_mutex)
 
static PGBUF_BCBpgbuf_allocate_bcb (THREAD_ENTRY *thread_p, const VPID *src_vpid)
 
static PGBUF_BCBpgbuf_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)
 
static int pgbuf_victimize_bcb (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr)
 
static int pgbuf_bcb_safe_flush_internal (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, bool synchronous, bool *locked)
 
static int pgbuf_invalidate_bcb (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr)
 
static int pgbuf_bcb_safe_flush_force_lock (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, bool synchronous)
 
static int pgbuf_bcb_safe_flush_force_unlock (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, bool synchronous)
 
static PGBUF_BCBpgbuf_get_bcb_from_invalid_list (THREAD_ENTRY *thread_p)
 
static int pgbuf_put_bcb_into_invalid_list (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr)
 
STATIC_INLINE int pgbuf_get_shared_lru_index_for_add (void)
 
unsigned int pgbuf_hash_vpid (const void *key_vpid, unsigned int htsize)
 
int pgbuf_compare_vpid (const void *key_vpid1, const void *key_vpid2)
 
int pgbuf_initialize (void)
 
void pgbuf_finalize (void)
 
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)
 
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)
 
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)
 
void pgbuf_unfix_debug (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, const char *caller_file, int caller_line)
 
void pgbuf_unfix_all (THREAD_ENTRY *thread_p)
 
int pgbuf_invalidate_debug (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, const char *caller_file, int caller_line)
 
int pgbuf_invalidate_all_debug (THREAD_ENTRY *thread_p, VOLID volid, const char *caller_file, int caller_line)
 
void pgbuf_flush (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, bool free_page)
 
PAGE_PTR pgbuf_flush_with_wal (THREAD_ENTRY *thread_p, PAGE_PTR pgptr)
 
void pgbuf_flush_if_requested (THREAD_ENTRY *thread_p, PAGE_PTR page)
 
static int pgbuf_flush_all_helper (THREAD_ENTRY *thread_p, VOLID volid, bool is_unfixed_only, bool is_set_lsa_as_null)
 
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)
 
static int pgbuf_compare_victim_list (const void *p1, const void *p2)
 
static int pgbuf_get_victim_candidates_from_lru (THREAD_ENTRY *thread_p, int check_count, float lru_sum_flush_priority, bool *assigned_directly)
 
int pgbuf_flush_victim_candidates (THREAD_ENTRY *thread_p, float flush_ratio, PERF_UTIME_TRACKER *perf_tracker, bool *stop)
 
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)
 
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)
 
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)
 
void * pgbuf_copy_to_area (THREAD_ENTRY *thread_p, const VPID *vpid, int start_offset, int length, void *area, bool do_fetch)
 
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_set_dirty (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, bool free_page)
 
LOG_LSApgbuf_get_lsa (PAGE_PTR pgptr)
 
int pgbuf_page_has_changed (PAGE_PTR pgptr, LOG_LSA *ref_lsa)
 
const LOG_LSApgbuf_set_lsa (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, const LOG_LSA *lsa_ptr)
 
void pgbuf_reset_temp_lsa (PAGE_PTR pgptr)
 
void pgbuf_set_tde_algorithm (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, TDE_ALGORITHM tde_algo, bool skip_logging)
 
int pgbuf_rv_set_tde_algorithm (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
TDE_ALGORITHM pgbuf_get_tde_algorithm (PAGE_PTR pgptr)
 
void pgbuf_get_vpid (PAGE_PTR pgptr, VPID *vpid)
 
VPIDpgbuf_get_vpid_ptr (PAGE_PTR pgptr)
 
PGBUF_LATCH_MODE pgbuf_get_latch_mode (PAGE_PTR pgptr)
 
PAGEID pgbuf_get_page_id (PAGE_PTR pgptr)
 
PAGE_TYPE pgbuf_get_page_ptype (THREAD_ENTRY *thread_p, PAGE_PTR pgptr)
 
VOLID pgbuf_get_volume_id (PAGE_PTR pgptr)
 
const char * pgbuf_get_volume_label (PAGE_PTR pgptr)
 
void pgbuf_force_to_check_for_interrupts (void)
 
bool pgbuf_is_log_check_for_interrupts (THREAD_ENTRY *thread_p)
 
void pgbuf_set_lsa_as_temporary (THREAD_ENTRY *thread_p, PAGE_PTR pgptr)
 
STATIC_INLINE void pgbuf_set_bcb_page_vpid (PGBUF_BCB *bufptr, bool force_set_vpid)
 
void pgbuf_set_page_ptype (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, PAGE_TYPE ptype)
 
bool pgbuf_is_lsa_temporary (PAGE_PTR pgptr)
 
static PGBUF_BCBpgbuf_get_victim (THREAD_ENTRY *thread_p)
 
STATIC_INLINE bool pgbuf_is_bcb_fixed_by_any (PGBUF_BCB *bcb, bool has_mutex_lock)
 
STATIC_INLINE bool pgbuf_is_bcb_victimizable (PGBUF_BCB *bcb, bool has_mutex_lock)
 
static PGBUF_BCBpgbuf_get_victim_from_lru_list (THREAD_ENTRY *thread_p, const int lru_idx)
 
STATIC_INLINE void pgbuf_lru_add_bcb_to_top (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, PGBUF_LRU_LIST *lru_list)
 
STATIC_INLINE void pgbuf_lru_add_bcb_to_middle (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, PGBUF_LRU_LIST *lru_list)
 
STATIC_INLINE void pgbuf_lru_add_bcb_to_bottom (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, PGBUF_LRU_LIST *lru_list)
 
STATIC_INLINE void pgbuf_lru_adjust_zone1 (THREAD_ENTRY *thread_p, PGBUF_LRU_LIST *lru_list, bool min_one)
 
STATIC_INLINE void pgbuf_lru_adjust_zone2 (THREAD_ENTRY *thread_p, PGBUF_LRU_LIST *lru_list, bool min_one)
 
STATIC_INLINE void pgbuf_lru_adjust_zones (THREAD_ENTRY *thread_p, PGBUF_LRU_LIST *lru_list, bool min_one)
 
STATIC_INLINE void pgbuf_lru_fall_bcb_to_zone_3 (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, PGBUF_LRU_LIST *lru_list)
 
static void pgbuf_lru_boost_bcb (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_lru_add_new_bcb_to_top (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, int lru_idx)
 
STATIC_INLINE void pgbuf_lru_add_new_bcb_to_middle (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, int lru_idx)
 
STATIC_INLINE void pgbuf_lru_add_new_bcb_to_bottom (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, int lru_idx)
 
STATIC_INLINE void pgbuf_lru_remove_bcb (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
static void pgbuf_lru_move_from_private_to_shared (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_remove_from_lru_list (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, PGBUF_LRU_LIST *lru_list)
 
static void pgbuf_move_bcb_to_bottom_lru (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_add_vpid_to_aout_list (THREAD_ENTRY *thread_p, const VPID *vpid, const int lru_idx)
 
static int pgbuf_remove_vpid_from_aout_list (THREAD_ENTRY *thread_p, const VPID *vpid)
 
static int pgbuf_remove_private_from_aout_list (const int lru_idx)
 
STATIC_INLINE int pgbuf_bcb_flush_with_wal (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, bool is_page_flush_thread, bool *is_bcb_locked)
 
static void pgbuf_wake_flush_waiters (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_is_exist_blocked_reader_writer (PGBUF_BCB *bufptr)
 
STATIC_INLINE bool pgbuf_get_check_page_validation_level (int page_validation_level)
 
DISK_ISVALID pgbuf_is_valid_page (THREAD_ENTRY *thread_p, const VPID *vpid, bool no_error, DISK_ISVALID(*fun)(const VPID *vpid, void *args), void *args)
 
static bool pgbuf_is_valid_page_ptr (const PAGE_PTR pgptr)
 
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)
 
STATIC_INLINE bool pgbuf_check_page_ptype_internal (PAGE_PTR pgptr, PAGE_TYPE ptype, bool no_error)
 
STATIC_INLINE bool pgbuf_check_bcb_page_vpid (PGBUF_BCB *bufptr, bool maybe_deallocated)
 
static void pgbuf_add_fixed_at (PGBUF_HOLDER *holder, const char *caller_file, int caller_line, bool reset)
 
STATIC_INLINE void pgbuf_set_dirty_buffer_ptr (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr)
 
static void pgbuf_wakeup_page_flush_daemon (THREAD_ENTRY *thread_p)
 
bool pgbuf_has_perm_pages_fixed (THREAD_ENTRY *thread_p)
 
static int pgbuf_flush_page_and_neighbors_fb (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, int *flushed_pages)
 
STATIC_INLINE void pgbuf_add_bufptr_to_batch (PGBUF_BCB *bufptr, int idx)
 
STATIC_INLINE int pgbuf_flush_neighbor_safe (THREAD_ENTRY *thread_p, PGBUF_BCB *bufptr, VPID *expected_vpid, bool *flushed)
 
static int pgbuf_compare_hold_vpid_for_sort (const void *p1, const void *p2)
 
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)
 
static int pgbuf_get_groupid_and_unfix (THREAD_ENTRY *thread_p, const VPID *req_vpid, PAGE_PTR *pgptr, VPID *groupid, bool do_unfix)
 
void pgbuf_ordered_unfix_debug (THREAD_ENTRY *thread_p, PGBUF_WATCHER *watcher_object, const char *caller_file, int caller_line)
 
STATIC_INLINE 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)
 
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)
 
static PGBUF_HOLDERpgbuf_get_holder (THREAD_ENTRY *thread_p, PAGE_PTR pgptr)
 
static void pgbuf_remove_watcher (PGBUF_HOLDER *holder, PGBUF_WATCHER *watcher_object)
 
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_ordered_set_dirty_and_free (THREAD_ENTRY *thread_p, PGBUF_WATCHER *pg_watcher)
 
int pgbuf_get_condition_for_ordered_fix (const VPID *vpid_new_page, const VPID *vpid_fixed_page, const HFID *hfid)
 
void pgbuf_watcher_init_debug (PGBUF_WATCHER *watcher, const char *caller_file, const int caller_line, bool add)
 
bool pgbuf_is_page_fixed_by_thread (THREAD_ENTRY *thread_p, const VPID *vpid_p)
 
static void pgbuf_compute_lru_vict_target (float *lru_sum_flush_priority)
 
void pgbuf_adjust_quotas (THREAD_ENTRY *thread_p)
 
int pgbuf_assign_private_lru (THREAD_ENTRY *thread_p, bool is_vacuum, const int id)
 
int pgbuf_release_private_lru (THREAD_ENTRY *thread_p, const int private_idx)
 
static int pgbuf_initialize_seq_flusher (PGBUF_SEQ_FLUSHER *seq_flusher, PGBUF_VICTIM_CANDIDATE_LIST *f_list, const int cnt)
 
bool pgbuf_has_any_waiters (PAGE_PTR pgptr)
 
bool pgbuf_has_any_non_vacuum_waiters (PAGE_PTR pgptr)
 
bool pgbuf_has_prevent_dealloc (PAGE_PTR pgptr)
 
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_flush_control_from_dirty_ratio (void)
 
int pgbuf_rv_flush_page (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void pgbuf_rv_flush_page_dump (FILE *fp, int length, void *data)
 
static const char * pgbuf_latch_mode_str (PGBUF_LATCH_MODE latch_mode)
 
static const char * pgbuf_zone_str (PGBUF_ZONE zone)
 
static const char * pgbuf_consistent_str (int consistent)
 
int pgbuf_get_fix_count (PAGE_PTR pgptr)
 
int pgbuf_get_hold_count (THREAD_ENTRY *thread_p)
 
PERF_PAGE_TYPE pgbuf_get_page_type_for_stat (THREAD_ENTRY *thread_p, PAGE_PTR pgptr)
 
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)
 
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)
 
void pgbuf_dealloc_page (THREAD_ENTRY *thread_p, PAGE_PTR page_dealloc)
 
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_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)
 
STATIC_INLINE bool pgbuf_assign_direct_victim (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_lru_add_victim_candidate (THREAD_ENTRY *thread_p, PGBUF_LRU_LIST *lru_list, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_lru_remove_victim_candidate (THREAD_ENTRY *thread_p, PGBUF_LRU_LIST *lru_list, PGBUF_BCB *bcb)
 
STATIC_INLINE 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)
 
STATIC_INLINE void pgbuf_bcb_update_flags (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, int set_flags, int clear_flags)
 
STATIC_INLINE void pgbuf_bcb_change_zone (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, int new_lru_idx, PGBUF_ZONE new_zone)
 
STATIC_INLINE PGBUF_ZONE pgbuf_bcb_get_zone (const PGBUF_BCB *bcb)
 
STATIC_INLINE int pgbuf_bcb_get_lru_index (const PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_is_dirty (const PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_set_dirty (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_clear_dirty (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_mark_is_flushing (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_mark_was_flushed (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_mark_was_not_flushed (THREAD_ENTRY *thread_p, PGBUF_BCB *bcb, bool mark_dirty)
 
STATIC_INLINE bool pgbuf_bcb_is_flushing (const PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_is_direct_victim (const PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_is_invalid_direct_victim (const PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_is_async_flush_request (const PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_should_be_moved_to_bottom_lru (const PGBUF_BCB *bcb)
 
void pgbuf_notify_vacuum_follows (THREAD_ENTRY *thread_p, PAGE_PTR page)
 
STATIC_INLINE bool pgbuf_bcb_is_to_vacuum (const PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_avoid_victim (const PGBUF_BCB *bcb)
 
STATIC_INLINE int pgbuf_bcb_get_pool_index (const PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_register_avoid_deallocation (PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_unregister_avoid_deallocation (PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_should_avoid_deallocation (const PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_check_and_reset_fix_and_avoid_dealloc (PGBUF_BCB *bcb, const char *file, int line)
 
STATIC_INLINE void pgbuf_bcb_register_fix (PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_bcb_is_hot (const PGBUF_BCB *bcb)
 
STATIC_INLINE bool pgbuf_lfcq_add_lru_with_victims (PGBUF_LRU_LIST *lru_list)
 
static PGBUF_BCBpgbuf_lfcq_get_victim_from_private_lru (THREAD_ENTRY *thread_p, bool restricted)
 
static PGBUF_BCBpgbuf_lfcq_get_victim_from_shared_lru (THREAD_ENTRY *thread_p, bool multi_threaded)
 
STATIC_INLINE PGBUF_LRU_LISTpgbuf_lru_list_from_bcb (const PGBUF_BCB *bcb)
 
STATIC_INLINE void pgbuf_bcb_register_hit_for_lru (PGBUF_BCB *bcb)
 
bool pgbuf_is_io_stressful (void)
 
STATIC_INLINE bool pgbuf_is_hit_ratio_low (void)
 
static void pgbuf_flags_mask_sanity_check (void)
 
static void pgbuf_lru_sanity_check (const PGBUF_LRU_LIST *lru)
 
STATIC_INLINE int pgbuf_find_current_wait_msecs (THREAD_ENTRY *thread_p)
 
void pgbuf_get_page_flush_interval (bool &is_timed_wait, cubthread::delta_time &period)
 
void pgbuf_daemons_get_stats (UINT64 *stats_out)
 
static bool pgbuf_is_page_flush_daemon_available ()
 
static bool pgbuf_is_temp_lsa (const log_lsa &lsa)
 
static void pgbuf_init_temp_page_lsa (FILEIO_PAGE *io_page, PGLENGTH page_size)
 
static void pgbuf_scan_bcb_table ()
 
int pgbuf_start_scan (THREAD_ENTRY *thread_p, int type, DB_VALUE **arg_values, int arg_cnt, void **ptr)
 

Variables

const VPID vpid_Null_vpid = { NULL_PAGEID, NULL_VOLID }
 
static int rv
 
static PGBUF_BUFFER_POOL pgbuf_Pool
 
static PGBUF_BATCH_FLUSH_HELPER pgbuf_Flush_helper
 
HFIDpgbuf_ordered_null_hfid = NULL
 

Macro Definition Documentation

#define AOUT_HASH_DIVIDE_RATIO   1000

Definition at line 816 of file page_buffer.c.

Referenced by pgbuf_initialize_aout_list().

#define AOUT_HASH_IDX (   vpid,
  list 
)    ((vpid)->pageid % list->num_hashes)
#define CAST_BFPTR_TO_PGPTR (   pgptr,
  bufptr 
)
Value:
do { \
assert ((bufptr) == (bufptr)->iopage_buffer->bcb); \
(pgptr) = ((PAGE_PTR) ((char *) (bufptr->iopage_buffer) + offsetof (PGBUF_IOPAGE_BUFFER, iopage.page))); \
} while (0)
char * PAGE_PTR
#define assert(x)

Definition at line 155 of file page_buffer.c.

Referenced by pgbuf_bcb_flush_with_wal(), pgbuf_copy_to_area(), pgbuf_fix_debug(), pgbuf_ordered_fix_debug(), pgbuf_unfix_all(), pgbuf_unlatch_bcb_upon_unfix(), and pgbuf_unlatch_thrd_holder().

#define CAST_IOPGPTR_TO_PGPTR (   pgptr,
  io_pgptr 
)
Value:
do { \
(pgptr) = (PAGE_PTR) ((char *) (io_pgptr)->page); \
} while (0)
char * PAGE_PTR

Definition at line 150 of file page_buffer.c.

Referenced by pgbuf_claim_bcb_for_fix().

#define CAST_PGPTR_TO_IOPGPTR (   io_pgptr,
  pgptr 
)
Value:
do { \
(io_pgptr) = (FILEIO_PAGE *) ((char *) pgptr - offsetof (FILEIO_PAGE, page)); \
} while (0)

Definition at line 145 of file page_buffer.c.

Referenced by pgbuf_get_lsa(), pgbuf_get_page_type_for_stat(), pgbuf_get_tde_algorithm(), pgbuf_rv_dealloc_undo(), pgbuf_rv_dealloc_undo_compensate(), and pgbuf_set_tde_algorithm().

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

Definition at line 278 of file page_buffer.c.

#define INIT_HOLDER_STAT (   perf_stat)
Value:
do \
{ \
(perf_stat)->dirty_before_hold = 0; \
(perf_stat)->dirtied_by_holder = 0; \
(perf_stat)->hold_has_write_latch = 0; \
(perf_stat)->hold_has_read_latch = 0; \
} \
while (0)
while(1)
Definition: cnvlex.c:816

Definition at line 309 of file page_buffer.c.

Referenced by pgbuf_initialize_thrd_holder(), pgbuf_latch_bcb_upon_fix(), and pgbuf_unfix_debug().

#define MAX_DEPTH   1000
#define MAX_PRIVATE_RATIO   0.998f

Referenced by pgbuf_adjust_quotas().

#define MIN_PRIVATE_RATIO   0.01f

Referenced by pgbuf_adjust_quotas().

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

Definition at line 953 of file page_buffer.c.

Referenced by pgbuf_lfcq_get_victim_from_private_lru().

#define PERF (   pstatid)    if (perf_tracking) perfmon_inc_stat (thread_p, pstatid)
#define PERF (   id)    if (detailed_perf) perfmon_inc_stat (thread_p, id)
#define PERF (   id)    if (detailed_perf) perfmon_inc_stat (thread_p, id)
#define PGBUF_ABORT_RELEASE ( )    assert (false)

Definition at line 967 of file page_buffer.c.

Referenced by pgbuf_flags_mask_sanity_check(), and pgbuf_is_hit_ratio_low().

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

Definition at line 886 of file page_buffer.c.

Referenced by pgbuf_lru_add_victim_candidate().

#define PGBUF_BCB_ASYNC_FLUSH_REQ   ((int) 0x02000000)
#define PGBUF_BCB_AVOID_DEALLOC_MASK   ((int) 0x0000FFFF)
#define PGBUF_BCB_CHECK_OWN (   bcb)    (true)
#define PGBUF_BCB_COUNT_FIX_SHIFT_BITS   16

Definition at line 258 of file page_buffer.c.

Referenced by pgbuf_bcb_is_hot(), and pgbuf_bcb_register_fix().

#define PGBUF_BCB_FLAGS_MASK
Value:
#define PGBUF_BCB_DIRTY_FLAG
Definition: page_buffer.c:214
#define PGBUF_BCB_FLUSHING_TO_DISK_FLAG
Definition: page_buffer.c:217
#define PGBUF_BCB_VICTIM_DIRECT_FLAG
Definition: page_buffer.c:224
#define PGBUF_BCB_TO_VACUUM_FLAG
Definition: page_buffer.c:229
#define PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG
Definition: page_buffer.c:225
#define PGBUF_BCB_ASYNC_FLUSH_REQ
Definition: page_buffer.c:231
#define PGBUF_BCB_MOVE_TO_LRU_BOTTOM_FLAG
Definition: page_buffer.c:227

Definition at line 234 of file page_buffer.c.

Referenced by pgbuf_bcb_change_zone(), pgbuf_bcb_update_flags(), pgbuf_flags_mask_sanity_check(), and pgbuf_put_bcb_into_invalid_list().

#define PGBUF_BCB_FLUSHING_TO_DISK_FLAG   ((int) 0x40000000)
#define PGBUF_BCB_INIT_FLAGS   PGBUF_INVALID_ZONE

Definition at line 255 of file page_buffer.c.

Referenced by pgbuf_initialize_bcb_table().

#define PGBUF_BCB_INVALID_VICTIM_CANDIDATE_MASK
#define PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG   ((int) 0x10000000)
#define PGBUF_BCB_MOVE_TO_LRU_BOTTOM_FLAG   ((int) 0x08000000)
#define PGBUF_BCB_SIZEOF   (sizeof (PGBUF_BCB))

Definition at line 110 of file page_buffer.c.

Referenced by pgbuf_initialize_bcb_table().

#define PGBUF_BCB_TO_VACUUM_FLAG   ((int) 0x04000000)
#define PGBUF_BCB_TRYLOCK (   bcb)    (0)
#define PGBUF_BCB_VICTIM_DIRECT_FLAG   ((int) 0x20000000)
#define PGBUF_BUFFER_HASH_SIZEOF   (sizeof (PGBUF_BUFFER_HASH))

Definition at line 115 of file page_buffer.c.

Referenced by pgbuf_initialize_hash_table().

#define PGBUF_BUFFER_LOCK_SIZEOF   (sizeof (PGBUF_BUFFER_LOCK))

Definition at line 117 of file page_buffer.c.

Referenced by pgbuf_initialize_lock_table().

#define PGBUF_CHKPT_BURST_PAGES   16

Definition at line 307 of file page_buffer.c.

Referenced by pgbuf_flush_chkpt_seq_list().

#define PGBUF_CHKPT_MAX_FLUSH_RATE   1200

Definition at line 303 of file page_buffer.c.

Referenced by pgbuf_flush_seq_list().

#define PGBUF_CHKPT_MIN_FLUSH_RATE   50

Definition at line 304 of file page_buffer.c.

Referenced by pgbuf_flush_seq_list().

#define PGBUF_DEFAULT_FIX_COUNT   7

Definition at line 83 of file page_buffer.c.

Referenced by pgbuf_initialize_thrd_holder().

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

Referenced by pgbuf_is_hit_ratio_low().

#define PGBUF_FIND_BUFFER_GUARD (   bufptr)    (&bufptr->iopage_buffer->iopage.page[DB_PAGESIZE])
#define PGBUF_FIND_IOPAGE_PTR (   i)    ((PGBUF_IOPAGE_BUFFER *) ((char *) &(pgbuf_Pool.iopage_table[0]) + (PGBUF_IOPAGE_BUFFER_SIZE * (i))))

Definition at line 131 of file page_buffer.c.

Referenced by pgbuf_initialize_bcb_table().

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

Definition at line 100 of file page_buffer.c.

Referenced by pgbuf_bcb_is_hot(), and pgbuf_bcb_register_fix().

#define PGBUF_FLUSH_VICTIM_BOOST_MULT   10

Definition at line 286 of file page_buffer.c.

Referenced by pgbuf_flush_victim_candidates().

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

Definition at line 206 of file page_buffer.c.

Referenced by pgbuf_bcb_change_zone(), and pgbuf_bcb_get_lru_index().

#define PGBUF_GET_ZONE (   flags)    ((PGBUF_ZONE) ((flags) & PGBUF_ZONE_MASK))
#define PGBUF_HASH_SIZE   (1 << HASH_SIZE_BITS)

Definition at line 279 of file page_buffer.c.

Referenced by pgbuf_finalize(), and pgbuf_initialize_hash_table().

#define PGBUF_HOLDER_ANCHOR_SIZEOF   (sizeof (PGBUF_HOLDER_ANCHOR))

Definition at line 125 of file page_buffer.c.

Referenced by pgbuf_initialize_thrd_holder().

#define PGBUF_HOLDER_SET_SIZEOF   (sizeof (PGBUF_HOLDER_SET))

Definition at line 123 of file page_buffer.c.

Referenced by pgbuf_allocate_thrd_holder_entry().

#define PGBUF_HOLDER_SIZEOF   (sizeof (PGBUF_HOLDER))

Definition at line 121 of file page_buffer.c.

Referenced by pgbuf_initialize_thrd_holder().

#define PGBUF_IOPAGE_BUFFER_SIZE
Value:
((size_t)(offsetof (PGBUF_IOPAGE_BUFFER, iopage) + \
#define SIZEOF_IOPAGE_PAGESIZE_AND_GUARD()
Definition: page_buffer.c:106

Definition at line 111 of file page_buffer.c.

Referenced by pgbuf_initialize_bcb_table(), and pgbuf_start_scan().

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

Definition at line 162 of file page_buffer.c.

Referenced by pgbuf_set_lsa(), and pgbuf_unfix_debug().

#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_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)))

Definition at line 946 of file page_buffer.c.

Referenced by pgbuf_get_victim_from_lru_list().

#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)))

Definition at line 944 of file page_buffer.c.

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

Definition at line 899 of file page_buffer.c.

Referenced by pgbuf_adjust_quotas().

#define PGBUF_LRU_INDEX_FROM_PRIVATE (   private_id)    (PGBUF_SHARED_LRU_COUNT + (private_id))
#define PGBUF_LRU_INDEX_MASK   (PGBUF_LRU_LIST_MAX_COUNT - 1) /* 0x0000FFFF */

Definition at line 172 of file page_buffer.c.

Referenced by pgbuf_flags_mask_sanity_check(), and pgbuf_peek_stats().

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

Definition at line 897 of file page_buffer.c.

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

Definition at line 898 of file page_buffer.c.

#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 (   list)    ((PGBUF_LRU_ZONE_ONE_TWO_COUNT (list) > (list)->quota))

Definition at line 941 of file page_buffer.c.

Referenced by pgbuf_adjust_quotas(), and pgbuf_get_victim().

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

Definition at line 950 of file page_buffer.c.

Referenced by pgbuf_get_victim().

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

Definition at line 171 of file page_buffer.c.

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

Definition at line 942 of file page_buffer.c.

#define PGBUF_LRU_LIST_SIZEOF   (sizeof (PGBUF_LRU_LIST))

Definition at line 119 of file page_buffer.c.

Referenced by pgbuf_initialize_lru_list().

#define PGBUF_LRU_NBITS   16

Definition at line 170 of file page_buffer.c.

#define PGBUF_LRU_VICTIM_LFCQ_FLAG   ((int) 0x80000000)
#define PGBUF_LRU_VICTIM_ZONE_COUNT (   list)    ((list)->count_lru3)

Definition at line 895 of file page_buffer.c.

#define PGBUF_LRU_ZONE_MAX_RATIO   0.90f

Definition at line 324 of file page_buffer.c.

Referenced by pgbuf_initialize().

#define PGBUF_LRU_ZONE_MIN_RATIO   0.05f
#define PGBUF_LRU_ZONE_ONE_TWO_COUNT (   list)    ((list)->count_lru1 + (list)->count_lru2)

Definition at line 893 of file page_buffer.c.

Referenced by pgbuf_lru_adjust_zones().

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

Definition at line 204 of file page_buffer.c.

Referenced by pgbuf_bcb_change_zone().

#define PGBUF_MAX_NEIGHBOR_PAGES   32

Definition at line 291 of file page_buffer.c.

#define PGBUF_MAX_PAGE_FIXED_BY_TRAN   64

Definition at line 300 of file page_buffer.c.

Referenced by pgbuf_ordered_fix_debug().

#define PGBUF_MAX_PAGE_WATCHERS   64

Definition at line 298 of file page_buffer.c.

Referenced by pgbuf_add_watch_instance_internal(), and pgbuf_ordered_fix_debug().

#define PGBUF_MIN_PAGES_IN_SHARED_LIST   1000

Definition at line 909 of file page_buffer.c.

Referenced by pgbuf_initialize_lru_list().

#define PGBUF_MIN_SHARED_LIST_ADJUST_SIZE   50

Definition at line 910 of file page_buffer.c.

Referenced by pgbuf_adjust_quotas(), and pgbuf_compute_lru_vict_target().

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

Referenced by pgbuf_is_hit_ratio_low().

#define PGBUF_MINIMUM_BUFFERS   (MAX_NTRANS * 10)

Definition at line 77 of file page_buffer.c.

Referenced by pgbuf_initialize().

#define PGBUF_NEIGHBOR_FLUSH_NONDIRTY   (prm_get_bool_value (PRM_ID_PB_NEIGHBOR_FLUSH_NONDIRTY))

Definition at line 288 of file page_buffer.c.

Referenced by pgbuf_flush_page_and_neighbors_fb().

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

Definition at line 295 of file page_buffer.c.

Referenced by pgbuf_add_bufptr_to_batch(), and pgbuf_flush_page_and_neighbors_fb().

#define PGBUF_NUM_ALLOC_HOLDER   10

Definition at line 87 of file page_buffer.c.

Referenced by pgbuf_allocate_thrd_holder_entry().

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

Definition at line 949 of file page_buffer.c.

#define PGBUF_PAGE_QUOTA_IS_ENABLED   (pgbuf_Pool.quota.num_private_LRU_list > 0)
#define PGBUF_PAGES_COUNT_THRESHOLD   4
#define PGBUF_PRIVATE_LIST_FROM_LRU_INDEX (   i)    ((i) - PGBUF_SHARED_LRU_COUNT)

Definition at line 934 of file page_buffer.c.

Referenced by pgbuf_assign_private_lru(), and pgbuf_initialize_page_quota().

#define PGBUF_PRIVATE_LRU_COUNT   (pgbuf_Pool.quota.num_private_LRU_list)
#define PGBUF_PRIVATE_LRU_FROM_THREAD (   thread_p)    0
#define PGBUF_PRIVATE_LRU_MAX_HARD_QUOTA   5000

Definition at line 906 of file page_buffer.c.

Referenced by pgbuf_adjust_quotas().

#define PGBUF_PRIVATE_LRU_MIN_COUNT   4

Definition at line 905 of file page_buffer.c.

Referenced by pgbuf_initialize_page_quota_parameters().

#define PGBUF_SHARED_LRU_COUNT   (pgbuf_Pool.num_LRU_list)
#define PGBUF_THREAD_HAS_PRIVATE_LRU (   thread_p)    false
#define PGBUF_THREAD_SHOULD_IGNORE_UNFIX (   th)    false
#define PGBUF_TIMEOUT   300 /* timeout seconds */

Definition at line 99 of file page_buffer.c.

Referenced by pgbuf_allocate_bcb(), and pgbuf_block_bcb().

#define PGBUF_TRAN_MAX_ACTIVITY   (10 * PGBUF_TRAN_THRESHOLD_ACTIVITY)

Definition at line 267 of file page_buffer.c.

Referenced by pgbuf_assign_private_lru().

#define PGBUF_TRAN_THRESHOLD_ACTIVITY   (pgbuf_Pool.num_buffers / 4)

Definition at line 266 of file page_buffer.c.

Referenced by pgbuf_adjust_quotas().

#define pthread_mutex_destroy (   a)

Definition at line 92 of file page_buffer.c.

Referenced by pgbuf_finalize(), and pgbuf_initialize_aout_list().

#define SIZEOF_IOPAGE_PAGESIZE_AND_GUARD ( )    (IO_PAGESIZE)

Definition at line 106 of file page_buffer.c.

#define VOLID_LSB_BITS   8
#define WAIT_FLUSH_VICTIMS_MAX_MSEC   1500.0f

Typedef Documentation

Definition at line 347 of file page_buffer.c.

Definition at line 353 of file page_buffer.c.

Definition at line 425 of file page_buffer.c.

typedef struct pgbuf_bcb PGBUF_BCB

Definition at line 345 of file page_buffer.c.

Definition at line 350 of file page_buffer.c.

Definition at line 349 of file page_buffer.c.

Definition at line 359 of file page_buffer.c.

Definition at line 868 of file page_buffer.c.

Definition at line 850 of file page_buffer.c.

typedef struct pgbuf_holder PGBUF_HOLDER

Definition at line 341 of file page_buffer.c.

Definition at line 342 of file page_buffer.c.

Definition at line 363 of file page_buffer.c.

Definition at line 343 of file page_buffer.c.

Definition at line 414 of file page_buffer.c.

Definition at line 356 of file page_buffer.c.

Definition at line 346 of file page_buffer.c.

Definition at line 352 of file page_buffer.c.

Definition at line 361 of file page_buffer.c.

Definition at line 650 of file page_buffer.c.

Definition at line 672 of file page_buffer.c.

Definition at line 354 of file page_buffer.c.

typedef struct pgbuf_status PGBUF_STATUS

Definition at line 365 of file page_buffer.c.

Definition at line 367 of file page_buffer.c.

Definition at line 366 of file page_buffer.c.

Definition at line 357 of file page_buffer.c.

Enumeration Type Documentation

anonymous enum
Enumerator
PGBUF_LOCK_WAITER 
PGBUF_LOCK_HOLDER 

Definition at line 327 of file page_buffer.c.

anonymous enum
Enumerator
PGBUF_CONTENT_BAD 
PGBUF_CONTENT_GOOD 
PGBUF_CONTENT_LIKELY_BAD 
PGBUF_CONTENT_ERROR 

Definition at line 333 of file page_buffer.c.

anonymous enum
Enumerator
NEIGHBOR_ABORT_RANGE 
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 

Definition at line 10951 of file page_buffer.c.

enum PGBUF_ZONE
Enumerator
PGBUF_LRU_1_ZONE 
PGBUF_LRU_2_ZONE 
PGBUF_LRU_3_ZONE 
PGBUF_LRU_ZONE_MASK 
PGBUF_INVALID_ZONE 
PGBUF_VOID_ZONE 
PGBUF_ZONE_MASK 

Definition at line 175 of file page_buffer.c.

Function Documentation

STATIC_INLINE 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 
)
void pgbuf_adjust_quotas ( THREAD_ENTRY thread_p)

Definition at line 13052 of file page_buffer.c.

References pgbuf_page_quota::adjust_age, assert, pgbuf_buffer_pool::buf_invalid_list, pgbuf_lru_list::count_lru1, pgbuf_lru_list::count_lru2, pgbuf_lru_list::count_vict_cand, i, pgbuf_invalid_list::invalid_cnt, pgbuf_page_quota::is_adjusting, pgbuf_page_quota::last_adjust_time, pgbuf_page_monitor::lru_activity, pgbuf_page_monitor::lru_hits, MAX_PRIVATE_RATIO, MIN_PRIVATE_RATIO, pgbuf_buffer_pool::monitor, NULL, pgbuf_buffer_pool::num_buffers, pgbuf_buffer_pool::num_LRU_list, PERFMON_ACTIVATION_FLAG_PB_VICTIMIZATION, perfmon_is_perf_tracking_and_active(), pgbuf_page_monitor::pg_unfix_cnt, PGBUF_BCB_CHECK_MUTEX_LEAKS, PGBUF_GET_LRU_LIST, PGBUF_IS_PRIVATE_LRU_INDEX, pgbuf_lfcq_add_lru_with_victims(), pgbuf_lru_adjust_zones(), PGBUF_LRU_ARE_ZONES_ONE_TWO_OVER_THRESHOLD, PGBUF_LRU_LIST_IS_ONE_TWO_OVER_QUOTA, PGBUF_LRU_LIST_IS_OVER_QUOTA, PGBUF_LRU_ZONE_MIN_RATIO, PGBUF_MIN_SHARED_LIST_ADJUST_SIZE, PGBUF_PAGE_QUOTA_IS_ENABLED, PGBUF_PRIVATE_LRU_MAX_HARD_QUOTA, PGBUF_SHARED_LRU_COUNT, PGBUF_TOTAL_LRU_COUNT, PGBUF_TRAN_THRESHOLD_ACTIVITY, pgbuf_page_quota::private_pages_ratio, pthread_mutex_lock, pthread_mutex_unlock, pgbuf_lru_list::quota, pgbuf_buffer_pool::quota, pgbuf_buffer_pool::ratio_lru1, pgbuf_buffer_pool::ratio_lru2, thread_get_thread_entry_info(), pgbuf_lru_list::threshold_lru1, pgbuf_lru_list::threshold_lru2, tsc_elapsed_utime(), tsc_getticks(), and pgbuf_page_monitor::victim_rich.

Referenced by pgbuf_assign_private_lru(), pgbuf_get_page_flush_interval(), and pgbuf_release_private_lru().

Here is the caller graph for this function:

STATIC_INLINE bool pgbuf_assign_direct_victim ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb 
)
STATIC_INLINE void pgbuf_bcb_check_and_reset_fix_and_avoid_dealloc ( PGBUF_BCB bcb,
const char *  file,
int  line 
)
STATIC_INLINE void pgbuf_bcb_clear_dirty ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb 
)

Definition at line 14861 of file page_buffer.c.

References PGBUF_BCB_DIRTY_FLAG, pgbuf_bcb_update_flags(), and STATIC_INLINE.

Referenced by pgbuf_invalidate_bcb().

Here is the caller graph for this function:

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

Definition at line 9897 of file page_buffer.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, pgbuf_holder::bufptr, CAST_BFPTR_TO_PGPTR, dwb_add_page(), dwb_is_created(), dwb_set_data_on_next_slot(), ER_FAILED, er_log_debug, error(), fileio_get_volume_descriptor(), fileio_write(), FILEIO_WRITE_DEFAULT_WRITE, FILEIO_WRITE_NO_COMPENSATE_WRITE, IO_MAX_PAGE_SIZE, IO_PAGESIZE, pgbuf_iopage_buffer::iopage, pgbuf_bcb::iopage_buffer, pgbuf_bcb::latch_mode, LOG_FIND_THREAD_TRAN_INDEX, logpb_flush_log_for_wal(), fileio_page_reserved::lsa, LSA_COPY(), LSA_ISNULL(), LSA_SET_NULL(), MAX_ALIGNMENT, NO_ERROR, NULL, pgbuf_status::num_pages_written, pgbuf_bcb::oldest_unflush_lsa, vpid::pageid, PERFMON_ACTIVATION_FLAG_PB_VICTIMIZATION, perfmon_inc_stat(), perfmon_is_perf_tracking_and_active(), PGBUF_BCB_CHECK_OWN, PGBUF_BCB_LOCK, pgbuf_bcb_mark_is_flushing(), pgbuf_bcb_mark_was_flushed(), pgbuf_bcb_mark_was_not_flushed(), PGBUF_BCB_UNLOCK, pgbuf_check_bcb_page_vpid(), pgbuf_get_tde_algorithm(), pgbuf_is_temporary_volume(), PGBUF_LATCH_FLUSH, PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, PGBUF_NO_LATCH, pgbuf_wake_flush_waiters(), fileio_page::prv, PSTAT_PB_FLUSH_PAGE_FLUSHED, PSTAT_PB_FLUSH_SEND_DIRTY_TO_POST_FLUSH, PSTAT_PB_NUM_IOWRITES, PTR_ALIGN, qmgr_get_current_query_id(), pgbuf_buffer_pool::show_status, TDE_ALGORITHM_NONE, tde_encrypt_data_page(), pgbuf_holder_anchor::thrd_hold_list, pgbuf_buffer_pool::thrd_holder_info, pgbuf_holder::thrd_link, vpid::volid, pgbuf_bcb::vpid, VPID_AS_ARGS, and cubthread::daemon::wakeup().

Referenced by pgbuf_bcb_safe_flush_internal(), pgbuf_flush_neighbor_safe(), and pgbuf_flush_victim_candidates().

Here is the caller graph for this function:

STATIC_INLINE int pgbuf_bcb_get_pool_index ( const PGBUF_BCB bcb)

Definition at line 15028 of file page_buffer.c.

References pgbuf_buffer_pool::BCB_table, and STATIC_INLINE.

Referenced by pgbuf_check_bcb_page_vpid(), and pgbuf_unfix_all().

Here is the caller graph for this function:

STATIC_INLINE bool pgbuf_bcb_is_async_flush_request ( const PGBUF_BCB bcb)
STATIC_INLINE bool pgbuf_bcb_is_direct_victim ( const PGBUF_BCB bcb)

Definition at line 14938 of file page_buffer.c.

References pgbuf_bcb::flags, PGBUF_BCB_VICTIM_DIRECT_FLAG, and STATIC_INLINE.

Referenced by pgbuf_assign_direct_victim(), pgbuf_fix_debug(), and pgbuf_invalidate_bcb().

Here is the caller graph for this function:

STATIC_INLINE bool pgbuf_bcb_is_hot ( const PGBUF_BCB bcb)

Definition at line 15154 of file page_buffer.c.

References assert, pgbuf_bcb::count_fix_and_avoid_dealloc, PGBUF_BCB_COUNT_FIX_SHIFT_BITS, PGBUF_FIX_COUNT_THRESHOLD, and STATIC_INLINE.

Referenced by pgbuf_should_move_private_to_shared().

Here is the caller graph for this function:

STATIC_INLINE bool pgbuf_bcb_is_invalid_direct_victim ( const PGBUF_BCB bcb)

Definition at line 14950 of file page_buffer.c.

References pgbuf_bcb::flags, PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG, and STATIC_INLINE.

Referenced by pgbuf_assign_direct_victim().

Here is the caller graph for this function:

STATIC_INLINE bool pgbuf_bcb_is_to_vacuum ( const PGBUF_BCB bcb)

Definition at line 15002 of file page_buffer.c.

References pgbuf_bcb::flags, PGBUF_BCB_TO_VACUUM_FLAG, and STATIC_INLINE.

Referenced by pgbuf_lru_fall_bcb_to_zone_3(), and pgbuf_victimize_bcb().

Here is the caller graph for this function:

STATIC_INLINE bool pgbuf_bcb_mark_is_flushing ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb 
)

Definition at line 14876 of file page_buffer.c.

References PGBUF_BCB_ASYNC_FLUSH_REQ, PGBUF_BCB_DIRTY_FLAG, PGBUF_BCB_FLUSHING_TO_DISK_FLAG, pgbuf_bcb_is_dirty(), pgbuf_bcb_update_flags(), and STATIC_INLINE.

Referenced by pgbuf_bcb_flush_with_wal().

Here is the caller graph for this function:

STATIC_INLINE void pgbuf_bcb_mark_was_flushed ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb 
)

Definition at line 14899 of file page_buffer.c.

References PGBUF_BCB_FLUSHING_TO_DISK_FLAG, pgbuf_bcb_update_flags(), and STATIC_INLINE.

Referenced by pgbuf_assign_direct_victim(), and pgbuf_bcb_flush_with_wal().

Here is the caller graph for this function:

STATIC_INLINE void pgbuf_bcb_mark_was_not_flushed ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb,
bool  mark_dirty 
)

Definition at line 14913 of file page_buffer.c.

References PGBUF_BCB_DIRTY_FLAG, PGBUF_BCB_FLUSHING_TO_DISK_FLAG, pgbuf_bcb_update_flags(), and STATIC_INLINE.

Referenced by pgbuf_bcb_flush_with_wal().

Here is the caller graph for this function:

STATIC_INLINE void pgbuf_bcb_register_avoid_deallocation ( PGBUF_BCB bcb)

Definition at line 15040 of file page_buffer.c.

References assert, pgbuf_bcb::count_fix_and_avoid_dealloc, and STATIC_INLINE.

Referenced by pgbuf_fix_debug(), and pgbuf_ordered_fix_debug().

Here is the caller graph for this function:

STATIC_INLINE void pgbuf_bcb_register_fix ( PGBUF_BCB bcb)

Definition at line 15133 of file page_buffer.c.

References assert, pgbuf_bcb::count_fix_and_avoid_dealloc, PGBUF_BCB_COUNT_FIX_SHIFT_BITS, PGBUF_FIX_COUNT_THRESHOLD, and STATIC_INLINE.

Referenced by pgbuf_fix_debug().

Here is the caller graph for this function:

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

Definition at line 7985 of file page_buffer.c.

References NO_ERROR, PGBUF_BCB_LOCK, pgbuf_bcb_safe_flush_internal(), and PGBUF_BCB_UNLOCK.

Referenced by pgbuf_flush_seq_list(), pgbuf_invalidate_all_debug(), and pgbuf_invalidate_debug().

Here is the caller graph for this function:

static int pgbuf_bcb_safe_flush_force_unlock ( THREAD_ENTRY thread_p,
PGBUF_BCB bufptr,
bool  synchronous 
)
static
STATIC_INLINE bool pgbuf_bcb_should_avoid_deallocation ( const PGBUF_BCB bcb)
STATIC_INLINE bool pgbuf_bcb_should_be_moved_to_bottom_lru ( const PGBUF_BCB bcb)

Definition at line 14974 of file page_buffer.c.

References pgbuf_bcb::flags, and PGBUF_BCB_MOVE_TO_LRU_BOTTOM_FLAG.

Referenced by pgbuf_unlatch_bcb_upon_unfix().

Here is the caller graph for this function:

STATIC_INLINE void pgbuf_bcb_unregister_avoid_deallocation ( PGBUF_BCB bcb)
STATIC_INLINE bool pgbuf_check_bcb_page_vpid ( PGBUF_BCB bufptr,
bool  maybe_deallocated 
)

Definition at line 10415 of file page_buffer.c.

References ARG_FILE_LINE, assert, DB_PAGESIZE, er_log_debug, pgbuf_bcb::fcnt, fileio_get_volume_descriptor(), fileio_init_lsa_of_page(), fileio_page_check_corruption(), fileio_read(), free_and_init, i, IO_PAGESIZE, pgbuf_iopage_buffer::iopage, pgbuf_bcb::iopage_buffer, pgbuf_bcb::latch_mode, log_is_in_crash_recovery_and_not_yet_completes_redo(), fileio_page_reserved::lsa, LSA_AS_ARGS, LSA_EQ(), MEM_REGION_INIT, MEM_REGION_SCRAMBLE_MARK, NO_ERROR, NULL, NULL_VOLID, pgbuf_buffer_pool::num_buffers, fileio_page_reserved::p_reserve_1, fileio_page_reserved::p_reserve_2, fileio_page::page, fileio_page_reserved::pageid, vpid::pageid, fileio_page_reserved::pflag, pgbuf_bcb_get_pool_index(), pgbuf_bcb_is_async_flush_request(), pgbuf_bcb_is_dirty(), pgbuf_bcb_is_flushing(), PGBUF_BCB_LOCK, PGBUF_BCB_UNLOCK, pgbuf_consistent_str(), PGBUF_CONTENT_BAD, PGBUF_CONTENT_GOOD, PGBUF_CONTENT_LIKELY_BAD, PGBUF_DEBUG_PAGE_VALIDATION_ALL, PGBUF_FIND_BCB_PTR, PGBUF_FIND_BUFFER_GUARD, pgbuf_get_check_page_validation_level(), PGBUF_LATCH_INVALID, pgbuf_latch_mode_str(), fileio_page::prv, pthread_mutex_lock, pthread_mutex_unlock, fileio_page_reserved::ptype, rv, fileio_page_reserved::tde_nonce, thread_get_thread_entry_info(), fileio_page_reserved::volid, vpid::volid, pgbuf_bcb::vpid, VPID_AS_ARGS, and VPID_ISNULL.

Referenced by pgbuf_bcb_flush_with_wal(), pgbuf_check_page_ptype_internal(), pgbuf_fix_debug(), pgbuf_get_page_id(), pgbuf_get_page_ptype(), pgbuf_set_page_ptype(), and pgbuf_unlatch_bcb_upon_unfix().

Here is the caller graph for this function:

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

Definition at line 10326 of file page_buffer.c.

References pgbuf_check_page_ptype_internal().

Referenced by btree_advance_to_next_slot_and_fix_page(), btree_build_nleafs(), btree_check_pages(), btree_check_tree(), btree_find_AR_sampling_leaf(), btree_find_boundary_leaf(), btree_find_free_overflow_oids_page(), btree_find_key(), btree_find_key_from_nleaf(), btree_find_min_or_max_key(), btree_find_next_index_record_holding_current_helper(), btree_fix_ovfl_oid_page(), btree_fix_ovfl_oid_pages_tree(), btree_get_asc_desc(), btree_get_new_page(), btree_get_next_page(), btree_get_node_header(), btree_get_num_visible_oids_from_all_ovf(), btree_get_overflow_header(), btree_get_root_header(), btree_get_stats(), btree_get_subtree_capacity(), btree_get_unique_statistics(), btree_index_capacity(), btree_key_find_first_visible_row_from_all_ovf(), btree_load_new_page(), btree_merge_node(), btree_merge_node_and_advance(), btree_node_number_of_keys(), btree_read_key_type(), btree_reflect_global_unique_statistics(), btree_repair_prev_link_by_btid(), btree_replace_first_oid_with_ovfl_oid(), btree_rv_read_keyval_info_nocopy(), btree_verify_subtree(), btree_verify_tree(), catalog_adjust_directory_count(), catalog_check_class_consistency(), catalog_create(), catalog_drop_disk_representation_from_page(), catalog_drop_representation_class_from_page(), catalog_drop_representation_helper(), catalog_fetch_btree_statistics(), catalog_file_map_find_optimal_page(), catalog_get_class_info(), catalog_get_new_page(), catalog_get_record_from_page(), catalog_get_rep_dir(), catalog_get_representation_record(), catalog_update_class_info(), disk_rv_reserve_sectors(), disk_rv_unreserve_sectors(), disk_verify_volume_header(), disk_volheader_check_magic(), ehash_create_helper(), ehash_fix_old_page(), ehash_insert_to_bucket_after_create(), heap_check_all_pages(), heap_compact_pages(), heap_delete_bigone(), heap_estimate(), heap_find_location_and_insert_rec_newhome(), heap_fix_forward_page(), heap_fix_header_page(), heap_flush(), heap_get_num_objects(), heap_ovf_find_vfid(), heap_reuse(), heap_rv_redo_reuse_page(), heap_rv_undoredo_pagehdr(), heap_scan_pb_lock_and_fetch_debug(), heap_stats_find_best_page(), heap_stats_sync_bestspace(), heap_stats_update_internal(), heap_vacuum_all_objects(), heap_vpid_next(), heap_vpid_prev(), orc_diskrep_from_record(), overflow_get_capacity(), overflow_get_length(), overflow_get_nbytes(), overflow_insert(), overflow_traverse(), overflow_update(), pgbuf_copy_to_area(), pgbuf_ordered_fix_debug(), qfile_reopen_list_as_append_mode(), qmgr_get_old_page(), scan_open_index_scan(), vacuum_heap_page(), xbtree_add_index(), xbtree_delete_index(), xbtree_get_unique_pk(), xfile_apply_tde_to_class_files(), and xheap_reclaim_addresses().

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

Definition at line 10341 of file page_buffer.c.

References pgbuf_check_page_ptype_internal(), and STATIC_INLINE.

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 
)
static

Definition at line 7617 of file page_buffer.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, CAST_IOPGPTR_TO_PGPTR, dwb_read_page(), pgbuf_fix_perf::end_tick, ER_CSS_PTHREAD_MUTEX_TRYLOCK, er_errid(), fileio_get_volume_descriptor(), fileio_init_lsa_of_page(), fileio_read(), IO_PAGESIZE, pgbuf_iopage_buffer::iopage, pgbuf_bcb::iopage_buffer, pgbuf_fix_perf::is_perf_tracking, pgbuf_bcb::latch_mode, pgbuf_fix_perf::lock_wait_time, LOG_FIND_THREAD_TRAN_INDEX, log_is_in_crash_recovery(), fileio_page_reserved::lsa, LSA_ISNULL(), LSA_SET_NULL(), NEW_PAGE, NO_ERROR, NULL, NULL_VOLID, pgbuf_status::num_hit, pgbuf_status::num_pages_created, pgbuf_status::num_pages_read, OLD_PAGE_IF_IN_BUFFER, pgbuf_bcb::oldest_unflush_lsa, fileio_page_reserved::pageid, vpid::pageid, pgbuf_fix_perf::perf_page_found, PERF_PAGE_MODE_NEW_LOCK_WAIT, PERF_PAGE_MODE_NEW_NO_WAIT, PERF_PAGE_MODE_OLD_LOCK_WAIT, PERF_PAGE_MODE_OLD_NO_WAIT, perfmon_inc_stat(), pgbuf_allocate_bcb(), PGBUF_BCB_ASYNC_FLUSH_REQ, pgbuf_bcb_avoid_victim(), pgbuf_bcb_check_and_reset_fix_and_avoid_dealloc(), PGBUF_BCB_CHECK_MUTEX_LEAKS, pgbuf_bcb_update_flags(), pgbuf_get_tde_algorithm(), pgbuf_init_temp_page_lsa(), pgbuf_is_temp_lsa(), pgbuf_is_temporary_volume(), PGBUF_LOCK_HOLDER, pgbuf_lock_page(), PGBUF_NO_LATCH, pgbuf_put_bcb_into_invalid_list(), pgbuf_set_dirty_buffer_ptr(), pgbuf_unlock_page(), fileio_page::prv, PSTAT_PB_NUM_IOREADS, PSTAT_SORT_NUM_DATA_PAGES, PSTAT_SORT_NUM_IO_PAGES, pthread_mutex_unlock, qmgr_get_current_query_id(), pgbuf_buffer_pool::show_status, pgbuf_fix_perf::start_tick, success(), TDE_ALGORITHM_NONE, tde_decrypt_data_page(), thread_get_sort_stats_active(), tsc_elapsed_time_usec(), tsc_getticks(), pgbuf_fix_perf::tv_diff, fileio_page_reserved::volid, vpid::volid, and pgbuf_bcb::vpid.

Referenced by pgbuf_fix_debug().

Here is the caller graph for this function:

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

Definition at line 3128 of file page_buffer.c.

References diff, vpid::pageid, vpid::volid, and pgbuf_victim_candidate_list::vpid.

Referenced by pgbuf_flush_checkpoint(), and pgbuf_flush_victim_candidates().

Here is the caller graph for this function:

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

Definition at line 1287 of file page_buffer.c.

References vpid::pageid, and vpid::volid.

Referenced by pgbuf_initialize_aout_list().

Here is the caller graph for this function:

static const char* pgbuf_consistent_str ( int  consistent)
static

Definition at line 13810 of file page_buffer.c.

References PGBUF_CONTENT_BAD, and PGBUF_CONTENT_GOOD.

Referenced by pgbuf_check_bcb_page_vpid(), and pgbuf_unfix_all().

Here is the caller graph for this function:

void pgbuf_daemons_get_stats ( UINT64 *  stats_out)

Definition at line 16048 of file page_buffer.c.

References cubthread::daemon::get_stats(), cubthread::daemon::get_stats_value_count(), and NULL.

Referenced by perfmon_stat_dump_in_buffer_thread_daemon_stats().

Here is the caller graph for this function:

STATIC_INLINE int pgbuf_find_current_wait_msecs ( THREAD_ENTRY thread_p)

Definition at line 15744 of file page_buffer.c.

References LOG_FIND_TDES(), LOG_FIND_THREAD_TRAN_INDEX, NULL, and log_tdes::wait_msecs.

Referenced by pgbuf_block_bcb(), pgbuf_fix_debug(), and pgbuf_ordered_fix_debug().

Here is the caller graph for this function:

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 
)

Definition at line 1789 of file page_buffer.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, assert_release, pgbuf_iopage_buffer::bcb, pgbuf_buffer_pool::buf_hash_table, CAST_BFPTR_TO_PGPTR, pgbuf_buffer_pool::check_for_interrupts, DISK_VALID, pgbuf_fix_perf::end_tick, ER_ERROR_SEVERITY, ER_FATAL_ERROR_SEVERITY, ER_INTERRUPTED, ER_PB_BAD_PAGEID, er_set(), ER_WARNING_SEVERITY, fileio_get_volume_label(), pgbuf_page_monitor::fix_req_cnt, pgbuf_fix_perf::fix_wait_time, pgbuf_fix_perf::holder_wait_time, pgbuf_iopage_buffer::iopage, pgbuf_bcb::iopage_buffer, pgbuf_fix_perf::is_perf_tracking, pgbuf_holder::last_watcher, LK_FORCE_ZERO_WAIT, LK_ZERO_WAIT, pgbuf_fix_perf::lock_wait_time, LOG_FIND_THREAD_TRAN_INDEX, log_is_in_crash_recovery_and_not_yet_completes_redo(), logtb_get_check_interrupt(), logtb_is_interrupted(), LSA_ISNULL(), pgbuf_watcher::magic, pgbuf_buffer_pool::monitor, NEW_PAGE, NO_ERROR, NULL, pgbuf_status::num_hit, pgbuf_status::num_page_request, OLD_PAGE, OLD_PAGE_DEALLOCATED, OLD_PAGE_IF_IN_BUFFER, OLD_PAGE_MAYBE_DEALLOCATED, OLD_PAGE_PREVENT_DEALLOC, pgbuf_bcb::oldest_unflush_lsa, PAGE_UNKNOWN, vpid::pageid, PEEK, pgbuf_fix_perf::perf_cond_type, PERF_CONDITIONAL_FIX, PERF_HOLDER_LATCH_READ, PERF_HOLDER_LATCH_WRITE, pgbuf_fix_perf::perf_latch_mode, pgbuf_fix_perf::perf_page_found, PERF_PAGE_MODE_OLD_IN_BUFFER, pgbuf_fix_perf::perf_page_type, PERF_UNCONDITIONAL_FIX_NO_WAIT, PERF_UNCONDITIONAL_FIX_WITH_WAIT, perfmon_inc_stat(), perfmon_is_perf_tracking(), pgbuf_add_fixed_at(), PGBUF_BCB_CHECK_MUTEX_LEAKS, PGBUF_BCB_INVALIDATE_DIRECT_VICTIM_FLAG, pgbuf_bcb_is_direct_victim(), pgbuf_bcb_is_dirty(), PGBUF_BCB_LOCK, pgbuf_bcb_register_avoid_deallocation(), pgbuf_bcb_register_fix(), PGBUF_BCB_TO_VACUUM_FLAG, PGBUF_BCB_UNLOCK, pgbuf_bcb_unregister_avoid_deallocation(), pgbuf_bcb_update_flags(), PGBUF_BCB_VICTIM_DIRECT_FLAG, pgbuf_check_bcb_page_vpid(), pgbuf_claim_bcb_for_fix(), PGBUF_CONDITIONAL_LATCH, PGBUF_DEBUG_PAGE_VALIDATION_FETCH, pgbuf_find_current_wait_msecs(), pgbuf_find_thrd_holder(), pgbuf_get_check_page_validation_level(), pgbuf_get_holder(), pgbuf_get_page_type_for_stat(), PGBUF_HASH_VALUE, pgbuf_insert_into_hash_chain(), pgbuf_is_lsa_temporary(), pgbuf_is_valid_page(), pgbuf_latch_bcb_upon_fix(), PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, pgbuf_put_bcb_into_invalid_list(), pgbuf_search_hash_chain(), pgbuf_set_bcb_page_vpid(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix, pgbuf_unlock_page(), PGBUF_WATCHER_MAGIC_NUMBER, pgbuf_watcher::prev, fileio_page::prv, PSTAT_PB_NUM_FETCHES, pthread_mutex_unlock, fileio_page_reserved::ptype, pgbuf_buffer_pool::show_status, pgbuf_fix_perf::start_holder_tick, pgbuf_fix_perf::start_tick, tsc_elapsed_time_usec(), tsc_getticks(), pgbuf_fix_perf::tv_diff, VACUUM_IS_THREAD_VACUUM_WORKER, and vpid::volid.

Referenced by heap_scan_pb_lock_and_fetch_debug(), pgbuf_fix_if_not_deallocated_with_caller(), pgbuf_fix_with_retry(), and pgbuf_ordered_fix_debug().

Here is the caller graph for this function:

static void pgbuf_flags_mask_sanity_check ( void  )
static

Definition at line 15634 of file page_buffer.c.

References PGBUF_ABORT_RELEASE, PGBUF_BCB_FLAGS_MASK, PGBUF_INVALID_ZONE, PGBUF_LRU_INDEX_MASK, PGBUF_LRU_ZONE_MASK, PGBUF_VOID_ZONE, and PGBUF_ZONE_MASK.

Referenced by pgbuf_initialize().

Here is the caller graph for this function:

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

Definition at line 2933 of file page_buffer.c.

References ASSERT_ERROR, FREE, NULL, pgbuf_flush_with_wal(), and pgbuf_unfix.

Referenced by disk_set_checkpoint(), disk_set_creation(), disk_set_link(), disk_stab_init(), and pgbuf_rv_flush_page().

Here is the caller graph for this function:

int pgbuf_flush_all ( THREAD_ENTRY thread_p,
VOLID  volid 
)
int pgbuf_flush_all_unfixed ( THREAD_ENTRY thread_p,
VOLID  volid 
)

Definition at line 3099 of file page_buffer.c.

References pgbuf_flush_all_helper().

Referenced by log_commit(), logpb_backup_for_volume(), and logpb_copy_volume().

Here is the caller graph for this function:

int pgbuf_flush_all_unfixed_and_set_lsa_as_null ( THREAD_ENTRY thread_p,
VOLID  volid 
)

Definition at line 3116 of file page_buffer.c.

References pgbuf_flush_all_helper().

Referenced by log_recreate(), logpb_copy_database(), and logpb_copy_volume().

Here is the caller graph for this function:

int pgbuf_flush_control_from_dirty_ratio ( void  )

Definition at line 13647 of file page_buffer.c.

References diff, pgbuf_page_monitor::dirties_cnt, if(), pgbuf_buffer_pool::monitor, and pgbuf_buffer_pool::num_buffers.

Referenced by fileio_flush_control_get_desired_rate().

Here is the caller graph for this function:

STATIC_INLINE int pgbuf_flush_neighbor_safe ( THREAD_ENTRY thread_p,
PGBUF_BCB bufptr,
VPID expected_vpid,
bool flushed 
)
int pgbuf_flush_victim_candidates ( THREAD_ENTRY thread_p,
float  flush_ratio,
PERF_UTIME_TRACKER *  perf_tracker,
bool stop 
)

Definition at line 3237 of file page_buffer.c.

References _er_log_debug(), ARG_FILE_LINE, assert, pgbuf_victim_candidate_list::bufptr, db_page_size(), ER_LOG_FLUSH_VICTIM_FINISHED, ER_LOG_FLUSH_VICTIM_STARTED, ER_NOTIFICATION_SEVERITY, er_set(), error(), pgbuf_page_monitor::fix_req_cnt, i, pgbuf_iopage_buffer::iopage, pgbuf_bcb::iopage_buffer, pgbuf_bcb::latch_mode, log_is_log_flush_daemon_available(), log_wakeup_log_flush_daemon(), logpb_flush_log_for_wal(), logpb_force_flush_pages(), logpb_need_wal(), pgbuf_page_monitor::lru_victim_req_cnt, fileio_page_reserved::lsa, LSA_COPY(), LSA_INITIALIZER, LSA_ISNULL(), LSA_LE(), LSA_LT(), pgbuf_buffer_pool::monitor, NO_ERROR, NULL, pgbuf_buffer_pool::num_buffers, PERFMON_ACTIVATION_FLAG_PB_VICTIMIZATION, perfmon_add_stat(), perfmon_is_perf_tracking_and_active(), perfmon_time_stat(), PGBUF_BCB_CHECK_MUTEX_LEAKS, pgbuf_bcb_flush_with_wal(), pgbuf_bcb_is_dirty(), pgbuf_bcb_is_flushing(), PGBUF_BCB_LOCK, PGBUF_BCB_UNLOCK, pgbuf_compare_victim_list(), pgbuf_compute_lru_vict_target(), pgbuf_flush_page_and_neighbors_fb(), PGBUF_FLUSH_VICTIM_BOOST_MULT, pgbuf_get_victim_candidates_from_lru(), PGBUF_IS_BCB_IN_LRU_VICTIM_ZONE, pgbuf_is_page_flush_daemon_available(), PGBUF_NEIGHBOR_PAGES, PGBUF_NO_LATCH, prm_get_bool_value(), PRM_ID_LOG_PGBUF_VICTIM_FLUSH, PRM_ID_PB_SEQUENTIAL_VICTIM_FLUSH, fileio_page::prv, PSTAT_PB_FLUSH_COLLECT, PSTAT_PB_FLUSH_COLLECT_PER_PAGE, PSTAT_PB_FLUSH_FLUSH, PSTAT_PB_FLUSH_FLUSH_PER_PAGE, PSTAT_PB_NUM_FLUSHED, PSTAT_PB_NUM_SKIPPED_ALREADY_FLUSHED, PSTAT_PB_NUM_SKIPPED_FIXED_OR_HOT, PSTAT_PB_NUM_SKIPPED_FLUSH, PSTAT_PB_NUM_SKIPPED_NEED_WAL, tsc_elapsed_utime(), tsc_getticks(), pgbuf_buffer_pool::victim_cand_list, pgbuf_bcb::vpid, pgbuf_victim_candidate_list::vpid, and VPID_EQ.

Referenced by pgbuf_get_page_flush_interval(), and pgbuf_wakeup_page_flush_daemon().

Here is the caller graph for this function:

void pgbuf_force_to_check_for_interrupts ( void  )

Definition at line 4750 of file page_buffer.c.

References pgbuf_buffer_pool::check_for_interrupts.

Referenced by logtb_set_tran_index_interrupt().

Here is the caller graph for this function:

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)

Definition at line 13837 of file page_buffer.c.

References assert, CAST_PGPTR_TO_BFPTR, pgbuf_bcb::fcnt, and NULL.

Referenced by vacuum_verify_vacuum_data_page_fix_count().

Here is the caller graph for this function:

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

Definition at line 13855 of file page_buffer.c.

References pgbuf_holder_anchor::num_hold_cnt, pgbuf_buffer_pool::thrd_holder_info, and thread_get_entry_index().

Referenced by vacuum_verify_vacuum_data_page_fix_count().

Here is the caller graph for this function:

LOG_LSA* pgbuf_get_lsa ( PAGE_PTR  pgptr)

Definition at line 4318 of file page_buffer.c.

References CAST_PGPTR_TO_IOPGPTR, fileio_page_reserved::lsa, NULL, PGBUF_DEBUG_PAGE_VALIDATION_ALL, pgbuf_get_check_page_validation_level(), pgbuf_is_valid_page_ptr(), and fileio_page::prv.

Referenced by btree_delete_key_from_leaf(), btree_get_next_key_info(), btree_insert_mvcc_delid_into_page(), btree_key_append_object_as_new_overflow(), btree_key_append_object_non_unique(), btree_key_append_object_to_overflow(), btree_key_append_object_unique(), btree_key_find_and_lock_unique_of_non_unique(), btree_key_insert_new_key(), btree_key_lock_and_append_object_unique(), btree_key_online_index_IB_insert(), btree_key_online_index_tran_delete(), btree_key_online_index_tran_insert(), btree_key_online_index_tran_insert_DF(), btree_key_relocate_last_into_ovf(), btree_key_remove_delete_mvccid_non_unique(), btree_key_remove_delete_mvccid_unique(), btree_key_remove_insert_mvccid(), btree_key_remove_object_and_keep_visible_first(), btree_leaf_record_replace_first_with_last(), btree_merge_node_and_advance(), btree_modify_leaf_ovfl_vpid(), btree_modify_overflow_link(), btree_range_scan(), btree_range_scan_resume(), btree_record_remove_object(), btree_reflect_global_unique_statistics(), btree_replace_first_oid_with_ovfl_oid(), btree_split_node_and_advance(), disk_volume_expand(), file_alloc_sticky_first_page(), file_dealloc(), file_extdata_find_and_remove_item(), file_extdata_merge_pages(), file_header_update_mark_deleted(), file_log_extdata_set_next(), file_numerable_add_page(), file_perm_alloc(), file_perm_dealloc(), file_perm_expand(), file_rv_user_page_unmark_delete_logical(), file_table_add_full_sector(), file_table_move_partial_sectors_to_header(), file_tracker_item_mark_heap_deleted(), file_tracker_item_reuse_heap(), file_tracker_register_internal(), log_recovery_redo(), log_skip_logging(), pgbuf_page_has_changed(), and scan_next_heap_scan().

STATIC_INLINE int pgbuf_get_shared_lru_index_for_add ( void  )

Definition at line 1022 of file page_buffer.c.

Referenced by pgbuf_lru_move_from_private_to_shared(), pgbuf_move_bcb_to_bottom_lru(), pgbuf_put_bcb_into_invalid_list(), and pgbuf_unlatch_void_zone_bcb().

Here is the caller graph for this function:

static PGBUF_BCB* pgbuf_get_victim_from_lru_list ( THREAD_ENTRY thread_p,
const int  lru_idx 
)
static
bool pgbuf_has_any_non_vacuum_waiters ( PAGE_PTR  pgptr)

Definition at line 13495 of file page_buffer.c.

References assert, CAST_PGPTR_TO_BFPTR, NULL, and TT_VACUUM_WORKER.

Referenced by vacuum_heap_page().

Here is the caller graph for this function:

bool pgbuf_has_any_waiters ( PAGE_PTR  pgptr)
bool pgbuf_has_prevent_dealloc ( PAGE_PTR  pgptr)

Definition at line 13527 of file page_buffer.c.

References assert, CAST_PGPTR_TO_BFPTR, NULL, and pgbuf_bcb_should_avoid_deallocation().

Referenced by heap_remove_page_on_vacuum(), and vacuum_heap_page().

Here is the caller graph for this function:

static INLINE unsigned int pgbuf_hash_func_mirror ( const VPID vpid)
static
unsigned int pgbuf_hash_vpid ( const void *  key_vpid,
unsigned int  htsize 
)

Definition at line 1273 of file page_buffer.c.

References vpid::pageid, and vpid::volid.

Referenced by pgbuf_initialize_aout_list().

Here is the caller graph for this function:

static void pgbuf_init_temp_page_lsa ( FILEIO_PAGE io_page,
PGLENGTH  page_size 
)
static
int pgbuf_initialize ( void  )

Definition at line 1311 of file page_buffer.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, pgbuf_buffer_pool::big_private_lrus_with_victims, pgbuf_buffer_pool::check_for_interrupts, pgbuf_page_monitor::dirties_cnt, ER_ERROR_SEVERITY, ER_FAILED, er_log_debug, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), MAX_NTRANS, pgbuf_buffer_pool::monitor, NO_ERROR, NULL, pgbuf_buffer_pool::num_buffers, pgbuf_finalize(), pgbuf_flags_mask_sanity_check(), pgbuf_initialize_aout_list(), pgbuf_initialize_bcb_table(), pgbuf_initialize_hash_table(), pgbuf_initialize_invalid_list(), pgbuf_initialize_lock_table(), pgbuf_initialize_lru_list(), pgbuf_initialize_page_monitor(), pgbuf_initialize_page_quota(), pgbuf_initialize_page_quota_parameters(), pgbuf_initialize_seq_flusher(), pgbuf_initialize_thrd_holder(), PGBUF_LRU_ZONE_MAX_RATIO, PGBUF_LRU_ZONE_MIN_RATIO, PGBUF_MINIMUM_BUFFERS, PGBUF_PAGE_QUOTA_IS_ENABLED, PGBUF_PRIVATE_LRU_COUNT, PGBUF_SHARED_LRU_COUNT, pgbuf_status_old::print_out_time, pgbuf_buffer_pool::private_lrus_with_victims, prm_get_bool_value(), prm_get_float_value(), prm_get_integer_value(), PRM_ID_PB_LRU_BUFFER_RATIO, PRM_ID_PB_LRU_HOT_RATIO, PRM_ID_PB_MONITOR_LOCKS, PRM_ID_PB_NBUFFERS, pthread_mutex_init, pgbuf_buffer_pool::ratio_lru1, pgbuf_buffer_pool::ratio_lru2, pgbuf_buffer_pool::seq_chkpt_flusher, pgbuf_buffer_pool::shared_lrus_with_victims, pgbuf_buffer_pool::show_status, pgbuf_buffer_pool::show_status_old, thread_num_total_threads(), and pgbuf_buffer_pool::victim_cand_list.

Referenced by logtb_define_trantable_log_latch().

Here is the caller graph for this function:

static int pgbuf_initialize_hash_table ( void  )
static
static int pgbuf_initialize_invalid_list ( void  )
static
static int pgbuf_initialize_lock_table ( void  )
static
STATIC_INLINE bool pgbuf_is_bcb_fixed_by_any ( PGBUF_BCB bcb,
bool  has_mutex_lock 
)
STATIC_INLINE bool pgbuf_is_exist_blocked_reader_writer ( PGBUF_BCB bufptr)

Definition at line 10182 of file page_buffer.c.

References NULL, PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, and STATIC_INLINE.

Referenced by pgbuf_has_any_waiters(), pgbuf_latch_bcb_upon_fix(), and pgbuf_unlatch_bcb_upon_unfix().

Here is the caller graph for this function:

bool pgbuf_is_io_stressful ( void  )

Definition at line 15409 of file page_buffer.c.

References STATIC_INLINE.

Referenced by btree_merge_node_and_advance().

Here is the caller graph for this function:

bool pgbuf_is_log_check_for_interrupts ( THREAD_ENTRY thread_p)
static bool pgbuf_is_page_flush_daemon_available ( )
static

Definition at line 16084 of file page_buffer.c.

References NULL.

Referenced by pgbuf_allocate_bcb(), pgbuf_flush_victim_candidates(), pgbuf_get_victim(), pgbuf_get_victim_from_lru_list(), and pgbuf_wakeup_page_flush_daemon().

Here is the caller graph for this function:

static bool pgbuf_is_temp_lsa ( const log_lsa lsa)
static

Definition at line 16094 of file page_buffer.c.

References PGBUF_TEMP_LSA.

Referenced by pgbuf_claim_bcb_for_fix(), pgbuf_is_lsa_temporary(), pgbuf_set_lsa(), and pgbuf_unfix_debug().

Here is the caller graph for this function:

STATIC_INLINE bool pgbuf_is_temporary_volume ( VOLID  volid)
static
static const char* pgbuf_latch_mode_str ( PGBUF_LATCH_MODE  latch_mode)
static

Definition at line 13744 of file page_buffer.c.

References PGBUF_LATCH_FLUSH, PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, and PGBUF_NO_LATCH.

Referenced by pgbuf_check_bcb_page_vpid(), and pgbuf_unfix_all().

Here is the caller graph for this function:

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 
)

Definition at line 13909 of file page_buffer.c.

References assert, DONT_FREE, log_append_redo_data2(), NULL, PAGE_UNKNOWN, pgbuf_set_dirty(), and RVPGBUF_NEW_PAGE.

Referenced by locator_multi_insert_force().

Here is the caller graph for this function:

STATIC_INLINE void pgbuf_lru_add_new_bcb_to_top ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb,
int  lru_idx 
)
STATIC_INLINE void pgbuf_lru_adjust_zone2 ( THREAD_ENTRY thread_p,
PGBUF_LRU_LIST lru_list,
bool  min_one 
)
STATIC_INLINE 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 
)
static void pgbuf_lru_move_from_private_to_shared ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb 
)
static
STATIC_INLINE void pgbuf_lru_remove_victim_candidate ( THREAD_ENTRY thread_p,
PGBUF_LRU_LIST lru_list,
PGBUF_BCB bcb 
)

Definition at line 14521 of file page_buffer.c.

References pgbuf_lru_list::count_vict_cand, and STATIC_INLINE.

Referenced by pgbuf_bcb_change_zone(), pgbuf_bcb_set_dirty(), and pgbuf_bcb_update_flags().

Here is the caller graph for this function:

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 
)

Definition at line 11430 of file page_buffer.c.

References _er_log_debug(), ARG_FILE_LINE, assert, assert_release, pgbuf_buffer_pool::buf_hash_table, pgbuf_holder::bufptr, CAST_BFPTR_TO_PGPTR, CAST_PGPTR_TO_BFPTR, pgbuf_watcher::curr_rank, diff, DISK_VALID, er_errid(), er_errid_if_has_error(), ER_ERROR_SEVERITY, ER_FAILED, ER_FAILED_ASSERTION, ER_FATAL_ERROR_SEVERITY, ER_INTERRUPTED, ER_LK_PAGE_TIMEOUT, er_log_debug, ER_PB_BAD_PAGEID, ER_PB_ORDERED_INCONSISTENCY, ER_PB_ORDERED_REFIX_FAILED, er_set(), pgbuf_holder::first_watcher, pgbuf_holder::fix_count, pgbuf_holder::fixed_at, pgbuf_watcher::group_id, pgbuf_holder_info::group_id, i, pgbuf_watcher::initial_rank, pgbuf_iopage_buffer::iopage, pgbuf_bcb::iopage_buffer, pgbuf_holder::last_watcher, pgbuf_watcher::latch_mode, pgbuf_holder_info::latch_mode, LK_FORCE_ZERO_WAIT, LK_ZERO_WAIT, pgbuf_watcher::magic, pgbuf_watcher::next, NO_ERROR, NULL, OLD_PAGE, OLD_PAGE_PREVENT_DEALLOC, PAGE_HEAP, pgbuf_watcher::page_was_unfixed, vpid::pageid, pgbuf_add_watch_instance_internal(), pgbuf_bcb_register_avoid_deallocation(), pgbuf_bcb_should_avoid_deallocation(), PGBUF_BCB_UNLOCK, pgbuf_bcb_unregister_avoid_deallocation(), pgbuf_check_page_ptype(), PGBUF_CLEAR_WATCHER, pgbuf_compare_hold_vpid_for_sort(), PGBUF_CONDITIONAL_LATCH, pgbuf_find_current_wait_msecs(), pgbuf_fix_debug(), pgbuf_get_groupid_and_unfix(), pgbuf_get_page_ptype(), PGBUF_HASH_VALUE, PGBUF_IS_ORDERED_PAGETYPE, pgbuf_is_valid_page(), PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, PGBUF_MAX_PAGE_FIXED_BY_TRAN, PGBUF_MAX_PAGE_WATCHERS, PGBUF_ORDERED_HEAP_HDR, PGBUF_ORDERED_RANK_UNDEFINED, pgbuf_ordered_unfix_and_init, pgbuf_search_hash_chain(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix, pgbuf_unfix_and_init, pgbuf_watcher_init_debug(), PGBUF_WATCHER_MAGIC_NUMBER, pgbuf_watcher::pgptr, pgbuf_holder_info::prevent_dealloc, fileio_page::prv, pthread_mutex_unlock, fileio_page_reserved::ptype, pgbuf_holder_info::ptype, pgbuf_holder_info::rank, pgbuf_holder_anchor::thrd_hold_list, pgbuf_buffer_pool::thrd_holder_info, pgbuf_holder::thrd_link, thread_get_entry_index(), vpid::volid, pgbuf_holder_info::vpid, pgbuf_bcb::vpid, VPID_AS_ARGS, VPID_COPY, VPID_EQ, VPID_ISNULL, VPID_SET_NULL, pgbuf_holder_info::watch_count, pgbuf_holder::watch_count, and pgbuf_holder_info::watcher.

Referenced by heap_scan_pb_lock_and_fetch_debug().

Here is the caller graph for this function:

void pgbuf_ordered_set_dirty_and_free ( THREAD_ENTRY thread_p,
PGBUF_WATCHER pg_watcher 
)

Definition at line 12603 of file page_buffer.c.

References DONT_FREE, pgbuf_ordered_unfix, pgbuf_set_dirty(), and pgbuf_watcher::pgptr.

Referenced by heap_get_num_objects(), heap_stats_find_best_page(), heap_vpid_remove(), and xheap_reclaim_addresses().

Here is the caller graph for this function:

int pgbuf_page_has_changed ( PAGE_PTR  pgptr,
LOG_LSA ref_lsa 
)

Definition at line 4342 of file page_buffer.c.

References LSA_COPY(), LSA_EQ(), and pgbuf_get_lsa().

Referenced by scan_next_heap_scan().

Here is the caller graph for this function:

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 
)
void pgbuf_reset_temp_lsa ( PAGE_PTR  pgptr)

Definition at line 4457 of file page_buffer.c.

References CAST_PGPTR_TO_BFPTR, IO_PAGESIZE, pgbuf_iopage_buffer::iopage, pgbuf_bcb::iopage_buffer, and pgbuf_init_temp_page_lsa().

Referenced by logpb_check_and_reset_temp_lsa().

Here is the caller graph for this function:

int pgbuf_rv_dealloc_redo ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
void pgbuf_rv_flush_page_dump ( FILE *  fp,
int  length,
void *  data 
)

Definition at line 13727 of file page_buffer.c.

References assert, vpid::pageid, vpid::volid, VPID_COPY, and VPID_INITIALIZER.

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 ( THREAD_ENTRY thread_p,
PAGE_PTR  pgptr,
bool  free_page 
)

Definition at line 4280 of file page_buffer.c.

References assert, CAST_PGPTR_TO_BFPTR, disk_volheader_check_magic(), FREE, vpid::pageid, PGBUF_DEBUG_PAGE_VALIDATION_ALL, pgbuf_get_check_page_validation_level(), pgbuf_is_valid_page_ptr(), pgbuf_set_dirty_buffer_ptr(), pgbuf_unfix, pgbuf_bcb::vpid, and VPID_ISNULL.

Referenced by btree_construct_leafs(), btree_fix_ovfl_oid_page(), btree_fix_root_for_insert(), btree_initialize_new_page(), btree_insert_mvcc_delid_into_page(), btree_key_append_object_as_new_overflow(), btree_key_append_object_non_unique(), btree_key_append_object_to_overflow(), btree_key_append_object_unique(), btree_key_insert_new_key(), btree_key_online_index_IB_insert(), btree_key_online_index_tran_delete(), btree_key_online_index_tran_insert(), btree_key_online_index_tran_insert_DF(), btree_key_relocate_last_into_ovf(), btree_key_remove_delete_mvccid_non_unique(), btree_key_remove_delete_mvccid_unique(), btree_key_remove_insert_mvccid(), btree_leaf_record_replace_first_with_last(), btree_log_page(), btree_merge_node(), btree_merge_root(), btree_modify_leaf_ovfl_vpid(), btree_modify_overflow_link(), btree_overflow_record_replace_object(), btree_record_remove_object(), btree_reflect_global_unique_statistics(), btree_replace_first_oid_with_ovfl_oid(), btree_rv_nodehdr_redo_insert(), btree_rv_nodehdr_undo_insert(), btree_rv_nodehdr_undoredo_update(), btree_rv_noderec_redo_insert(), btree_rv_noderec_undo_insert(), btree_rv_noderec_undoredo_update(), btree_rv_nop(), btree_rv_ovfid_undoredo_update(), btree_rv_pagerec_delete(), btree_rv_pagerec_insert(), btree_rv_record_modify_internal(), btree_rv_roothdr_undo_update(), btree_rv_undo_mark_dealloc_page(), btree_rv_undoredo_copy_page(), btree_set_vpid_previous_vpid(), btree_split_node(), btree_split_node_and_advance(), btree_split_root(), btree_start_overflow_page(), catalog_add_class_info(), catalog_drop_all_representation_and_class(), catalog_drop_disk_representation_from_page(), catalog_drop_old_representations(), catalog_drop_representation_class_from_page(), catalog_drop_representation_item(), catalog_initialize_new_page(), catalog_insert_representation_item(), catalog_put_record_into_page(), catalog_put_representation_item(), catalog_rv_delete_redo(), catalog_rv_insert_redo(), catalog_rv_insert_undo(), catalog_rv_new_page_redo(), catalog_rv_update(), catalog_update_class_info(), disk_rv_redo_init_map(), disk_rv_reserve_sectors(), disk_rv_undoredo_link(), disk_rv_undoredo_set_boot_hfid(), disk_rv_undoredo_set_creation_time(), disk_rv_unreserve_sectors(), disk_rv_volhead_extend_redo(), disk_rv_volhead_extend_undo(), disk_set_boot_hfid(), disk_set_checkpoint(), disk_set_creation(), disk_set_link(), disk_stab_init(), disk_stab_unit_reserve(), disk_stab_unit_unreserve(), ehash_adjust_local_depth(), ehash_connect_bucket(), ehash_create_helper(), ehash_delete(), ehash_expand_directory(), ehash_initialize_bucket_new_page(), ehash_initialize_dir_new_page(), ehash_insert_to_bucket(), ehash_merge_permanent(), ehash_rv_connect_bucket_redo(), ehash_rv_delete(), ehash_rv_delete_redo(), ehash_rv_increment(), ehash_rv_init_dir_new_page_redo(), ehash_rv_insert_redo(), ehash_shrink_directory(), ehash_split_bucket(), file_alloc_sticky_first_page(), file_create(), file_dealloc(), file_descriptor_update(), file_extdata_merge_pages(), file_extdata_update_item(), file_header_update_mark_deleted(), file_init_page_type_internal(), file_log_extdata_add(), file_log_extdata_remove(), file_log_extdata_set_next(), file_log_fhead_alloc(), file_log_fhead_dealloc(), file_numerable_add_page(), file_perm_dealloc(), file_perm_expand(), file_rv_extdata_add(), file_rv_extdata_merge(), file_rv_extdata_remove(), file_rv_extdata_set_next(), file_rv_fhead_alloc(), file_rv_fhead_convert_ftab_to_user_page(), file_rv_fhead_convert_user_to_ftab_page(), file_rv_fhead_dealloc(), file_rv_fhead_set_last_user_page_ftab(), file_rv_fhead_sticky_page(), file_rv_header_update_mark_deleted(), file_rv_partsect_update(), file_rv_perm_expand_redo(), file_rv_perm_expand_undo(), file_rv_set_tde_algorithm(), file_rv_tracker_mark_heap_deleted_compensate_or_run_postpone(), file_rv_tracker_reuse_heap(), file_rv_user_page_mark_delete(), file_rv_user_page_unmark_delete_logical(), file_rv_user_page_unmark_delete_physical(), file_temp_alloc(), file_temp_reset_user_pages(), file_temp_set_type(), file_tracker_init_page(), file_tracker_item_mark_heap_deleted(), file_tracker_item_reuse_heap(), file_tracker_register_internal(), heap_add_chain_links(), heap_compact_pages(), heap_create_internal(), heap_delete_bigone(), heap_delete_physical(), heap_delete_relocation(), heap_insert_logical(), heap_insert_newhome(), heap_ovf_find_vfid(), heap_remove_page_on_vacuum(), heap_reuse(), heap_rv_mvcc_redo_delete_home(), heap_rv_mvcc_redo_delete_newhome(), heap_rv_mvcc_redo_delete_overflow(), heap_rv_mvcc_redo_insert(), heap_rv_mvcc_redo_redistribute(), heap_rv_mvcc_undo_delete(), heap_rv_mvcc_undo_delete_overflow(), heap_rv_nop(), heap_rv_redo_delete(), heap_rv_redo_insert(), heap_rv_redo_mark_reusable_slot(), heap_rv_redo_newpage(), heap_rv_redo_reuse_page(), heap_rv_redo_reuse_page_reuse_oid(), heap_rv_undo_insert(), heap_rv_undo_ovf_update(), heap_rv_undoredo_pagehdr(), heap_rv_update_chain_after_mvcc_op(), heap_stats_update_internal(), heap_update_and_log_header(), heap_update_bigone(), heap_update_physical(), heap_update_relocation(), heap_update_set_prev_version(), heap_vpid_alloc(), heap_vpid_init_new(), log_rv_copy_char(), log_rv_record_modify_internal(), logpb_check_and_reset_temp_lsa(), overflow_rv_link(), overflow_rv_newpage_link_undo(), pgbuf_copy_from_area(), pgbuf_log_new_page(), pgbuf_log_redo_new_page(), pgbuf_ordered_set_dirty_and_free(), pgbuf_rv_dealloc_redo(), pgbuf_rv_flush_page(), pgbuf_rv_new_page_redo(), pgbuf_rv_new_page_undo(), pgbuf_set_tde_algorithm(), qfile_set_dirty_page_and_skip_logging(), qmgr_init_external_file_page(), qmgr_set_dirty_page(), spage_delete(), spage_delete_for_recovery(), spage_initialize(), spage_insert_data(), spage_insert_for_recovery(), spage_merge(), spage_overwrite(), spage_put_helper(), spage_reclaim(), spage_split(), spage_take_out(), spage_update(), spage_update_record_type(), vacuum_heap_page(), vacuum_heap_page_log_and_reset(), vacuum_heap_record(), vacuum_heap_record_insid_and_prev_version(), vacuum_rv_check_at_undo(), vacuum_rv_redo_add_dropped_file(), vacuum_rv_redo_append_data(), vacuum_rv_redo_cleanup_dropped_files(), vacuum_rv_redo_data_finished(), vacuum_rv_redo_initialize_data_page(), vacuum_rv_redo_remove_ovf_insid(), vacuum_rv_redo_start_job(), vacuum_rv_redo_vacuum_complete(), vacuum_rv_redo_vacuum_heap_page(), vacuum_rv_redo_vacuum_heap_record(), vacuum_rv_replace_dropped_file(), vacuum_rv_set_next_page_dropped_files(), vacuum_rv_undo_add_dropped_file(), vacuum_rv_undoredo_data_set_link(), vacuum_set_dirty_data_page_dont_free(), xbtree_add_index(), and xheap_reclaim_addresses().

void pgbuf_set_lsa_as_temporary ( THREAD_ENTRY thread_p,
PAGE_PTR  pgptr 
)
void pgbuf_set_page_ptype ( THREAD_ENTRY thread_p,
PAGE_PTR  pgptr,
PAGE_TYPE  ptype 
)
STATIC_INLINE bool pgbuf_should_move_private_to_shared ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb,
int  thread_private_lru_index 
)

Definition at line 6365 of file page_buffer.c.

References pgbuf_bcb_get_lru_index(), pgbuf_bcb_is_hot(), PGBUF_GET_LRU_LIST, PGBUF_IS_BCB_OLD_ENOUGH, and PGBUF_IS_SHARED_LRU_INDEX.

Referenced by pgbuf_unlatch_bcb_upon_unfix().

Here is the caller graph for this function:

void pgbuf_unfix_debug ( THREAD_ENTRY thread_p,
PAGE_PTR  pgptr,
const char *  caller_file,
int  caller_line 
)
STATIC_INLINE int pgbuf_unlatch_bcb_upon_unfix ( THREAD_ENTRY thread_p,
PGBUF_BCB bufptr,
int  holder_status 
)

Definition at line 6045 of file page_buffer.c.

References ARG_FILE_LINE, assert, CAST_BFPTR_TO_PGPTR, er_clear(), ER_ERROR_SEVERITY, ER_FAILED, ER_PB_UNFIXED_PAGEPTR, er_set(), pgbuf_bcb::fcnt, fileio_get_volume_label(), pgbuf_bcb::latch_mode, LSA_ISNULL(), pgbuf_buffer_pool::monitor, NO_ERROR, pgbuf_bcb::oldest_unflush_lsa, vpid::pageid, PEEK, PERFMON_ACTIVATION_FLAG_PB_VICTIMIZATION, perfmon_inc_stat(), perfmon_is_perf_tracking_and_active(), pgbuf_page_monitor::pg_unfix_cnt, pgbuf_assign_direct_victim(), pgbuf_bcb_avoid_victim(), pgbuf_bcb_get_lru_index(), pgbuf_bcb_get_zone(), pgbuf_bcb_is_async_flush_request(), pgbuf_bcb_is_dirty(), pgbuf_bcb_register_hit_for_lru(), pgbuf_bcb_safe_flush_force_unlock(), pgbuf_bcb_should_be_moved_to_bottom_lru(), PGBUF_BCB_UNLOCK, pgbuf_check_bcb_page_vpid(), PGBUF_IS_BCB_OLD_ENOUGH, pgbuf_is_exist_blocked_reader_writer(), PGBUF_IS_PRIVATE_LRU_INDEX, PGBUF_LATCH_FLUSH, PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, PGBUF_LRU_1_ZONE, PGBUF_LRU_2_ZONE, PGBUF_LRU_3_ZONE, pgbuf_lru_boost_bcb(), PGBUF_LRU_INDEX_FROM_PRIVATE, pgbuf_lru_list_from_bcb(), pgbuf_lru_move_from_private_to_shared(), pgbuf_move_bcb_to_bottom_lru(), PGBUF_NO_LATCH, PGBUF_PRIVATE_LRU_FROM_THREAD, pgbuf_should_move_private_to_shared(), PGBUF_THREAD_HAS_PRIVATE_LRU, PGBUF_THREAD_SHOULD_IGNORE_UNFIX, pgbuf_unlatch_void_zone_bcb(), PGBUF_VOID_ZONE, PSTAT_PB_UNFIX_LRU_ONE_KEEP_VAC, PSTAT_PB_UNFIX_LRU_ONE_PRV_KEEP, PSTAT_PB_UNFIX_LRU_ONE_PRV_TO_SHR_MID, PSTAT_PB_UNFIX_LRU_ONE_SHR_KEEP, PSTAT_PB_UNFIX_LRU_THREE_KEEP_VAC, PSTAT_PB_UNFIX_LRU_THREE_PRV_TO_SHR_MID, PSTAT_PB_UNFIX_LRU_TWO_KEEP_VAC, PSTAT_PB_UNFIX_LRU_TWO_PRV_KEEP, PSTAT_PB_UNFIX_LRU_TWO_PRV_TO_SHR_MID, PSTAT_PB_UNFIX_LRU_TWO_SHR_KEEP, PSTAT_PB_VICTIM_ASSIGN_DIRECT_VACUUM_LRU, vpid::volid, pgbuf_bcb::vpid, and VPID_ISNULL.

Referenced by pgbuf_dealloc_page(), pgbuf_invalidate_debug(), and pgbuf_unfix_debug().

Here is the caller graph for this function:

static int pgbuf_victimize_bcb ( THREAD_ENTRY thread_p,
PGBUF_BCB bufptr 
)
static
static void pgbuf_wake_flush_waiters ( THREAD_ENTRY thread_p,
PGBUF_BCB bcb 
)
static

Definition at line 10135 of file page_buffer.c.

References NULL, PGBUF_BCB_CHECK_OWN, PGBUF_LATCH_FLUSH, PSTAT_PB_WAKE_FLUSH_WAITER, and STATIC_INLINE.

Referenced by pgbuf_assign_direct_victim(), and pgbuf_bcb_flush_with_wal().

Here is the caller graph for this function:

static void pgbuf_wakeup_page_flush_daemon ( THREAD_ENTRY thread_p)
static
void pgbuf_watcher_init_debug ( PGBUF_WATCHER watcher,
const char *  caller_file,
const int  caller_line,
bool  add 
)

Definition at line 12674 of file page_buffer.c.

References pgbuf_watcher::init_at, p, snprintf_dots_truncate, and strlen.

Referenced by pgbuf_ordered_fix_debug(), pgbuf_ordered_unfix_debug(), and pgbuf_replace_watcher_debug().

Here is the caller graph for this function:

static const char* pgbuf_zone_str ( PGBUF_ZONE  zone)
static

Definition at line 13777 of file page_buffer.c.

References PGBUF_INVALID_ZONE, PGBUF_LRU_1_ZONE, PGBUF_LRU_2_ZONE, and PGBUF_LRU_3_ZONE.

Referenced by pgbuf_unfix_all().

Here is the caller graph for this function:

Variable Documentation

PGBUF_BATCH_FLUSH_HELPER pgbuf_Flush_helper
static

Definition at line 803 of file page_buffer.c.

Referenced by pgbuf_add_bufptr_to_batch(), and pgbuf_flush_page_and_neighbors_fb().

HFID* pgbuf_ordered_null_hfid = NULL

Definition at line 805 of file page_buffer.c.

PGBUF_BUFFER_POOL pgbuf_Pool
static

Definition at line 802 of file page_buffer.c.

const VPID vpid_Null_vpid = { NULL_PAGEID, NULL_VOLID }

Definition at line 74 of file page_buffer.c.

Referenced by vacuum_job_cursor::get_page_vpid().