pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()
Date: 2017-04-06 12:35:59
Message-ID: E1cw6dr-0008Ml-NV@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

For normal commits and aborts we already reset PgXact->xmin,
so we can simply avoid running SnapshotResetXmin() twice.

During performance tests by Alexander Korotkov, diagnosis
by Andres Freund showed PgXact array as a bottleneck. After
manual analysis by me of the code paths that touch those
memory locations, I was able to identify extraneous code
in the main transaction commit path.

Avoiding touching highly contented shmem improves concurrent
performance slightly on all workloads, confirmed by tests
run by Ashutosh Sharma and Alexander Korotkov.

Simon Riggs

Discussion: CANP8+jJdXE9b+b9F8CQT-LuxxO0PBCB-SZFfMVAdp+akqo4zfg(at)mail(dot)gmail(dot)com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6bad580d9e678a0b604883e14d8401d469b06566

Modified Files
--------------
src/backend/access/transam/xact.c | 6 +++---
src/backend/utils/time/snapmgr.c | 14 ++++++++++++--
src/include/utils/snapmgr.h | 2 +-
3 files changed, 16 insertions(+), 6 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-04-06 12:44:08 pgsql: Identity columns
Previous Message Kyotaro HORIGUCHI 2017-04-06 10:42:24 Re: [COMMITTERS] pgsql: Collect and use multi-column dependency stats