|
PostgreSQL Source Code git master
|
#include "storage/dsm_impl.h"

Go to the source code of this file.
Macros | |
| #define | DSM_CREATE_NULL_IF_MAXSEGMENTS 0x0001 |
Typedefs | |
| typedef struct dsm_segment | dsm_segment |
| typedef struct PGShmemHeader | PGShmemHeader |
| typedef void(* | on_dsm_detach_callback) (dsm_segment *, Datum arg) |
Functions | |
| void | dsm_cleanup_using_control_segment (dsm_handle old_control_handle) |
| void | dsm_postmaster_startup (PGShmemHeader *) |
| void | dsm_backend_shutdown (void) |
| void | dsm_detach_all (void) |
| dsm_segment * | dsm_create (Size size, int flags) |
| dsm_segment * | dsm_attach (dsm_handle h) |
| void | dsm_detach (dsm_segment *seg) |
| void | dsm_pin_mapping (dsm_segment *seg) |
| void | dsm_unpin_mapping (dsm_segment *seg) |
| void | dsm_pin_segment (dsm_segment *seg) |
| void | dsm_unpin_segment (dsm_handle handle) |
| dsm_segment * | dsm_find_mapping (dsm_handle handle) |
| void * | dsm_segment_address (dsm_segment *seg) |
| Size | dsm_segment_map_length (dsm_segment *seg) |
| dsm_handle | dsm_segment_handle (dsm_segment *seg) |
| void | on_dsm_detach (dsm_segment *seg, on_dsm_detach_callback function, Datum arg) |
| void | cancel_on_dsm_detach (dsm_segment *seg, on_dsm_detach_callback function, Datum arg) |
| void | reset_on_dsm_detach (void) |
| typedef struct dsm_segment dsm_segment |
| typedef void(* on_dsm_detach_callback) (dsm_segment *, Datum arg) |
| typedef struct PGShmemHeader PGShmemHeader |
|
extern |
Definition at line 1155 of file dsm.c.
References dsm_segment_detach_callback::arg, arg, slist_mutable_iter::cur, dsm_segment_detach_callback::function, function, dsm_segment::on_detach, pfree(), slist_container, slist_delete_current(), and slist_foreach_modify.
Referenced by shm_mq_detach(), and test_shm_mq_setup().
|
extern |
Definition at line 673 of file dsm.c.
References Assert, dsm_segment::control_slot, dlist_iter::cur, dlist_container, dlist_foreach, dsm_backend_startup(), dsm_control, dsm_create_descriptor(), dsm_detach(), dsm_impl_op(), dsm_init_done, dsm_main_space_begin, DSM_OP_ATTACH, dsm_segment_list, elog, ERROR, fb(), dsm_control_item::first_page, FPM_PAGE_SIZE, dsm_segment::handle, dsm_control_item::handle, i, dsm_segment::impl_private, INVALID_CONTROL_SLOT, is_main_region_dsm_handle(), IsUnderPostmaster, dsm_control_header::item, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), dsm_segment::mapped_address, dsm_segment::mapped_size, dsm_control_header::nitems, nitems, dsm_control_item::npages, and dsm_control_item::refcnt.
Referenced by AttachSession(), autoprewarm_database_main(), dsa_attach(), dsa_get_total_size_from_handle(), get_segment_by_index(), GetNamedDSMSegment(), ParallelApplyWorkerMain(), ParallelWorkerMain(), RepackWorkerMain(), and test_shm_mq_main().
Definition at line 765 of file dsm.c.
References dlist_head_element, dlist_is_empty(), dsm_detach(), and dsm_segment_list.
Referenced by shmem_exit().
|
extern |
Definition at line 248 of file dsm.c.
References DEBUG1, DEBUG2, dsm_control_segment_sane(), dsm_impl_op(), DSM_OP_ATTACH, DSM_OP_DESTROY, DSM_OP_DETACH, elog, fb(), i, is_main_region_dsm_handle(), LOG, and nitems.
Referenced by PGSharedMemoryCreate().
|
extern |
Definition at line 524 of file dsm.c.
References Assert, dsm_segment::control_slot, dlist_delete(), dsm_backend_startup(), dsm_control, dsm_create_descriptor(), DSM_CREATE_NULL_IF_MAXSEGMENTS, DSM_HANDLE_INVALID, dsm_impl_op(), dsm_init_done, dsm_main_space_begin, DSM_OP_CREATE, DSM_OP_DESTROY, ereport, errcode(), errmsg, ERROR, fb(), dsm_control_item::first_page, FPM_PAGE_SIZE, FreePageManagerGet(), FreePageManagerPut(), dsm_segment::handle, dsm_control_item::handle, i, dsm_segment::impl_private, dsm_control_item::impl_private_pm_handle, is_main_region_dsm_handle(), IsPostmasterEnvironment, IsUnderPostmaster, dsm_control_header::item, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), make_main_region_dsm_handle(), dsm_segment::mapped_address, dsm_segment::mapped_size, dsm_control_header::maxitems, dsm_control_header::nitems, nitems, dsm_segment::node, dsm_control_item::npages, pfree(), pg_global_prng_state, pg_prng_uint32(), dsm_control_item::pinned, dsm_control_item::refcnt, ResourceOwnerForgetDSM(), dsm_segment::resowner, and WARNING.
Referenced by apw_load_buffers(), dsa_create_ext(), GetNamedDSMSegment(), GetSessionDsmHandle(), InitializeParallelDSM(), make_new_segment(), pa_setup_dsm(), setup_dynamic_shared_memory(), and start_repack_decoding_worker().
|
extern |
Definition at line 811 of file dsm.c.
References dsm_segment_detach_callback::arg, arg, Assert, dsm_segment::control_slot, dlist_delete(), dsm_control, dsm_impl_op(), dsm_main_space_begin, DSM_OP_DESTROY, DSM_OP_DETACH, fb(), dsm_control_item::first_page, FreePageManagerPut(), dsm_segment_detach_callback::function, function, dsm_segment::handle, dsm_control_item::handle, HOLD_INTERRUPTS, dsm_segment::impl_private, INVALID_CONTROL_SLOT, is_main_region_dsm_handle(), dsm_control_header::item, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), dsm_segment::mapped_address, dsm_segment::mapped_size, dsm_segment::node, dsm_control_item::npages, dsm_segment::on_detach, pfree(), dsm_control_item::pinned, dsm_control_item::refcnt, ResourceOwnerForgetDSM(), dsm_segment::resowner, RESUME_INTERRUPTS, slist_container, slist_is_empty(), slist_pop_head_node(), and WARNING.
Referenced by apw_load_buffers(), autoprewarm_database_main(), check_for_freed_segments_locked(), destroy_superblock(), DestroyParallelContext(), DetachSession(), dsa_detach(), dsa_get_total_size_from_handle(), dsm_attach(), dsm_backend_shutdown(), dsm_detach_all(), pa_free_worker_info(), pa_shutdown(), ParallelWorkerShutdown(), RepackWorkerShutdown(), ResOwnerReleaseDSM(), stop_repack_decoding_worker(), test_shm_mq(), test_shm_mq_main(), and test_shm_mq_pipelined().
Definition at line 783 of file dsm.c.
References dlist_head_element, dlist_is_empty(), dsm_control, dsm_control_handle, dsm_control_impl_private, dsm_control_mapped_size, dsm_detach(), dsm_impl_op(), DSM_OP_DETACH, dsm_segment_list, ERROR, and fb().
Referenced by postmaster_child_launch().
|
extern |
Definition at line 1084 of file dsm.c.
References dlist_iter::cur, dlist_container, dlist_foreach, dsm_segment_list, fb(), and dsm_segment::handle.
Referenced by dsa_get_total_size_from_handle(), dsa_is_attached(), and GetNamedDSMSegment().
|
extern |
Definition at line 923 of file dsm.c.
References fb(), ResourceOwnerForgetDSM(), and dsm_segment::resowner.
Referenced by AttachSession(), dsa_pin_mapping(), GetNamedDSMSegment(), and GetSessionDsmHandle().
|
extern |
Definition at line 963 of file dsm.c.
References dsm_segment::control_slot, dsm_control, dsm_impl_pin_segment(), elog, ERROR, fb(), dsm_segment::handle, dsm_segment::impl_private, dsm_control_item::impl_private_pm_handle, is_main_region_dsm_handle(), dsm_control_header::item, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), dsm_control_item::pinned, and dsm_control_item::refcnt.
Referenced by dsa_create_ext(), GetNamedDSMSegment(), and make_new_segment().
|
extern |
Definition at line 187 of file dsm.c.
References Assert, DEBUG2, dsm_cleanup_for_mmap(), dsm_control, dsm_control_bytes_needed(), dsm_control_handle, dsm_control_impl_private, dsm_control_mapped_size, DSM_HANDLE_INVALID, DSM_IMPL_MMAP, dsm_impl_op(), DSM_OP_CREATE, dsm_postmaster_shutdown(), dynamic_shared_memory_type, elog, ERROR, fb(), IsUnderPostmaster, dsm_control_header::magic, MaxBackends, dsm_control_header::maxitems, dsm_control_header::nitems, on_shmem_exit(), PG_DYNSHMEM_CONTROL_MAGIC, PG_DYNSHMEM_FIXED_SLOTS, PG_DYNSHMEM_SLOTS_PER_BACKEND, pg_global_prng_state, pg_prng_uint32(), and PointerGetDatum.
Referenced by CreateSharedMemoryAndSemaphores().
|
extern |
Definition at line 1103 of file dsm.c.
References Assert, fb(), and dsm_segment::mapped_address.
Referenced by apw_load_buffers(), AttachSession(), autoprewarm_database_main(), dsa_attach(), dsa_create_ext(), dsa_get_total_size_from_handle(), get_initial_snapshot(), get_segment_by_index(), GetNamedDSMSegment(), GetSessionDsmHandle(), InitializeParallelDSM(), make_new_segment(), pa_setup_dsm(), ParallelApplyWorkerMain(), ParallelWorkerMain(), process_concurrent_changes(), RepackWorkerMain(), setup_dynamic_shared_memory(), start_repack_decoding_worker(), and test_shm_mq_main().
|
extern |
Definition at line 1131 of file dsm.c.
References dsm_segment::handle.
Referenced by apw_load_buffers(), destroy_superblock(), dsa_create_ext(), GetNamedDSMSegment(), GetSessionDsmHandle(), LaunchParallelWorkers(), make_new_segment(), pa_launch_parallel_worker(), ResOwnerPrintDSM(), setup_background_workers(), and start_repack_decoding_worker().
|
extern |
Definition at line 1113 of file dsm.c.
References Assert, fb(), dsm_segment::mapped_address, and dsm_segment::mapped_size.
|
extern |
Definition at line 942 of file dsm.c.
References Assert, CurrentResourceOwner, fb(), ResourceOwnerEnlarge(), ResourceOwnerRememberDSM(), and dsm_segment::resowner.
|
extern |
Definition at line 996 of file dsm.c.
References Assert, dsm_control, dsm_impl_op(), dsm_impl_unpin_segment(), dsm_main_space_begin, DSM_OP_DESTROY, elog, ERROR, fb(), dsm_control_item::first_page, FreePageManagerPut(), dsm_control_item::handle, i, dsm_control_item::impl_private_pm_handle, INVALID_CONTROL_SLOT, is_main_region_dsm_handle(), dsm_control_header::item, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), dsm_control_header::nitems, dsm_control_item::npages, dsm_control_item::pinned, dsm_control_item::refcnt, and WARNING.
Referenced by destroy_superblock(), and dsa_release_in_place().
|
extern |
Definition at line 1140 of file dsm.c.
References dsm_segment_detach_callback::arg, arg, dsm_segment_detach_callback::function, function, MemoryContextAlloc(), dsm_segment_detach_callback::node, dsm_segment::on_detach, slist_push_head(), and TopMemoryContext.
Referenced by dsa_attach(), dsa_attach_in_place(), dsa_create_ext(), dsa_create_in_place_ext(), parallel_vacuum_init(), pq_redirect_to_shm_mq(), setup_background_workers(), SharedFileSetAttach(), SharedFileSetInit(), SharedRecordTypmodRegistryAttach(), SharedRecordTypmodRegistryInit(), and shm_mq_attach().
Definition at line 1178 of file dsm.c.
References dsm_segment::control_slot, dlist_iter::cur, dlist_container, dlist_foreach, dsm_segment_list, INVALID_CONTROL_SLOT, dsm_segment::on_detach, pfree(), slist_container, slist_is_empty(), and slist_pop_head_node().
Referenced by on_exit_reset().