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: bufmgr/smgr: Don't cross segment boundaries in StartReadBuffers(
Date: Tue, 08 Oct 2024 16:57:17 +0000
Message-ID: <E1syDWP-002jSB-T2@gemulon.postgresql.org> (raw)

bufmgr/smgr: Don't cross segment boundaries in StartReadBuffers()

With real AIO it doesn't make sense to cross segment boundaries with one
IO. Add smgrmaxcombine() to allow upper layers to query which buffers can be
merged.

We could continue to cross segment boundaries when not using AIO, but it
doesn't really make sense, because md.c will never be able to perform the read
across the segment boundary in one system call. Which means we'll mark more
buffers as undergoing IO than really makes sense - if another backend desires
to read the same blocks, it'll be blocked longer than necessary. So it seems
better to just never cross the boundary.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/1f6b50a7-38ef-4d87-8246-786d39f46ab9@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/755a4c10d19dbe432a1860cced914c570ff3becc

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 18 ++++++++++++++++++
src/backend/storage/smgr/md.c       | 21 +++++++++++++++++++++
src/backend/storage/smgr/smgr.c     | 22 ++++++++++++++++++++++
src/include/storage/md.h            |  2 ++
src/include/storage/smgr.h          |  2 ++
5 files changed, 65 insertions(+)



Message-ID: <E1syDWP-002jSB-T2@gemulon.postgresql.org>
Permalink:  ../E1syDWP-002jSB-T2@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1syDWP-002jSB-T2@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: bufmgr/smgr: Don't cross segment boundaries in StartReadBuffers(
  In-Reply-To: <E1syDWP-002jSB-T2@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