Re: pg_verify_checksums and -fno-strict-aliasing
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>,
Michael Banck <michael.banck@credativ.de>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-08-31T23:59:58Z
Lists: pgsql-hackers
Michael Paquier <michael@paquier.xyz> 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
Commits
-
Avoid using potentially-under-aligned page buffers.
- 44cac9346479 12.0 landed
- 5af055ed7446 9.3.25 landed
- f5c93cf92223 11.0 landed
- 826980424538 9.6.11 landed
- 10b9af3ebbed 10.6 landed
- 083d9ced14e4 9.4.20 landed
- 03ffe5553c1d 9.5.15 landed
-
Code review for pg_verify_checksums.c.
- d787af7badfe 11.0 landed
- d9c366f9e801 12.0 landed
-
Make checksum_impl.h safe to compile with -fstrict-aliasing.
- db87d3b5253f 9.3.25 landed
- 20f9cd55dd53 9.4.20 landed
- 853af991e35a 9.5.15 landed
- d6ef17ed7bba 9.6.11 landed
- c2dfbd18ce25 10.6 landed
- 9daff2fe69dc 11.0 landed
- 8c62d9d16f01 12.0 landed