agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Antonin Houska <ah@cybertec.at>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Noah Misch <noah@leadboat.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Subject: Re: AIO writes vs hint bits vs checksums
Date: Wed, 25 Sep 2024 10:12:27 +0200
Message-ID: <2739.1727251947@antos> (raw)
In-Reply-To: <2305.1727247975@antos>
References: <stj36ea6yyhoxtqkhpieia2z4krnam7qyetc57rfezgk4zgapf@gcnactj4z56m>
<2305.1727247975@antos>
Antonin Houska <ah@cybertec.at> wrote:
> Andres Freund <andres@anarazel.de> wrote:
>
> > What I'd instead like to propose is to implement the right to set hint bits as
> > a bit in each buffer's state, similar to BM_IO_IN_PROGRESS. Tentatively I
> > named this BM_SETTING_HINTS. It's only allowed to set BM_SETTING_HINTS when
> > BM_IO_IN_PROGRESS isn't already set and StartBufferIO has to wait for
> > BM_SETTING_HINTS to be unset to start IO.
> >
> > Naively implementing this, by acquiring and releasing the permission to set
> > hint bits in SetHintBits() unfortunately leads to a significant performance
> > regression. While the performance is unaffected for OLTPish workloads like
> > pgbench (both read and write), sequential scans of unhinted tables regress
> > significantly, due to the per-tuple lock acquisition this would imply.
>
> An alternative approach: introduce a flag that tells that the checksum is
> being computed, and disallow setting hint bits when that flag is set. As long
> as the checksum computation takes take much less time than the IO, fewer hint
> bit updates should be rejected.
Well, the checksum actually should not be computed during the IO, so the IO
would still disallow hint bit updates :-(
--
Antonin Houska
Web: https://www.cybertec-postgresql.com
view thread (24+ messages) latest in thread
Message-ID: <2739.1727251947@antos>
Permalink: ../2739.1727251947@antos/
Also on: postgresql.org/message-id/2739.1727251947@antos
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-hackers@postgresql.org
Cc: ah@cybertec.at, andres@anarazel.de, noah@leadboat.com, hlinnaka@iki.fi, robertmhaas@gmail.com, thomas.munro@gmail.com
Subject: Re: AIO writes vs hint bits vs checksums
In-Reply-To: <2739.1727251947@antos>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox