Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvtKq-0005JP-3d for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Sep 2018 00:00:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fvtKn-000178-U1 for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Sep 2018 00:00:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvtKn-00016y-NE for pgsql-hackers@lists.postgresql.org; Sat, 01 Sep 2018 00:00:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvtKk-0004sy-Br for pgsql-hackers@postgresql.org; Sat, 01 Sep 2018 00:00:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7VNxwRT015259; Fri, 31 Aug 2018 19:59:58 -0400 From: Tom Lane To: Michael Paquier cc: Fabien COELHO , Michael Banck , pgsql-hackers Subject: Re: pg_verify_checksums and -fno-strict-aliasing In-reply-to: <20180831222119.GD5305@paquier.xyz> References: <1535618100.1286.3.camel@credativ.de> <7321.1535639966@sss.pgh.pa.us> <20180830175652.GC15446@paquier.xyz> <12123.1535672257@sss.pgh.pa.us> <20180831000600.GI15446@paquier.xyz> <28226.1535727306@sss.pgh.pa.us> <21037.1535745351@sss.pgh.pa.us> <20180831222119.GD5305@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Fri, 31 Aug 2018 15:21:19 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15257.1535759998.1@sss.pgh.pa.us> Date: Fri, 31 Aug 2018 19:59:58 -0400 Message-ID: <15258.1535759998@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Fri, Aug 31, 2018 at 03:55:51PM -0400, Tom Lane wrote: >> I also fixed a few places that were using the palloc solution, and >> one that was actually doing hand-alignment of the pointer (ugh). >> I didn't try to be thorough about getting rid of such pallocs, >> just fix places that seemed likely to be performance-critical. > Okay, for the memo replay_image_masked and master_image_masked > in xlog.c could make use of the new structure. SetWALSegSize in > pg_standby.c and WriteEmptyXLOG in pg_resetwal.c, and pg_upgrade's > file.c could also be patched. I intentionally didn't change replay_image_masked/master_image_masked to use statically-allocated buffers. Since, AFAICS, those aren't needed in most backend processes, they'd just be eating 16KB of per-process data space to no purpose. The others you mention could be changed, probably, but I didn't bother as they didn't seem performance-critical. >> +typedef union PGAlignedBuffer > One complain I have is about the name of those structures. Perhaps > PGAlignedBlock and PGAlignedXlogBlock make more sense? Don't have a strong preference, anybody else have an opinion? (I also wondered whether to use "WAL" instead of "XLog" in that struct name, but it seems like we've mostly stuck with "xlog" in internal C names.) regards, tom lane