Re: Relation bulk write facility

From: Noah Misch <noah(at)leadboat(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Peter Smith <smithpb2250(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Subject: Re: Relation bulk write facility
Date: 2024-02-24 20:26:12
Message-ID: 20240224202612.ad@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 25, 2024 at 09:13:47AM +1300, Thomas Munro wrote:
> On Sun, Feb 25, 2024 at 9:12 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> > On Sun, Feb 25, 2024 at 8:50 AM Noah Misch <noah(at)leadboat(dot)com> wrote:
> > > On GNU/Linux x64, gcc correctly records alignment=2**12 for the associated
> > > section (.rodata for bulk_write.o zero_buffer, .bss for pg_prewarm.o
> > > blockbuffer). If I'm reading this right, neither AIX gcc nor xlc is marking
> > > the section with sufficient alignment, in bulk_write.o or pg_prewarm.o:
> >
> > Ah, that is a bit of a hazard that we should probably document.
> >
> > I guess the ideas to fix this would be: use smgrzeroextend() instead
> > of this coding, and/or perhaps look at the coding of pg_pwrite_zeros()
> > (function-local static) for any other place that needs such a thing,
> > if it would be satisfied by function-local scope?

True. Alternatively, could arrange for "#define PG_O_DIRECT 0" on AIX, which
disables the alignment assertions (and debug_io_direct).

> Erm, wait, how does that function-local static object work differently?

I don't know specifically, but I expect they're different parts of the gcc
implementation. Aligning an xcoff section may entail some xcoff-specific gcc
component. Aligning a function-local object just changes the early
instructions of the function; it's independent of the object format.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-02-24 20:44:12 Re: Psql meta-command conninfo+
Previous Message Thomas Munro 2024-02-24 20:13:47 Re: Relation bulk write facility