pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: hio: Release extension lock before initializing page / pinning V
Date: Sun, 02 Apr 2023 00:54:20 +0000
Message-ID: <E1pilz8-000vZ8-SP@gemulon.postgresql.org> (raw)

hio: Release extension lock before initializing page / pinning VM

PageInit() while holding the extension lock is unnecessary after 0d1fe9f74e3
started to use RBM_ZERO_AND_LOCK - nobody can look at the new page before we
release the page lock. PageInit() zeroes the page, which isn't that cheap, so
deferring it until after the extension lock is released seems like a good idea.

Doing visibilitymap_pin() while holding the extension lock, introduced in
7db0cd2145f2, looks like an accident. Due to the restrictions on
HEAP_INSERT_FROZEN it's unlikely to be a performance issue, but it still seems
better to move it out.  We also are doing the visibilitymap_pin() while
holding the buffer lock, which will be fixed in a separate commit.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: http://postgr.es/m/419312fd-9255-078c-c3e3-f0525f911d7f@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/14f98e0af996beff561f66d7436c6da5d2de524d

Modified Files
--------------
src/backend/access/heap/hio.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)



Message-ID: <E1pilz8-000vZ8-SP@gemulon.postgresql.org>
Permalink:  ../E1pilz8-000vZ8-SP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pilz8-000vZ8-SP@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: hio: Release extension lock before initializing page / pinning V
  In-Reply-To: <E1pilz8-000vZ8-SP@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