#include "postgres.h"
#include "fmgr.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "port/pg_numa.h"
#include "storage/lwlock.h"
#include "storage/pg_shmem.h"
#include "storage/shmem.h"
#include "storage/spin.h"
#include "utils/builtins.h"
Go to the source code of this file.
Definition at line 493 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, s1, and s2.
Referenced by _brin_parallel_estimate_shared(), _bt_parallel_estimate_shared(), _gin_parallel_estimate_shared(), AioShmemSize(), ApplyLauncherShmemSize(), AsyncShmemInit(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), btestimateparallelscan(), BTreeShmemSize(), BufferManagerShmemSize(), CalculateShmemSize(), CheckpointerShmemSize(), estimate_variable_size(), EstimateClientConnectionInfoSpace(), EstimateComboCIDStateSpace(), EstimateGUCStateSpace(), EstimateLibraryStateSpace(), EstimateParamExecSpace(), EstimateParamListSpace(), EstimateSnapshotSpace(), EstimateTransactionStateSpace(), ExecAggEstimate(), ExecAppendEstimate(), ExecBitmapHeapEstimate(), ExecBitmapHeapInitializeDSM(), ExecHashEstimate(), ExecIncrementalSortEstimate(), ExecMemoizeEstimate(), ExecSortEstimate(), expand_planner_arrays(), FastPathLockShmemSize(), hash_estimate_size(), index_parallelscan_estimate(), index_parallelscan_initialize(), InitializeShmemGUCs(), InjectionPointShmemSize(), LockManagerShmemSize(), LWLockShmemSize(), MultiXactShmemSize(), pgaio_worker_shmem_size(), PgArchShmemSize(), PGProcShmemSize(), pgss_memsize(), PMSignalShmemSize(), PredicateLockShmemInit(), PredicateLockShmemSize(), ProcArrayShmemInit(), ProcArrayShmemSize(), ProcGlobalShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), RequestAddinShmemSpace(), SerializeTransactionState(), SharedInvalShmemSize(), shm_toc_estimate(), StatsShmemSize(), StrategyShmemSize(), table_parallelscan_estimate(), tuplesort_estimate_shared(), TwoPhaseShmemSize(), WaitEventCustomShmemSize(), WalRcvShmemSize(), WalSndShmemSize(), and XLOGShmemSize().
Definition at line 102 of file shmem.c.
References ShmemBase, ShmemEnd, ShmemSegHdr, and PGShmemHeader::totalsize.
Referenced by CreateSharedMemoryAndSemaphores().
Definition at line 115 of file shmem.c.
References Assert(), CACHELINEALIGN, PGShmemHeader::freeoffset, PGShmemHeader::index, ShmemAllocUnlocked(), ShmemIndex, ShmemLock, ShmemSegHdr, and SpinLockInit.
Referenced by CreateSharedMemoryAndSemaphores().
Definition at line 283 of file shmem.c.
References HASHCTL::entrysize, HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, SHMEM_INDEX_KEYSIZE, SHMEM_INDEX_SIZE, ShmemIndex, and ShmemInitHash().
Referenced by CreateOrAttachShmemStructs().
Definition at line 510 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, s1, and s2.
Referenced by _brin_begin_parallel(), _bt_begin_parallel(), _gin_begin_parallel(), AioBackendShmemSize(), AioHandleDataShmemSize(), AioHandleIOVShmemSize(), AioHandleShmemSize(), ApplyLauncherShmemSize(), AsyncShmemInit(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemInit(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), BTreeShmemSize(), BufferManagerShmemSize(), CheckpointerShmemSize(), EstimateComboCIDStateSpace(), EstimatePendingSyncsSpace(), EstimateReindexStateSpace(), EstimateSnapshotSpace(), EstimateTransactionStateSpace(), ExecAggEstimate(), ExecBitmapHeapEstimate(), ExecBitmapHeapInitializeDSM(), ExecHashEstimate(), ExecIncrementalSortEstimate(), ExecInitParallelPlan(), ExecMemoizeEstimate(), ExecParallelRetrieveInstrumentation(), ExecParallelRetrieveJitInstrumentation(), ExecParallelSetupTupleQueues(), ExecSortEstimate(), FastPathLockShmemSize(), hash_estimate_size(), InitializeParallelDSM(), LWLockShmemSize(), parallel_vacuum_init(), PGProcShmemSize(), PGSemaphoreShmemSize(), PMSignalShmemSize(), PredicateLockShmemInit(), PredicateLockShmemSize(), ProcArrayShmemInit(), ProcArrayShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), SharedInvalShmemSize(), shm_toc_estimate(), tuplesort_estimate_shared(), TwoPhaseShmemSize(), WalSndShmemSize(), and XLOGShmemSize().
Definition at line 527 of file shmem.c.
References CStringGetTextDatum, PGShmemHeader::freeoffset, hash_seq_init(), hash_seq_search(), InitMaterializedSRF(), Int64GetDatum(), LW_SHARED, LWLockAcquire(), LWLockRelease(), PG_GET_SHMEM_SIZES_COLS, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, ShmemIndex, ShmemSegHdr, PGShmemHeader::totalsize, tuplestore_putvalues(), and values.
Definition at line 584 of file shmem.c.
References CHECK_FOR_INTERRUPTS, CStringGetTextDatum, DEBUG1, elog, ERROR, firstNumaTouch, hash_seq_init(), hash_seq_search(), i, if(), InitMaterializedSRF(), Int32GetDatum(), Int64GetDatum(), LW_SHARED, LWLockAcquire(), LWLockRelease(), palloc(), palloc0(), PG_GET_SHMEM_NUMA_SIZES_COLS, pg_get_shmem_pagesize(), pg_numa_get_max_node(), pg_numa_init(), pg_numa_query_pages(), pg_numa_touch_mem_if_required, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, ShmemIndex, ShmemSegHdr, PGShmemHeader::totalsize, tuplestore_putvalues(), TYPEALIGN, TYPEALIGN_DOWN, UINT64_FORMAT, and values.
Definition at line 740 of file shmem.c.
References Assert(), GetHugePageSize(), HUGE_PAGES_ON, huge_pages_status, HUGE_PAGES_UNKNOWN, and IsUnderPostmaster.
Referenced by pg_buffercache_numa_pages(), and pg_get_shmem_allocations_numa().
Definition at line 274 of file shmem.c.
References ShmemBase, and ShmemEnd.
Referenced by ReleasePredXact(), and ShmemInitStruct().
Definition at line 152 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, and ShmemAllocRaw().
Referenced by CreateLWLocks(), ShmemInitStruct(), and StatsShmemInit().
Definition at line 186 of file shmem.c.
References Assert(), CACHELINEALIGN, PGShmemHeader::freeoffset, ShmemBase, ShmemLock, ShmemSegHdr, SpinLockAcquire, and SpinLockRelease.
Referenced by ShmemAlloc(), ShmemAllocNoError(), and ShmemInitStruct().
Definition at line 238 of file shmem.c.
References Assert(), ereport, errcode(), errmsg(), ERROR, PGShmemHeader::freeoffset, MAXALIGN, ShmemBase, ShmemSegHdr, and PGShmemHeader::totalsize.
Referenced by InitShmemAllocation(), and PGReserveSemaphores().
Definition at line 332 of file shmem.c.
References HASHCTL::alloc, HASHCTL::dsize, HASH_ALLOC, HASH_ATTACH, hash_create(), HASH_DIRSIZE, hash_get_shared_size(), hash_select_dirsize(), HASH_SHARED_MEM, HASHCTL::hctl, HASHCTL::max_dsize, name, ShmemAllocNoError(), and ShmemInitStruct().
Referenced by InitBufTable(), InitShmemIndex(), LockManagerShmemInit(), pgss_shmem_startup(), PredicateLockShmemInit(), and WaitEventCustomShmemInit().
Definition at line 387 of file shmem.c.
References ShmemIndexEnt::allocated_size, Assert(), CACHELINEALIGN, ereport, errcode(), errmsg(), ERROR, HASH_ENTER_NULL, HASH_REMOVE, hash_search(), PGShmemHeader::index, IsUnderPostmaster, ShmemIndexEnt::location, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), name, ShmemAddrIsValid(), ShmemAlloc(), ShmemAllocRaw(), ShmemIndex, ShmemSegHdr, and ShmemIndexEnt::size.
Referenced by AioShmemInit(), ApplyLauncherShmemInit(), AsyncShmemInit(), AutoVacuumShmemInit(), BackendStatusShmemInit(), BackgroundWorkerShmemInit(), BTreeShmemInit(), BufferManagerShmemInit(), CheckpointerShmemInit(), CommitTsShmemInit(), dsm_shmem_init(), DSMRegistryShmemInit(), InitProcGlobal(), injection_shmem_startup(), InjectionPointShmemInit(), LockManagerShmemInit(), MultiXactShmemInit(), pgaio_worker_shmem_init(), PgArchShmemInit(), pgss_shmem_startup(), PMSignalShmemInit(), PredicateLockShmemInit(), ProcArrayShmemInit(), ProcSignalShmemInit(), ReplicationOriginShmemInit(), ReplicationSlotsShmemInit(), SerialInit(), SharedInvalShmemInit(), ShmemInitHash(), SimpleLruInit(), SlotSyncShmemInit(), StatsShmemInit(), StrategyInitialize(), SyncScanShmemInit(), test_aio_shmem_startup(), TwoPhaseShmemInit(), VarsupShmemInit(), WaitEventCustomShmemInit(), WalRcvShmemInit(), WalSndShmemInit(), WalSummarizerShmemInit(), XLogPrefetchShmemInit(), XLogRecoveryShmemInit(), and XLOGShmemInit().
Definition at line 94 of file shmem.c.
Referenced by pg_get_shmem_allocations_numa().
Definition at line 84 of file shmem.c.
Referenced by InitShmemAccess(), ShmemAddrIsValid(), ShmemAllocRaw(), and ShmemAllocUnlocked().
Definition at line 86 of file shmem.c.
Referenced by InitShmemAccess(), and ShmemAddrIsValid().
Definition at line 91 of file shmem.c.
Referenced by InitShmemAllocation(), InitShmemIndex(), pg_get_shmem_allocations(), pg_get_shmem_allocations_numa(), and ShmemInitStruct().
Definition at line 88 of file shmem.c.
Referenced by GetLWTrancheName(), InitShmemAllocation(), LWLockNewTrancheId(), and ShmemAllocRaw().
Definition at line 82 of file shmem.c.
Referenced by InitShmemAccess(), InitShmemAllocation(), pg_get_shmem_allocations(), pg_get_shmem_allocations_numa(), ShmemAllocRaw(), ShmemAllocUnlocked(), and ShmemInitStruct().