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 1tsgBd-004Vzy-Ae for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 10:53:13 +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 1tsgBa-00AV6m-8c for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 10:53:10 +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 1tsgBZ-00AV6d-TV for pgsql-hackers@lists.postgresql.org; Thu, 13 Mar 2025 10:53:09 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tsgBW-002dR1-0W for pgsql-hackers@postgresql.org; Thu, 13 Mar 2025 10:53:09 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3914aba1ce4so630823f8f.2 for ; Thu, 13 Mar 2025 03:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1741863185; x=1742467985; darn=postgresql.org; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=dGt5yejT6I8M9ZLRPuSnG94JIcTro0JSvnWjGEVom7A=; b=ngxBnQ3Bd9xCCK1AfcaYpEsoUWmg9k0IkRyh1eQ5NQqMB/qx8S8KMkFlE0CZTvurt2 u3DzbIjzmCH+UZdcG+yg+s2W4bBNTXT5FLJtTjT7Q8RcO4e+M6qQudyENKmLAyW93OoQ CiaijSf/j+g+NYvYdVUngJX/1yc1whzeRFUNbIpUoDioKiY0pWxpTPhOewKmJ/A/3Km6 Vscy0K4rCaEDJtgQYGirh2dher4oOteYgeqeN1tqsZWe7g1a28RSq7fAhIdLxFmRN3pt GsuPyNzxHQ/obPzHvAlQq5OBMYFB2B/zx8EJH/w/HeHZA6OgBXqLEFol8F+Y/fp6aWAC jU3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741863185; x=1742467985; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dGt5yejT6I8M9ZLRPuSnG94JIcTro0JSvnWjGEVom7A=; b=f7pMuza4aK2SaevmIyE8pLUqo5VkwZfqF9lHpF99Nu9bYjKBlxbm4usRfKoAO9cYx5 cmSey7ZrYeyPUNkm6bvW5tZUP1tnN82CjMGHJqk20B+b6USLov1QBM7KN19qamgQsBzw sHaVyDjiXmTbBjRKrAl5i7dD75EhKPJQvJtJIQ2v2pjHy+BMwpTxi27Vd4O2msXekl6A 6nnhxGhDZmQesTt+V7u/COh8RoAByS/psWyA+8fTAPzOrYD5bPkRnBwBCibQ32Cv2Qqf 1pLmUePMSUuMlgPk/my67+LbRbp+VJdVPjPzizx+UgIsFQKqINbKvwB48RZQWLcvLBIB lJIw== X-Forwarded-Encrypted: i=1; AJvYcCVQEOI52y1sSfxyps+Iee7jaJTaH9pfaeL5jL6U8OH/YgcEWPyPiIJwX50Y4VF/ASDxoMh7CkSSJnNbjpnR@postgresql.org X-Gm-Message-State: AOJu0YzFlpFe2UxCkMCL7VGrMKIu2i9zA3fJHZl4y8yogwvTAmiYrlgj IY1c+FYY2Nqz+AuiiGVUgsqwte4QdFyCHP5UuRp3XXOTEOVbDtLZ3ETDQ6sT+3M= X-Gm-Gg: ASbGncvjBbuW5SeNLWnLRYlr9oVATimg6fUaYWrEXa6uBpu9RPoClXuH9TUpjjYU8F/ xQoSw8F3/sDBpX3f4GVobQLVFejdpl+xfQG2jywOETvA6yu/32bngPh7x9zv6EeyWlCCbnXklUo d/BwgnPj9llFrI8JbANMJl8AnUgoyxf0mYnXt1czb5eDcuhsqg0zWzZVEhQ1xDchK7/h14Ob10r TjV3FQLxIouYrIHsFoZ2H+kYiNUpWg7c5K6t1u7WARaD6OuwIi5qM9LMwrLGPMOgBT2q/F/AZzQ JqoRX2P386Z0UJnhq3pNKYjNX7YufCNTA5v0DCO7h0RxBZBsF36XK0oA X-Google-Smtp-Source: AGHT+IGpY9LusLjipZriJUFw5yWCLliLI2ClisGHeyhe00Y3H+jn2MtYu3P9SESpcWF6Y98sP2r5AQ== X-Received: by 2002:a05:6000:400b:b0:38d:e584:81ea with SMTP id ffacd0b85a97d-39132db8e9amr20565097f8f.45.1741863185231; Thu, 13 Mar 2025 03:53:05 -0700 (PDT) Received: from localhost (109-81-174-36.rct.o2.cz. [109.81.174.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395c83b6a27sm1749296f8f.31.2025.03.13.03.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 03:53:04 -0700 (PDT) From: Antonin Houska To: Andres Freund cc: Noah Misch , pgsql-hackers@postgresql.org, Thomas Munro , Heikki Linnakangas , Robert Haas , Jakub Wartak , Jelte Fennema-Nio Subject: Re: AIO v2.5 In-reply-to: <4b3f32ug3cayekysqlgspz2qjmeb7lca3gvazayglxr2m3d4dv@il33accgsji7> References: <20250311194108.c5.nmisch@google.com> <5dzyoduxlvfg55oqtjyjehez5uoq6hnwgzor4kkybkfdgkj7ag@rbi4gsmzaczk> <20250312035743.f5.nmisch@google.com> <4b3f32ug3cayekysqlgspz2qjmeb7lca3gvazayglxr2m3d4dv@il33accgsji7> Comments: In-reply-to Andres Freund message dated "Wed, 12 Mar 2025 19:23:47 -0400." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Thu, 13 Mar 2025 11:53:03 +0100 Message-ID: <17906.1741863183@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Andres Freund wrote: > Attached is v2.7, with the following changes: Attached are a few proposals for minor comment fixes. Besides that, it occurred to me when I was trying to get familiar with the patch set (respectable work, btw) that an additional Assert() statement could make sense: diff --git a/src/backend/storage/aio/aio.c b/src/backend/storage/aio/aio.c index a9c351eb0dc..325688f0f23 100644 --- a/src/backend/storage/aio/aio.c +++ b/src/backend/storage/aio/aio.c @@ -413,6 +413,7 @@ pgaio_io_stage(PgAioHandle *ioh, PgAioOp op) bool needs_synchronous; Assert(ioh->state == PGAIO_HS_HANDED_OUT); + Assert(pgaio_my_backend->handed_out_io == ioh); Assert(pgaio_io_has_target(ioh)); ioh->op = op; -- Antonin Houska Web: https://www.cybertec-postgresql.com --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=aio_comments.diff diff --git a/src/backend/storage/aio/aio_io.c b/src/backend/storage/aio/aio_io.c index 89376ff4040..7879e556263 100644 --- a/src/backend/storage/aio/aio_io.c +++ b/src/backend/storage/aio/aio_io.c @@ -107,7 +107,7 @@ pgaio_io_prep_writev(PgAioHandle *ioh, /* * Execute IO operation synchronously. This is implemented here, not in - * method_sync.c, because other IO methods lso might use it / fall back to it. + * method_sync.c, because other IO methods also might use it / fall back to it. */ void pgaio_io_perform_synchronously(PgAioHandle *ioh) diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 9483596e63a..df9357c78c0 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -7329,7 +7329,7 @@ local_buffer_writev_stage(PgAioHandle *ioh, uint8 cb_data) } -/* readv callback is is passed READ_BUFFERS_* flags as callback data */ +/* readv callback is passed READ_BUFFERS_* flags as callback data */ const PgAioHandleCallbacks aio_shared_buffer_readv_cb = { .stage = shared_buffer_readv_stage, .complete_shared = shared_buffer_readv_complete, diff --git a/src/include/storage/aio_internal.h b/src/include/storage/aio_internal.h index ca6cbde11a6..cf4eb102adc 100644 --- a/src/include/storage/aio_internal.h +++ b/src/include/storage/aio_internal.h @@ -205,9 +205,9 @@ typedef struct PgAioBackend dclist_head idle_ios; /* - * Only one IO may be returned by pgaio_io_acquire()/pgaio_io_acquire() + * Only one IO may be returned by pgaio_io_acquire()/pgaio_io_acquire_nb() * without having been either defined (by actually associating it with IO) - * or by released (with pgaio_io_release()). This restriction is necessary + * or released (with pgaio_io_release()). This restriction is necessary * to guarantee that we always can acquire an IO. ->handed_out_io is used * to enforce that rule. */ --=-=-=--