Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqsoW-0007Ks-GY for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Dec 2020 07:07:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kqsoV-0007X9-F5 for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Dec 2020 07:07:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqsoV-0007X2-8R for pgsql-hackers@lists.postgresql.org; Sun, 20 Dec 2020 07:07:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqsoR-0002pN-GL for pgsql-hackers@postgresql.org; Sun, 20 Dec 2020 07:07:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0BK77O97359769; Sun, 20 Dec 2020 02:07:24 -0500 From: Tom Lane To: Thomas Munro cc: pgsql-hackers Subject: Re: pg_preadv() and pg_pwritev() In-reply-to: References: <341497.1608420857@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Sun, 20 Dec 2020 16:26:42 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <359767.1608448044.1@sss.pgh.pa.us> Date: Sun, 20 Dec 2020 02:07:24 -0500 Message-ID: <359768.1608448044@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > OK, here's a patch to zero-fill fresh WAL segments with pwritev(). > I'm drawing a blank on trivial candidate uses for preadv(), without > infrastructure from later patches. This looks OK to me. I tried it on prairiedog (has writev and pwrite but not pwritev) as well as gaur (has only writev). They seem happy. One minor thought is that in + struct iovec iov[Min(IOV_MAX, 1024)]; /* cap stack space */ it seems like pretty much every use of IOV_MAX would want some similar cap. Should we centralize that idea with, say, #define PG_IOV_MAX Min(IOV_MAX, 1024) ? Or will the plausible cap vary across uses? regards, tom lane