|
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_SMGR + 1) |
| #define | PGAIO_HCB_MAX PGAIO_HCB_LOCAL_BUFFER_READV |
| #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 , PGAIO_TID_SMGR } |
| enum | PgAioHandleCallbackID { PGAIO_HCB_INVALID = 0 , PGAIO_HCB_MD_READV , PGAIO_HCB_SHARED_BUFFER_READV , PGAIO_HCB_LOCAL_BUFFER_READV } |
Variables | |
| PGDLLIMPORT int | io_method |
| PGDLLIMPORT int | io_max_concurrency |
| #define DEFAULT_IO_METHOD IOMETHOD_WORKER |
| #define PGAIO_HCB_MAX PGAIO_HCB_LOCAL_BUFFER_READV |
| #define PGAIO_OP_COUNT (PGAIO_OP_WRITEV + 1) |
| #define PGAIO_TID_COUNT (PGAIO_TID_SMGR + 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 | |
Definition at line 32 of file aio.h.
| Enumerator | |
|---|---|
| PGAIO_HCB_INVALID | |
| PGAIO_HCB_MD_READV | |
| PGAIO_HCB_SHARED_BUFFER_READV | |
| PGAIO_HCB_LOCAL_BUFFER_READV | |
| enum PgAioHandleFlags |
| Enumerator | |
|---|---|
| PGAIO_HF_REFERENCES_LOCAL | |
| PGAIO_HF_SYNCHRONOUS | |
| PGAIO_HF_BUFFERED | |
Definition at line 48 of file aio.h.
| enum PgAioOp |
| Enumerator | |
|---|---|
| PGAIO_OP_INVALID | |
| PGAIO_OP_READV | |
| PGAIO_OP_WRITEV | |
Definition at line 87 of file aio.h.
| enum PgAioTargetID |
| Enumerator | |
|---|---|
| PGAIO_TID_INVALID | |
| PGAIO_TID_SMGR | |
Definition at line 116 of file aio.h.
| void pgaio_closing_fd | ( | int | fd | ) |
Definition at line 1220 of file aio.c.
References dlist_iter::cur, dclist_container, dclist_count(), dclist_foreach, dclist_is_empty(), DEBUG2, fd(), PgAioHandle::generation, PgAioBackend::in_flight_ios, PgAioBackend::num_staged_ios, pgaio_debug, pgaio_debug_io, pgaio_io_uses_fd(), pgaio_io_wait(), pgaio_method_ops, pgaio_my_backend, pgaio_submit_staged(), and IoMethodOps::wait_on_fd_before_close.
Referenced by CloseTransientFile(), FileClose(), FreeDesc(), and LruDelete().
| void pgaio_enter_batchmode | ( | void | ) |
Definition at line 1081 of file aio.c.
References elog, ERROR, PgAioBackend::in_batchmode, and pgaio_my_backend.
Referenced by batch_start(), read_rel_block_ll(), and read_stream_look_ahead().
| void pgaio_exit_batchmode | ( | void | ) |
Definition at line 1092 of file aio.c.
References Assert(), PgAioBackend::in_batchmode, pgaio_my_backend, and pgaio_submit_staged().
Referenced by batch_end(), read_rel_block_ll(), and read_stream_look_ahead().
| bool pgaio_have_staged | ( | void | ) |
Definition at line 1107 of file aio.c.
References Assert(), PgAioBackend::in_batchmode, PgAioBackend::num_staged_ios, and pgaio_my_backend.
Referenced by ReadBuffersCanStartIO().
| PgAioHandle * pgaio_io_acquire | ( | struct ResourceOwnerData * | resowner, |
| PgAioReturn * | ret | ||
| ) |
Definition at line 162 of file aio.c.
References pgaio_io_acquire_nb(), and pgaio_io_wait_for_free().
Referenced by AsyncReadBuffers(), handle_get(), handle_get_and_error(), handle_get_release(), handle_get_twice(), and read_rel_block_ll().
| PgAioHandle * pgaio_io_acquire_nb | ( | struct ResourceOwnerData * | resowner, |
| PgAioReturn * | ret | ||
| ) |
Definition at line 188 of file aio.c.
References Assert(), dclist_container, dclist_is_empty(), dclist_pop_head_node(), elog, ERROR, PgAioBackend::handed_out_io, HOLD_INTERRUPTS, 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, RESUME_INTERRUPTS, PgAioHandle::state, and PgAioResult::status.
Referenced by AsyncReadBuffers(), and pgaio_io_acquire().
| uint64 * pgaio_io_get_handle_data | ( | PgAioHandle * | ioh, |
| uint8 * | len | ||
| ) |
Definition at line 156 of file aio_callback.c.
References Assert(), PgAioCtl::handle_data, PgAioHandle::handle_data_len, PgAioHandle::iovec_off, len, and pgaio_ctl.
Referenced by buffer_readv_complete(), and buffer_stage_common().
| int pgaio_io_get_id | ( | PgAioHandle * | ioh | ) |
Definition at line 342 of file aio.c.
References Assert(), PgAioCtl::io_handle_count, PgAioCtl::io_handles, and pgaio_ctl.
Referenced by pg_get_aios(), pgaio_io_wait(), 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.
Referenced by mdstartreadv().
| PgAioOp pgaio_io_get_op | ( | PgAioHandle * | ioh | ) |
Definition at line 52 of file aio_io.c.
References PgAioHandle::op.
Referenced by smgr_aio_reopen().
| PgAioOpData * pgaio_io_get_op_data | ( | PgAioHandle * | ioh | ) |
Definition at line 58 of file aio_io.c.
References PgAioHandle::op_data.
Referenced by smgr_aio_reopen().
| ProcNumber pgaio_io_get_owner | ( | PgAioHandle * | ioh | ) |
Definition at line 355 of file aio.c.
References PgAioHandle::owner_procno.
Referenced by buffer_readv_complete(), and smgr_aio_reopen().
| PgAioTargetData * pgaio_io_get_target_data | ( | PgAioHandle * | ioh | ) |
Definition at line 73 of file aio_target.c.
References PgAioHandle::target_data.
Referenced by buffer_readv_complete(), md_readv_complete(), pgaio_io_set_target_smgr(), shared_buffer_readv_complete_local(), and smgr_aio_reopen().
| char * pgaio_io_get_target_description | ( | PgAioHandle * | ioh | ) |
Definition at line 84 of file aio_target.c.
References Assert(), PgAioTargetInfo::describe_identity, pgaio_target_info, PGAIO_TID_COUNT, PGAIO_TID_INVALID, PgAioHandle::target, and PgAioHandle::target_data.
Referenced by pg_get_aios().
| void pgaio_io_get_wref | ( | PgAioHandle * | ioh, |
| PgAioWaitRef * | iow | ||
| ) |
Definition at line 366 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.
Referenced by AsyncReadBuffers(), buffer_stage_common(), and read_rel_block_ll().
| bool pgaio_io_has_target | ( | PgAioHandle * | ioh | ) |
Definition at line 40 of file aio_target.c.
References PGAIO_TID_INVALID, and PgAioHandle::target.
Referenced by pgaio_io_before_start(), and pgaio_io_stage().
| void pgaio_io_register_callbacks | ( | PgAioHandle * | ioh, |
| PgAioHandleCallbackID | cb_id, | ||
| uint8 | cb_data | ||
| ) |
Definition at line 86 of file aio_callback.c.
References aio_handle_cbs, Assert(), PgAioHandle::callbacks, PgAioHandle::callbacks_data, PgAioHandleCallbacksEntry::cb, PgAioHandleCallbacks::complete_local, DEBUG3, elog, ERROR, lengthof, PgAioHandleCallbacksEntry::name, PgAioHandle::num_callbacks, PANIC, pgaio_debug_io, PGAIO_HANDLE_MAX_CALLBACKS, and PGAIO_HCB_MAX.
Referenced by AsyncReadBuffers(), mdstartreadv(), and read_rel_block_ll().
| void pgaio_io_release | ( | PgAioHandle * | ioh | ) |
Definition at line 240 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.
Referenced by AsyncReadBuffers(), handle_get_release(), and handle_release_last().
| void pgaio_io_release_resowner | ( | struct dlist_node * | ioh_node, |
| bool | on_error | ||
| ) |
Definition at line 266 of file aio.c.
References Assert(), dlist_container, elog, ERROR, PgAioBackend::handed_out_io, HOLD_INTERRUPTS, 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, RESUME_INTERRUPTS, PgAioHandle::state, and WARNING.
Referenced by ResourceOwnerReleaseInternal().
| void pgaio_io_set_flag | ( | PgAioHandle * | ioh, |
| PgAioHandleFlags | flag | ||
| ) |
Definition at line 330 of file aio.c.
References Assert(), flag(), PgAioHandle::flags, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
Referenced by AsyncReadBuffers(), mdstartreadv(), and read_rel_block_ll().
| void pgaio_io_set_handle_data_32 | ( | PgAioHandle * | ioh, |
| uint32 * | data, | ||
| uint8 | len | ||
| ) |
Definition at line 140 of file aio_callback.c.
References Assert(), data, PgAioCtl::handle_data, PgAioHandle::handle_data_len, i, io_max_combine_limit, PgAioHandle::iovec_off, len, PG_IOV_MAX, pgaio_ctl, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
Referenced by AsyncReadBuffers(), and read_rel_block_ll().
| void pgaio_io_set_handle_data_64 | ( | PgAioHandle * | ioh, |
| uint64 * | data, | ||
| uint8 | len | ||
| ) |
Definition at line 122 of file aio_callback.c.
References Assert(), data, PgAioCtl::handle_data, PgAioHandle::handle_data_len, i, io_max_combine_limit, 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 64 of file aio_target.c.
References Assert(), PGAIO_HS_HANDED_OUT, PGAIO_TID_INVALID, PgAioHandle::state, and PgAioHandle::target.
Referenced by pgaio_io_set_target_smgr().
| void pgaio_io_start_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_start(), pgaio_io_stage(), PGAIO_OP_READV, and PgAioOpData::read.
Referenced by FileStartReadV().
| void pgaio_io_start_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_start(), pgaio_io_stage(), PGAIO_OP_WRITEV, and PgAioOpData::write.
| void pgaio_result_report | ( | PgAioResult | result, |
| const PgAioTargetData * | target_data, | ||
| int | elevel | ||
| ) |
Definition at line 173 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.
Referenced by buffer_readv_complete(), buffer_readv_complete_one(), md_readv_complete(), ProcessReadBuffersResult(), and read_rel_block_ll().
| void pgaio_submit_staged | ( | void | ) |
Definition at line 1123 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 AsyncReadBuffers(), pgaio_closing_fd(), pgaio_error_cleanup(), pgaio_exit_batchmode(), pgaio_io_acquire_nb(), pgaio_io_release_resowner(), pgaio_io_stage(), pgaio_io_wait_for_free(), and ReadBuffersCanStartIO().
| bool pgaio_wref_check_done | ( | PgAioWaitRef * | iow | ) |
Definition at line 1005 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().
Referenced by WaitReadBuffers().
| void pgaio_wref_clear | ( | PgAioWaitRef * | iow | ) |
Definition at line 964 of file aio.c.
References PgAioWaitRef::aio_index, and PG_UINT32_MAX.
Referenced by AsyncReadBuffers(), BufferManagerShmemInit(), InitLocalBuffers(), StartReadBuffersImpl(), TerminateBufferIO(), and TerminateLocalBufferIO().
| int pgaio_wref_get_id | ( | PgAioWaitRef * | iow | ) |
Definition at line 980 of file aio.c.
References PgAioWaitRef::aio_index, Assert(), and pgaio_wref_valid().
| bool pgaio_wref_valid | ( | PgAioWaitRef * | iow | ) |
Definition at line 971 of file aio.c.
References PgAioWaitRef::aio_index, and PG_UINT32_MAX.
Referenced by InvalidateLocalBuffer(), pgaio_wref_get_id(), ProcessReadBuffersResult(), StartLocalBufferIO(), WaitIO(), and WaitReadBuffers().
| void pgaio_wref_wait | ( | PgAioWaitRef * | iow | ) |
Definition at line 991 of file aio.c.
References pgaio_io_from_wref(), and pgaio_io_wait().
Referenced by InvalidateLocalBuffer(), read_rel_block_ll(), StartLocalBufferIO(), WaitIO(), and WaitReadBuffers().
| StaticAssertDecl | ( | ) |
|
extern |
Definition at line 75 of file aio.c.
Referenced by AioHandleDataShmemSize(), AioHandleIOVShmemSize(), AioHandleShmemSize(), AioShmemInit(), AioShmemSize(), and pgaio_io_wait_for_free().
|
extern |
Definition at line 74 of file aio.c.
Referenced by pgaio_workers_enabled(), read_stream_begin_impl(), StartReadBuffersImpl(), and WaitReadBuffers().