public inbox for [email protected]  
help / color / mirror / Atom feed
From: Noah Misch <[email protected]>
To: Heikki Linnakangas <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: vignesh C <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Melanie Plageman <[email protected]>
Subject: Re: Relation bulk write facility
Date: Sun, 25 Feb 2024 11:43:22 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+hUKGKtVazR0yEDxOrZYAmeaVbvQxNXSb6K8BDYOtuRVnCMDQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+hUKGLAr9Rki58cNCdv_ivR5=Uyps5v-e-bEhHUK3gJTT7wtQ@mail.gmail.com>
	<CA+hUKGLuG2s4-+4DH+JDJh0CiSGU8SbGfK1ZXYWkMQS7iHdGxw@mail.gmail.com>
	<[email protected]>

On Sun, Feb 25, 2024 at 04:34:47PM +0200, Heikki Linnakangas wrote:
> I agree with Andres though, that unless someone raises their hand and
> volunteers to properly maintain the AIX support, we should drop it.

There's no way forward in which AIX support stops doing net harm.  Even if AIX
enthusiasts intercepted would-be buildfarm failures and fixed them before
buildfarm.postgresql.org could see them, the damage from the broader community
seeing the AIX-specific code would outweigh the benefits of AIX support.  I've
now disabled the animals for v17+, though each may do one more run before
picking up the disable.

My upthread observation about xcoff section alignment was a red herring.  gcc
populates symbol-level alignment, and section-level alignment is unnecessary
if symbol-level alignment is correct.  The simplest workaround for $SUBJECT
AIX failure would be to remove the "const", based on the results of the
attached test program.  The pg_prewarm.c var is like al4096_static in the
outputs below, hence the lack of trouble there.  The bulk_write.c var is like
al4096_static_const_initialized.

==== gcc 8.3.0
al4096                           4096 @ 0x11000c000 (mod 0)
al4096_initialized               4096 @ 0x110000fd0 (mod 4048 - BUG)
al4096_const                     4096 @ 0x11000f000 (mod 0)
al4096_const_initialized         4096 @ 0x10000cd00 (mod 3328 - BUG)
al4096_static                    4096 @ 0x110005000 (mod 0)
al4096_static_initialized        4096 @ 0x110008000 (mod 0)
al4096_static_const              4096 @ 0x100000c10 (mod 3088 - BUG)
al4096_static_const_initialized  4096 @ 0x100003c10 (mod 3088 - BUG)
==== xlc 12.01.0000.0000
al4096                           4096 @ 0x110008000 (mod 0)
al4096_initialized               4096 @ 0x110004000 (mod 0)
al4096_const                     4096 @ 0x11000b000 (mod 0)
al4096_const_initialized         4096 @ 0x100007000 (mod 0)
al4096_static                    4096 @ 0x11000e000 (mod 0)
al4096_static_initialized        4096 @ 0x110001000 (mod 0)
al4096_static_const              4096 @ 0x110011000 (mod 0)
al4096_static_const_initialized  4096 @ 0x1000007d0 (mod 2000 - BUG)
==== ibm-clang 17.1.1.2
al4096                           4096 @ 0x110001000 (mod 0)
al4096_initialized               4096 @ 0x110004000 (mod 0)
al4096_const                     4096 @ 0x100001000 (mod 0)
al4096_const_initialized         4096 @ 0x100005000 (mod 0)
al4096_static                    4096 @ 0x110008000 (mod 0)
al4096_static_initialized        4096 @ 0x11000b000 (mod 0)
al4096_static_const              4096 @ 0x100009000 (mod 0)
al4096_static_const_initialized  4096 @ 0x10000d000 (mod 0)

#include <stdio.h>
#include <stdint.h>

/* add a byte so the compiler has to go out of its way to achieve alignment for
   consecutive instances */
typedef union PGIOAlignedBlock
{
	__attribute__((aligned(4096)))
	char		data[1 + 8192];
	double		force_align_d;
	uint64_t	force_align_i64;
} PGIOAlignedBlock;

char		pad;

/* with and without each of: static, const, initializer */
PGIOAlignedBlock al4096;
PGIOAlignedBlock al4096_initialized = {{0}};
const PGIOAlignedBlock al4096_const;
const PGIOAlignedBlock al4096_const_initialized = {{0}};
static PGIOAlignedBlock al4096_static;
static PGIOAlignedBlock al4096_static_initialized = {{0}};
static const PGIOAlignedBlock al4096_static_const;
static const PGIOAlignedBlock al4096_static_const_initialized = {{0}};

/* in case last position is special */
static const PGIOAlignedBlock last;
static const PGIOAlignedBlock last_initialized = {{0}};

#define DUMP(want_align, var) dump_internal(#var, (want_align), &(var))

static void
dump_internal(const char *ident, unsigned want_align, const void *addr)
{
	unsigned	mod = (uintptr_t) addr % want_align;

	printf("%-32s %4u @ 0x%p (mod %u%s)\n", ident, want_align, addr,
		   mod, mod ? " - BUG" : "");
}

int
main(int argc, char **argv)
{
	DUMP(4096, al4096);
	DUMP(4096, al4096_initialized);
	DUMP(4096, al4096_const);
	DUMP(4096, al4096_const_initialized);
	DUMP(4096, al4096_static);
	DUMP(4096, al4096_static_initialized);
	DUMP(4096, al4096_static_const);
	DUMP(4096, al4096_static_const_initialized);
	return 0;
}


Attachments:

  [text/plain] align.c (1.5K, ../[email protected]/2-align.c)
  download | inline:
#include <stdio.h>
#include <stdint.h>

/* add a byte so the compiler has to go out of its way to achieve alignment for
   consecutive instances */
typedef union PGIOAlignedBlock
{
	__attribute__((aligned(4096)))
	char		data[1 + 8192];
	double		force_align_d;
	uint64_t	force_align_i64;
} PGIOAlignedBlock;

char		pad;

/* with and without each of: static, const, initializer */
PGIOAlignedBlock al4096;
PGIOAlignedBlock al4096_initialized = {{0}};
const PGIOAlignedBlock al4096_const;
const PGIOAlignedBlock al4096_const_initialized = {{0}};
static PGIOAlignedBlock al4096_static;
static PGIOAlignedBlock al4096_static_initialized = {{0}};
static const PGIOAlignedBlock al4096_static_const;
static const PGIOAlignedBlock al4096_static_const_initialized = {{0}};

/* in case last position is special */
static const PGIOAlignedBlock last;
static const PGIOAlignedBlock last_initialized = {{0}};

#define DUMP(want_align, var) dump_internal(#var, (want_align), &(var))

static void
dump_internal(const char *ident, unsigned want_align, const void *addr)
{
	unsigned	mod = (uintptr_t) addr % want_align;

	printf("%-32s %4u @ 0x%p (mod %u%s)\n", ident, want_align, addr,
		   mod, mod ? " - BUG" : "");
}

int
main(int argc, char **argv)
{
	DUMP(4096, al4096);
	DUMP(4096, al4096_initialized);
	DUMP(4096, al4096_const);
	DUMP(4096, al4096_const_initialized);
	DUMP(4096, al4096_static);
	DUMP(4096, al4096_static_initialized);
	DUMP(4096, al4096_static_const);
	DUMP(4096, al4096_static_const_initialized);
	return 0;
}

view thread (34+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Relation bulk write facility
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox