diff options
author | Andres Freund <andres@anarazel.de> | 2020-04-07 17:36:23 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2020-04-07 17:36:23 -0700 |
commit | 75848bc74411130ede23995d0ab1aefb12c4c4b0 (patch) | |
tree | 239b59be148611c1d03f0cc97f599af42a59a400 /src/backend/access/transam/multixact.c | |
parent | 2b88fdde30d8e9bf833b75a014189e9148233b85 (diff) | |
download | postgresql-75848bc74411130ede23995d0ab1aefb12c4c4b0.tar.gz postgresql-75848bc74411130ede23995d0ab1aefb12c4c4b0.zip |
snapshot scalability: Move delayChkpt from PGXACT to PGPROC.
The goal of separating hotly accessed per-backend data from PGPROC
into PGXACT is to make accesses fast (GetSnapshotData() in
particular). But delayChkpt is not actually accessed frequently; only
when starting a checkpoint. As it is frequently modified (multiple
times in the course of a single transaction), storing it in the same
cacheline as hotly accessed data unnecessarily dirties a contended
cacheline.
Therefore move delayChkpt to PGPROC.
This is part of a larger series of patches intending to improve
GetSnapshotData() scalability. It is committed and pushed separately,
as it is independently beneficial (small but measurable win, limited
by the other frequent modifications of PGXACT).
Author: Andres Freund
Reviewed-By: Robert Haas, Thomas Munro, David Rowley
Discussion: https://postgr.es/m/20200301083601.ews6hz5dduc3w2se@alap3.anarazel.de
Diffstat (limited to 'src/backend/access/transam/multixact.c')
-rw-r--r-- | src/backend/access/transam/multixact.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index fdd0394ffae..70d0e1c215f 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -3058,8 +3058,8 @@ TruncateMultiXact(MultiXactId newOldestMulti, Oid newOldestMultiDB) * crash/basebackup, even though the state of the data directory would * require it. */ - Assert(!MyPgXact->delayChkpt); - MyPgXact->delayChkpt = true; + Assert(!MyProc->delayChkpt); + MyProc->delayChkpt = true; /* WAL log truncation */ WriteMTruncateXlogRec(newOldestMultiDB, @@ -3085,7 +3085,7 @@ TruncateMultiXact(MultiXactId newOldestMulti, Oid newOldestMultiDB) /* Then offsets */ PerformOffsetsTruncation(oldestMulti, newOldestMulti); - MyPgXact->delayChkpt = false; + MyProc->delayChkpt = false; END_CRIT_SECTION(); LWLockRelease(MultiXactTruncationLock); |