Re: [HACKERS] Should we cacheline align PGXACT? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] Should we cacheline align PGXACT?
Date
Msg-id 20170214125711.mxcq3q7zfyqrs4va@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] Should we cacheline align PGXACT?  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: [HACKERS] Should we cacheline align PGXACT?
List pgsql-hackers
Alexander Korotkov wrote:
> On Mon, Feb 13, 2017 at 7:07 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:

> > Re the coding of the padding computation, seems it'd be better to use
> > our standard "offsetof(last-struct-member) + sizeof(last-struct-member)"
> > rather than adding each of the members' sizes individually.
> 
> It was done so in order to evade extra level of nesting for PGXACT.  See
> discussion with Tom Lane in [1] and upthread.

Yes, I understand.  I just mean that it could be done something like
this:

#define PGXACTPadSize (PG_CACHE_LINE_SIZE - (offsetof(PGXACT, nxid) + sizeof(uint8)))

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] pg_waldump's inclusion of backend headers is a mess
Next
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] Should we cacheline align PGXACT?