diff options
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index f6113b2d243..aa9fbd80545 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -63,9 +63,8 @@ int LockTimeout = 0; int IdleInTransactionSessionTimeout = 0; bool log_lock_waits = false; -/* Pointer to this process's PGPROC and PGXACT structs, if any */ +/* Pointer to this process's PGPROC struct, if any */ PGPROC *MyProc = NULL; -PGXACT *MyPgXact = NULL; /* * This spinlock protects the freelist of recycled PGPROC structures. @@ -110,10 +109,8 @@ ProcGlobalShmemSize(void) size = add_size(size, mul_size(TotalProcs, sizeof(PGPROC))); size = add_size(size, sizeof(slock_t)); - size = add_size(size, mul_size(MaxBackends, sizeof(PGXACT))); - size = add_size(size, mul_size(NUM_AUXILIARY_PROCS, sizeof(PGXACT))); - size = add_size(size, mul_size(max_prepared_xacts, sizeof(PGXACT))); size = add_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->xids))); + size = add_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->subxidStates))); size = add_size(size, mul_size(TotalProcs, sizeof(*ProcGlobal->vacuumFlags))); return size; @@ -161,7 +158,6 @@ void InitProcGlobal(void) { PGPROC *procs; - PGXACT *pgxacts; int i, j; bool found; @@ -203,18 +199,6 @@ InitProcGlobal(void) ProcGlobal->allProcCount = MaxBackends + NUM_AUXILIARY_PROCS; /* - * Also allocate a separate array of PGXACT structures. This is separate - * from the main PGPROC array so that the most heavily accessed data is - * stored contiguously in memory in as few cache lines as possible. This - * provides significant performance benefits, especially on a - * multiprocessor system. There is one PGXACT structure for every PGPROC - * structure. - */ - pgxacts = (PGXACT *) ShmemAlloc(TotalProcs * sizeof(PGXACT)); - MemSet(pgxacts, 0, TotalProcs * sizeof(PGXACT)); - ProcGlobal->allPgXact = pgxacts; - - /* * Allocate arrays mirroring PGPROC fields in a dense manner. See * PROC_HDR. * @@ -224,6 +208,8 @@ InitProcGlobal(void) ProcGlobal->xids = (TransactionId *) ShmemAlloc(TotalProcs * sizeof(*ProcGlobal->xids)); MemSet(ProcGlobal->xids, 0, TotalProcs * sizeof(*ProcGlobal->xids)); + ProcGlobal->subxidStates = (XidCacheStatus *) ShmemAlloc(TotalProcs * sizeof(*ProcGlobal->subxidStates)); + MemSet(ProcGlobal->subxidStates, 0, TotalProcs * sizeof(*ProcGlobal->subxidStates)); ProcGlobal->vacuumFlags = (uint8 *) ShmemAlloc(TotalProcs * sizeof(*ProcGlobal->vacuumFlags)); MemSet(ProcGlobal->vacuumFlags, 0, TotalProcs * sizeof(*ProcGlobal->vacuumFlags)); @@ -372,7 +358,6 @@ InitProcess(void) (errcode(ERRCODE_TOO_MANY_CONNECTIONS), errmsg("sorry, too many clients already"))); } - MyPgXact = &ProcGlobal->allPgXact[MyProc->pgprocno]; /* * Cross-check that the PGPROC is of the type we expect; if this were not @@ -569,7 +554,6 @@ InitAuxiliaryProcess(void) ((volatile PGPROC *) auxproc)->pid = MyProcPid; MyProc = auxproc; - MyPgXact = &ProcGlobal->allPgXact[auxproc->pgprocno]; SpinLockRelease(ProcStructLock); |