pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <dgrowleyml@gmail.com>
To: Nazir Bilal Yavuz <byavuz81@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Melanie Plageman <melanieplageman@gmail.com>
Subject: Re: Streaming I/O, vectored I/O (WIP)
Date: Wed, 24 Apr 2024 14:32:09 +1200
Message-ID: <CAApHDvr9Un-XpDr_+AFdOGM38O2K8SpfoHimqZ838gguTGYBiQ@mail.gmail.com> (raw)
In-Reply-To: <CAN55FZ1yGvCzCW_aufu83VimdEYHbG_zuOY3J9JL-nBptyJyKA@mail.gmail.com>
References: <CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6uT5TUm2gkvA@mail.gmail.com>
	<CAFiTN-vkrD77SH7JSS_P-07f7H-5uxB4XM_=OVHyumzqJKLqpQ@mail.gmail.com>
	<CA+hUKGLJi+c5jB3j6UvkgMYHky-qu+LPCsiNahUGSa5Z4DvyVA@mail.gmail.com>
	<56bc4ac4-9a9e-4f28-af1e-b6d537bd9a5e@iki.fi>
	<CA+hUKG+2mMiyJEDV-rNb5q__x9VJW5p8oJpGn9ZpovbyoVe1VA@mail.gmail.com>
	<289a1c0e-8444-4009-a8c2-c2d77ced6f07@iki.fi>
	<CA+hUKGJTwrS7F=uJPx3SeigMiQiW+LJaOkjGyZdCntwyMR=uAw@mail.gmail.com>
	<CAAKRu_aHAExA0psUQ6C0DpHrH_tVtjgKDFZCDjFoGdYu04iOpg@mail.gmail.com>
	<CA+hUKG+BqsqOS90Annd6hJoUFwStUrZ=R-5bJFUaoA8ZsLf-cQ@mail.gmail.com>
	<CA+hUKGJ9HgsZmnC7ABs8ZXOL-MtQCfC7Z-oQuHagm++f5O=udw@mail.gmail.com>
	<CA+hUKGLmN=NOL06XmuW9LvMPWnj87xHGvdLeiy9poP7+yOmDdw@mail.gmail.com>
	<CA+hUKGLN8D7sZUaMVf8aNcC17b3Qkncu2Xayb-qym5E3-p5goA@mail.gmail.com>
	<CA+hUKG+5UofvseJWv6YqKmuc_=rguc7VqKcNEG1eawKh3MzHXQ@mail.gmail.com>
	<98f01395-fc60-4d50-89c9-fc3011fa2a45@iki.fi>
	<CA+hUKGLncY4sqa1RwoRwY_qq+2Fd-_0X3mDKk_p15sipmXZOng@mail.gmail.com>
	<d1eb996b-423a-4bcd-bce4-75f5daa12ffa@iki.fi>
	<CA+hUKGLDqKhxOODYD2C0Q5YGM697hWMksMoSN-SsUMRGgcH2+A@mail.gmail.com>
	<CA+hUKGJUFkkOkdVq0hug3h1NXVJ0CSA3XTk8XLP2J0y9353ZGw@mail.gmail.com>
	<CAN55FZ3EGSQ8nGFf6nYyD1gMY7GWD3-weP7aQjmF6RuHmpV6eg@mail.gmail.com>
	<CAN55FZ1k1oQVF++UFGruKqna_hw8bTNPkbx6DVpANqs1=1qLqg@mail.gmail.com>
	<CAN55FZ1yGvCzCW_aufu83VimdEYHbG_zuOY3J9JL-nBptyJyKA@mail.gmail.com>

I've attached a patch with a few typo fixes and what looks like an
incorrect type for max_ios. It's an int16 and I think it needs to be
an int. Doing "max_ios = Min(max_ios, PG_INT16_MAX);" doesn't do
anything when max_ios is int16.

David

Attachments:

read_stream_fixes.patch (text/plain, 1.6K) download diff --git a/src/backend/storage/aio/read_stream.c b/src/backend/storage/aio/read_stream.c index 634cf4f0d1..74b9bae631 100644 --- a/src/backend/storage/aio/read_stream.c +++ b/src/backend/storage/aio/read_stream.c @@ -26,12 +26,12 @@ * * B) I/O is necessary, but fadvise is undesirable because the access is * sequential, or impossible because direct I/O is enabled or the system - * doesn't support advice. There is no benefit in looking ahead more than - * io_combine_limit, because in this case only goal is larger read system + * doesn't support fadvise. There is no benefit in looking ahead more than + * io_combine_limit, because in this case the only goal is larger read system * calls. Looking further ahead would pin many buffers and perform * speculative work looking ahead for no benefit. * - * C) I/O is necesssary, it appears random, and this system supports fadvise. + * C) I/O is necessary, it appears random, and this system supports fadvise. * We'll look further ahead in order to reach the configured level of I/O * concurrency. * @@ -418,7 +418,7 @@ read_stream_begin_relation(int flags, ReadStream *stream; size_t size; int16 queue_size; - int16 max_ios; + int max_ios; int strategy_pin_limit; uint32 max_pinned_buffers; Oid tablespace_id; @@ -447,6 +447,8 @@ read_stream_begin_relation(int flags, max_ios = get_tablespace_maintenance_io_concurrency(tablespace_id); else max_ios = get_tablespace_io_concurrency(tablespace_id); + + /* Cap to INT16_MAX to avoid overflowing below */ max_ios = Min(max_ios, PG_INT16_MAX); /*

view thread (67+ messages)  latest in thread

Message-ID: <CAApHDvr9Un-XpDr_+AFdOGM38O2K8SpfoHimqZ838gguTGYBiQ@mail.gmail.com>
Permalink:  ../CAApHDvr9Un-XpDr_+AFdOGM38O2K8SpfoHimqZ838gguTGYBiQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CAApHDvr9Un-XpDr_+AFdOGM38O2K8SpfoHimqZ838gguTGYBiQ@mail.gmail.com

 ·  · 

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: dgrowleyml@gmail.com, byavuz81@gmail.com, thomas.munro@gmail.com, hlinnaka@iki.fi, dilipbalaut@gmail.com, robertmhaas@gmail.com, andres@anarazel.de, melanieplageman@gmail.com
  Subject: Re: Streaming I/O, vectored I/O (WIP)
  In-Reply-To: <CAApHDvr9Un-XpDr_+AFdOGM38O2K8SpfoHimqZ838gguTGYBiQ@mail.gmail.com>

* 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