pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndQuadrant.com>
To: pgsql-committers@postgresql.org
Subject: pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()
Date: Thu, 06 Apr 2017 12:35:59 +0000
Message-ID: <E1cw6dr-0008Ml-NV@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@mail.gmail.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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (10+ messages)  latest in thread

Message-ID: <E1cw6dr-0008Ml-NV@gemulon.postgresql.org>
Permalink:  ../E1cw6dr-0008Ml-NV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cw6dr-0008Ml-NV@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: simon@2ndQuadrant.com
  Subject: Re: pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()
  In-Reply-To: <E1cw6dr-0008Ml-NV@gemulon.postgresql.org>
  References: <E1cw6dr-0008Ml-NV@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox