Обсуждение: [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

Поиск
Список
Период
Сортировка

[COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

От
Simon Riggs
Дата:
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(-)


Re: [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

От
Robert Haas
Дата:
On Thu, Apr 6, 2017 at 8:35 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> 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

Just like the last time you committed this, it seems to have broken
the entire buildfarm.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

От
Simon Riggs
Дата:
On 6 April 2017 at 09:11, Robert Haas <robertmhaas@gmail.com> wrote:

> Just like the last time you committed this, it seems to have broken
> the entire buildfarm.

For different reasons, AFAIU. Investigating already.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

От
Tom Lane
Дата:
Simon Riggs <simon@2ndQuadrant.com> writes:
> Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

The buildfarm doesn't like this a bit.

            regards, tom lane