Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vIBRv-00GO14-Hz for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Nov 2025 19:51:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vIBRs-0097i1-3d for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Nov 2025 19:51:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vIBRr-0097hp-Ls for pgsql-hackers@lists.postgresql.org; Sun, 09 Nov 2025 19:51:39 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIBRo-006r5j-20 for pgsql-hackers@postgresql.org; Sun, 09 Nov 2025 19:51:38 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-47117f92e32so20350935e9.1 for ; Sun, 09 Nov 2025 11:51:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20230601.gappssmtp.com; s=20230601; t=1762717895; x=1763322695; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0oF0hIuHjur9e5thQTki5Ivc1UjK5N+87NMppT56X/A=; b=IHw1AjAIEnEBMKdMtJPfBMCMEX7/a4LYQWWuggSPsKWSI3NSNnUgr1JRnGnXKX9Qod kpjsB3b04w7aS8hdgHYgiAUELRs1hfm4KCWX8zpgHMhYk2pZuW8e5bypdBHEopVR0mAh dVBGI7FFgkM8KZKc61biPOLx4hkkCQalD0ULPZ108nQx/ASCZphu4VX3gUuwdU719txC YKXNjA155rNr7OsDpGx+nzCr+/qxDspU4J8D5vUCPJ9H13hx8l7an6SLkMYMEqV3xnfw WuhmCBxKkxRegZ7ej+ltaycVaEyhHYCKGRu4OIU7ycLvvBuVvSt3pooNSlAgsgF6Ilax ofKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762717895; x=1763322695; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0oF0hIuHjur9e5thQTki5Ivc1UjK5N+87NMppT56X/A=; b=gDcQwsmnbkum4n1zf3gSeUTqrLjFfCCxrHxy7Wvb2P6k3FWOtORcovWv5f/nP0n4K8 4xSKtFNj5n2qC+45G20m3ZeZqbvlNqvBwn8ZV+El7noB9lBwLlgRuI3/x0vIVy9iHJGq 4wEoABBq/pZ89eyxJ5COi45oov/zCFpTJ7BFfJ5aSZ63bNXfJ/cbIJWNRRE0Hgbu/IZM 34JuqDaFIqJtgKAGot0EM2VVYwhHjQ+RsKPwI6a2EcgwU7IDw6tNysgVd1h/Dcwz94V/ uBaZU9QrnE9mcLrD0nWJmUXU0sjbuGyWRm0yGg4G1cwOUH8bTHj6ECWbomAJu/mn2I4u mQLQ== X-Gm-Message-State: AOJu0YyWJzYcOtUwG3iDMCoZ2FTDfr4VKU7Bh1l3qLzkE/Cya6lnSuUw kp9nLp2DIDKHwcAgOi2wPfmhj6m5G7058juikWeCR9ExUNv5A8HLpBL5Uzqko2KVSISVrPKCSn3 aB+kHFLgHLC+iCxMIScp5ujdKdZuDgtGbhRvrvLCIjg== X-Gm-Gg: ASbGnctZl9c38qm7klGS2K5EG+Sw5h7Fj26p7rSU4LjKXmKBARmXYQJo0KAjMUlVXyx 9DKeOp4hCDQcuizQaaYJ3swgtcDmicYki0sRUR3ku2LPLrJm8cIRwoJIHFGWZZf9ufdWVftqwn7 eCUTwqabUCR11dWPQwpofxwe6FwlX/IDAlgBL1O8i3cS3eoVOtBRbQvg1FonQMudHo/5FQqF5Ii 4g85BVPDiYF9yXfBeB3MBPDNbjfAoWDV8r+F5c+9nSqQq/ALaKqekdGi7ps X-Google-Smtp-Source: AGHT+IHyoC639xFQoi0CnZqEVytNaS/V8OJTb5phC99FyrvPkQn8eEa8vPZfhjtU0v1sjVhUOJSccSYW6B+id2BFefs= X-Received: by 2002:a05:6000:2903:b0:426:ee84:259e with SMTP id ffacd0b85a97d-42b2dc023fdmr4285805f8f.24.1762717894703; Sun, 09 Nov 2025 11:51:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Geoghegan Date: Sun, 9 Nov 2025 14:51:08 -0500 X-Gm-Features: AWmQ_bnIl7gJ4e7RKFXkBsJNBJiGdMofNFNB-N3sV5fFu2mrDLf0kNjlvZeguR4 Message-ID: Subject: Re: Don't synchronously wait for already-in-progress IO in read stream To: Andres Freund Cc: pgsql-hackers@postgresql.org, Tomas Vondra , Thomas Munro Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 11, 2025 at 5:46=E2=80=AFPM Andres Freund = wrote: > The problem leading to that is that we are currently synchronously waitin= g for > IO on a buffer when AsyncReadBuffers() encounters a buffer already underg= oing > IO. If a block is read twice, that means we won't actually have enough IO= s in > flight to have good performance. What's worse, currently the wait is not > attributed to IO wait (since we're waiting in WaitIO, rather than waiting= for > IO). This patch no longer cleanly applies. Can you post a new version? Thanks --=20 Peter Geoghegan