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 1qvT66-005NWO-Sk for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Oct 2023 01:54:14 +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 1qvT65-00FGZy-H1 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Oct 2023 01:54:13 +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 1qvT65-00FGZq-7O for pgsql-hackers@lists.postgresql.org; Wed, 25 Oct 2023 01:54:13 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qvT5x-002Yts-Pk for pgsql-hackers@lists.postgresql.org; Wed, 25 Oct 2023 01:54:12 +0000 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-357c3dc2ffbso13824215ab.2 for ; Tue, 24 Oct 2023 18:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698198843; x=1698803643; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Sj1BFT/B1srSrKTFFrSLGmE0m+ezhCINlCVoC7eldJg=; b=nIefb6nawpHz6JF4aCXmvJiy2E7/1kCbR5IOxr6kpcG8J1j3dRJ2n8xJBSb6Ox/oho zow+z57XIYoReVxJmupCGNE6+ENvgsIgirjRwv7ulu2P1dhtJhWwNV5Qeh3zQFu7HD8b 0DxctbUBhMeRWkHkeSE11nTpZ/r3t4l1NKDdeV45nfzsjbH2OlqHsZZn2Og92NgIDMN/ KQfbJu+QIu7jnNWt1lqzejUzrUIPmuz+LNslX5YIJ/aNEJjuimJu4I9ziojkfDyBpagO Jo4fOxmo/JhAMxPD7PGH4rkaQVbJc0eKLD8rVx59A4YcM1Uu0nGcXNRgtl7e44E2GZQg M7CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698198843; x=1698803643; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Sj1BFT/B1srSrKTFFrSLGmE0m+ezhCINlCVoC7eldJg=; b=oyE0WC0nYM+UNtCMdCeUxGPWIhnYbS/q9YSFcrLIUWIpKtbVVwLxvTzH6Hqt0ezDQi 81QulGrMHG/rTjhJQxqkdXiu4/qwUqoOrhZrEl3/BLbSec/NUDzSFr2L+On43BCzKjRn HZiGSgRQpYOKyxMXrD5qBQidfQc8wn9ITREHDftax6pI4juuXo/P2dqVTfcU81ouJt/g Fa+uw5GtLv4zAH2Xx86V6OQM+Czz7GYhixmn+Q5tukS0WIVl39Ife1M0L5Kb+CVExP4W 7zmMpnLZDr1cILMItQR4n1Pv7l1er2y/Ys153smPyE/poe/aUeBYkjuBaR3LlYk0lG+8 DHyQ== X-Gm-Message-State: AOJu0YyUkCCp958TIfFPjVSYOWatKx3Sk7t2PEmctXM0rOa6wofY+0k6 MoZ2BcSa39Yq8QOESfzXPFs= X-Google-Smtp-Source: AGHT+IGSRc3+EoLxppaySA3UANsiptu4fK+NG1HcQrYyOmAHIKf2uPReoTN1wqmoeKkS8lZO5tJXGA== X-Received: by 2002:a05:6e02:1cab:b0:351:4cdd:f533 with SMTP id x11-20020a056e021cab00b003514cddf533mr18173247ill.4.1698198843579; Tue, 24 Oct 2023 18:54:03 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id f10-20020a02a80a000000b0042b3dcb1106sm3236898jaj.47.2023.10.24.18.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 18:54:03 -0700 (PDT) Date: Tue, 24 Oct 2023 20:54:01 -0500 From: Nathan Bossart To: Jeff Davis Cc: Bharath Rupireddy , Andres Freund , Dilip Kumar , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org, Masahiko Sawada Subject: Re: Improve WALRead() to suck data directly from WAL buffers when possible Message-ID: <20231025015401.GB977906@nathanxps13> References: <628b07b79743e2614ab1724f516cbd41560d6551.camel@j-davis.com> <20230114203403.4zpg72fw2qb34awf@awork3.anarazel.de> <0d84c025e38673cb575dcf4987d050fe7b1e1a1f.camel@j-davis.com> <20231011224353.cl7c2s222dw3de4j@awork3.anarazel.de> <5c6e8e60c5c156a9f51ccf850f70829e45a985a1.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c6e8e60c5c156a9f51ccf850f70829e45a985a1.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 24, 2023 at 05:15:19PM -0700, Jeff Davis wrote: > * Are you sure that reducing the number of calls to memcpy() is a win? > I would expect that to be true only if the memcpy()s are tiny, but here > they are around XLOG_BLCKSZ. I believe this was done based on a comment > from Nathan Bossart, but I didn't really follow why that's important. > Also, if we try to use one memcpy for all of the data, it might not > interact well with my idea above to avoid taking the lock. I don't recall exactly why I suggested this, but if additional memcpy()s help in some way and don't negatively impact performance, then I retract my previous comment. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com