PostgreSQL Source Code git master
|
Go to the source code of this file.
Data Structures | |
union | PgAioOpData |
struct | PgAioTargetInfo |
struct | PgAioHandleCallbacks |
Macros | |
#define | DEFAULT_IO_METHOD IOMETHOD_WORKER |
#define | PGAIO_OP_COUNT (PGAIO_OP_WRITEV + 1) |
#define | PGAIO_TID_COUNT (PGAIO_TID_INVALID + 1) |
#define | PGAIO_HANDLE_MAX_CALLBACKS 4 |
Typedefs | |
typedef enum IoMethod | IoMethod |
typedef enum PgAioHandleFlags | PgAioHandleFlags |
typedef enum PgAioOp | PgAioOp |
typedef enum PgAioTargetID | PgAioTargetID |
typedef enum PgAioHandleCallbackID | PgAioHandleCallbackID |
typedef void(* | PgAioHandleCallbackStage) (PgAioHandle *ioh, uint8 cb_flags) |
typedef PgAioResult(* | PgAioHandleCallbackComplete) (PgAioHandle *ioh, PgAioResult prior_result, uint8 cb_flags) |
typedef void(* | PgAioHandleCallbackReport) (PgAioResult result, const PgAioTargetData *target_data, int elevel) |
Enumerations | |
enum | IoMethod { IOMETHOD_SYNC = 0 , IOMETHOD_WORKER } |
enum | PgAioHandleFlags { PGAIO_HF_REFERENCES_LOCAL = 1 << 1 , PGAIO_HF_SYNCHRONOUS = 1 << 0 , PGAIO_HF_BUFFERED = 1 << 2 } |
enum | PgAioOp { PGAIO_OP_INVALID = 0 , PGAIO_OP_READV , PGAIO_OP_WRITEV } |
enum | PgAioTargetID { PGAIO_TID_INVALID = 0 } |
enum | PgAioHandleCallbackID { PGAIO_HCB_INVALID } |
Variables | |
PGDLLIMPORT int | io_method |
PGDLLIMPORT int | io_max_concurrency |
#define DEFAULT_IO_METHOD IOMETHOD_WORKER |
#define PGAIO_OP_COUNT (PGAIO_OP_WRITEV + 1) |
#define PGAIO_TID_COUNT (PGAIO_TID_INVALID + 1) |
typedef PgAioResult(* PgAioHandleCallbackComplete) (PgAioHandle *ioh, PgAioResult prior_result, uint8 cb_flags) |
typedef enum PgAioHandleCallbackID PgAioHandleCallbackID |
typedef void(* PgAioHandleCallbackReport) (PgAioResult result, const PgAioTargetData *target_data, int elevel) |
typedef void(* PgAioHandleCallbackStage) (PgAioHandle *ioh, uint8 cb_flags) |
typedef enum PgAioHandleFlags PgAioHandleFlags |
typedef enum PgAioTargetID PgAioTargetID |
enum IoMethod |
Enumerator | |
---|---|
IOMETHOD_SYNC | |
IOMETHOD_WORKER |
Enumerator | |
---|---|
PGAIO_HCB_INVALID |
enum PgAioHandleFlags |
Enumerator | |
---|---|
PGAIO_HF_REFERENCES_LOCAL | |
PGAIO_HF_SYNCHRONOUS | |
PGAIO_HF_BUFFERED |
Definition at line 40 of file aio.h.
enum PgAioOp |
Enumerator | |
---|---|
PGAIO_OP_INVALID | |
PGAIO_OP_READV | |
PGAIO_OP_WRITEV |
Definition at line 79 of file aio.h.
enum PgAioTargetID |
Enumerator | |
---|---|
PGAIO_TID_INVALID |
Definition at line 108 of file aio.h.
void pgaio_closing_fd | ( | int | fd | ) |
Definition at line 1107 of file aio.c.
References pgaio_my_backend, and pgaio_submit_staged().
void pgaio_enter_batchmode | ( | void | ) |
Definition at line 968 of file aio.c.
References elog, ERROR, PgAioBackend::in_batchmode, and pgaio_my_backend.
void pgaio_exit_batchmode | ( | void | ) |
Definition at line 979 of file aio.c.
References Assert(), PgAioBackend::in_batchmode, pgaio_my_backend, and pgaio_submit_staged().
bool pgaio_have_staged | ( | void | ) |
Definition at line 994 of file aio.c.
References Assert(), PgAioBackend::in_batchmode, PgAioBackend::num_staged_ios, and pgaio_my_backend.
PgAioHandle * pgaio_io_acquire | ( | struct ResourceOwnerData * | resowner, |
PgAioReturn * | ret | ||
) |
Definition at line 165 of file aio.c.
References pgaio_io_acquire_nb(), and pgaio_io_wait_for_free().
PgAioHandle * pgaio_io_acquire_nb | ( | struct ResourceOwnerData * | resowner, |
PgAioReturn * | ret | ||
) |
Definition at line 191 of file aio.c.
References Assert(), dclist_container, dclist_is_empty(), dclist_pop_head_node(), elog, ERROR, PgAioBackend::handed_out_io, PgAioBackend::idle_ios, MyProcNumber, PgAioBackend::num_staged_ios, PgAioHandle::owner_procno, PGAIO_HS_HANDED_OUT, PGAIO_HS_IDLE, pgaio_io_resowner_register(), pgaio_io_update_state(), pgaio_my_backend, PGAIO_RS_UNKNOWN, PGAIO_SUBMIT_BATCH_SIZE, pgaio_submit_staged(), PgAioHandle::report_return, PgAioReturn::result, PgAioHandle::state, and PgAioResult::status.
Referenced by pgaio_io_acquire().
uint64 * pgaio_io_get_handle_data | ( | PgAioHandle * | ioh, |
uint8 * | len | ||
) |
Definition at line 145 of file aio_callback.c.
References Assert(), PgAioCtl::handle_data, PgAioHandle::handle_data_len, PgAioHandle::iovec_off, len, and pgaio_ctl.
int pgaio_io_get_id | ( | PgAioHandle * | ioh | ) |
Definition at line 322 of file aio.c.
References Assert(), PgAioCtl::io_handle_count, PgAioCtl::io_handles, and pgaio_ctl.
Referenced by pgaio_io_wait_for_free(), and pgaio_worker_submission_queue_insert().
int pgaio_io_get_iovec | ( | PgAioHandle * | ioh, |
struct iovec ** | iov | ||
) |
Definition at line 42 of file aio_io.c.
References Assert(), PgAioHandle::iovec_off, PgAioCtl::iovecs, PG_IOV_MAX, pgaio_ctl, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
PgAioOp pgaio_io_get_op | ( | PgAioHandle * | ioh | ) |
Definition at line 52 of file aio_io.c.
References PgAioHandle::op.
PgAioOpData * pgaio_io_get_op_data | ( | PgAioHandle * | ioh | ) |
ProcNumber pgaio_io_get_owner | ( | PgAioHandle * | ioh | ) |
Definition at line 335 of file aio.c.
References PgAioHandle::owner_procno.
PgAioTargetData * pgaio_io_get_target_data | ( | PgAioHandle * | ioh | ) |
char * pgaio_io_get_target_description | ( | PgAioHandle * | ioh | ) |
Definition at line 81 of file aio_target.c.
References PgAioTargetInfo::describe_identity, pgaio_target_info, PgAioHandle::target, and PgAioHandle::target_data.
void pgaio_io_get_wref | ( | PgAioHandle * | ioh, |
PgAioWaitRef * | iow | ||
) |
Definition at line 346 of file aio.c.
References PgAioWaitRef::aio_index, Assert(), PgAioHandle::generation, PgAioWaitRef::generation_lower, PgAioWaitRef::generation_upper, PgAioCtl::io_handles, pgaio_ctl, PGAIO_HS_DEFINED, PGAIO_HS_HANDED_OUT, PGAIO_HS_STAGED, and PgAioHandle::state.
bool pgaio_io_has_target | ( | PgAioHandle * | ioh | ) |
Definition at line 38 of file aio_target.c.
References PGAIO_TID_INVALID, and PgAioHandle::target.
Referenced by pgaio_io_before_prep(), and pgaio_io_stage().
void pgaio_io_prep_readv | ( | PgAioHandle * | ioh, |
int | fd, | ||
int | iovcnt, | ||
uint64 | offset | ||
) |
Definition at line 78 of file aio_io.c.
References PgAioOpData::fd, fd(), PgAioOpData::iov_length, PgAioOpData::offset, PgAioHandle::op_data, pgaio_io_before_prep(), pgaio_io_stage(), PGAIO_OP_READV, and PgAioOpData::read.
void pgaio_io_prep_writev | ( | PgAioHandle * | ioh, |
int | fd, | ||
int | iovcnt, | ||
uint64 | offset | ||
) |
Definition at line 91 of file aio_io.c.
References PgAioOpData::fd, fd(), PgAioOpData::iov_length, PgAioOpData::offset, PgAioHandle::op_data, pgaio_io_before_prep(), pgaio_io_stage(), PGAIO_OP_WRITEV, and PgAioOpData::write.
void pgaio_io_register_callbacks | ( | PgAioHandle * | ioh, |
PgAioHandleCallbackID | cb_id, | ||
uint8 | cb_data | ||
) |
Definition at line 78 of file aio_callback.c.
References aio_handle_cbs, PgAioHandle::callbacks, PgAioHandle::callbacks_data, PgAioHandleCallbacksEntry::cb, PgAioHandleCallbacks::complete_local, DEBUG3, elog, ERROR, lengthof, PgAioHandleCallbacksEntry::name, PgAioHandle::num_callbacks, PANIC, pgaio_debug_io, and PGAIO_HANDLE_MAX_CALLBACKS.
void pgaio_io_release | ( | PgAioHandle * | ioh | ) |
Definition at line 234 of file aio.c.
References Assert(), elog, ERROR, PgAioBackend::handed_out_io, PGAIO_HS_HANDED_OUT, pgaio_io_reclaim(), pgaio_my_backend, PgAioHandle::resowner, and PgAioHandle::state.
void pgaio_io_release_resowner | ( | struct dlist_node * | ioh_node, |
bool | on_error | ||
) |
Definition at line 254 of file aio.c.
References Assert(), dlist_container, elog, ERROR, PgAioBackend::handed_out_io, PGAIO_HS_COMPLETED_IO, PGAIO_HS_COMPLETED_LOCAL, PGAIO_HS_COMPLETED_SHARED, PGAIO_HS_DEFINED, PGAIO_HS_HANDED_OUT, PGAIO_HS_IDLE, PGAIO_HS_STAGED, PGAIO_HS_SUBMITTED, pgaio_io_reclaim(), pgaio_my_backend, pgaio_submit_staged(), PgAioHandle::report_return, ResourceOwnerForgetAioHandle(), PgAioHandle::resowner, PgAioHandle::resowner_node, PgAioHandle::state, and WARNING.
Referenced by ResourceOwnerReleaseInternal().
void pgaio_io_set_flag | ( | PgAioHandle * | ioh, |
PgAioHandleFlags | flag | ||
) |
Definition at line 310 of file aio.c.
References Assert(), flag(), PgAioHandle::flags, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
void pgaio_io_set_handle_data_32 | ( | PgAioHandle * | ioh, |
uint32 * | data, | ||
uint8 | len | ||
) |
Definition at line 130 of file aio_callback.c.
References Assert(), data, PgAioCtl::handle_data, PgAioHandle::handle_data_len, i, PgAioHandle::iovec_off, len, PG_IOV_MAX, pgaio_ctl, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
void pgaio_io_set_handle_data_64 | ( | PgAioHandle * | ioh, |
uint64 * | data, | ||
uint8 | len | ||
) |
Definition at line 113 of file aio_callback.c.
References Assert(), data, PgAioCtl::handle_data, PgAioHandle::handle_data_len, i, PgAioHandle::iovec_off, len, PG_IOV_MAX, pgaio_ctl, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
void pgaio_io_set_target | ( | PgAioHandle * | ioh, |
PgAioTargetID | targetid | ||
) |
Definition at line 61 of file aio_target.c.
References Assert(), PGAIO_HS_HANDED_OUT, PGAIO_TID_INVALID, PgAioHandle::state, and PgAioHandle::target.
void pgaio_result_report | ( | PgAioResult | result, |
const PgAioTargetData * | target_data, | ||
int | elevel | ||
) |
Definition at line 162 of file aio_callback.c.
References aio_handle_cbs, Assert(), PgAioHandleCallbacksEntry::cb, elog, ERROR, PgAioResult::id, PgAioHandleCallbacksEntry::name, PGAIO_RS_OK, PGAIO_RS_UNKNOWN, PgAioHandleCallbacks::report, and PgAioResult::status.
void pgaio_submit_staged | ( | void | ) |
Definition at line 1010 of file aio.c.
References Assert(), DEBUG4, END_CRIT_SECTION, PgAioBackend::num_staged_ios, pgaio_debug, pgaio_method_ops, pgaio_my_backend, PgAioBackend::staged_ios, START_CRIT_SECTION, and IoMethodOps::submit.
Referenced by pgaio_closing_fd(), pgaio_error_cleanup(), pgaio_exit_batchmode(), pgaio_io_acquire_nb(), pgaio_io_release_resowner(), pgaio_io_stage(), and pgaio_io_wait_for_free().
bool pgaio_wref_check_done | ( | PgAioWaitRef * | iow | ) |
Definition at line 897 of file aio.c.
References MyProcNumber, PgAioHandle::owner_procno, PGAIO_HS_COMPLETED_LOCAL, PGAIO_HS_COMPLETED_SHARED, PGAIO_HS_IDLE, pgaio_io_from_wref(), pgaio_io_reclaim(), and pgaio_io_was_recycled().
void pgaio_wref_clear | ( | PgAioWaitRef * | iow | ) |
Definition at line 856 of file aio.c.
References PgAioWaitRef::aio_index, and PG_UINT32_MAX.
int pgaio_wref_get_id | ( | PgAioWaitRef * | iow | ) |
Definition at line 872 of file aio.c.
References PgAioWaitRef::aio_index, Assert(), and pgaio_wref_valid().
bool pgaio_wref_valid | ( | PgAioWaitRef * | iow | ) |
Definition at line 863 of file aio.c.
References PgAioWaitRef::aio_index, and PG_UINT32_MAX.
Referenced by pgaio_wref_get_id().
void pgaio_wref_wait | ( | PgAioWaitRef * | iow | ) |
Definition at line 883 of file aio.c.
References pgaio_io_from_wref(), and pgaio_io_wait().
|
extern |
Definition at line 73 of file aio.c.
Referenced by AioHandleDataShmemSize(), AioHandleIOVShmemSize(), AioHandleShmemSize(), AioShmemInit(), AioShmemSize(), and pgaio_io_wait_for_free().
|
extern |
Definition at line 72 of file aio.c.
Referenced by pgaio_workers_enabled().