Re: [COMMITTERS] pgsql: Move each SLRU's lwlocks to a separate tranche.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Move each SLRU's lwlocks to a separate tranche.
Date: 2016-04-11 11:09:18
Message-ID: CA+TgmoZxpmV6LapSSpGLd5ftQ6KAsyqPfxEi_i6jE=OSPfy1Zw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Mon, Apr 11, 2016 at 12:01 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> InitBufferPool() manually fixes up alignment; that should probably be
>> removed now.

Attached patch does that.

>> I also wonder if it doesn't make sense to fix PG_CACHE_LINE_SIZE to
>> 64byte on x86. I personally think a manual ifdef in pg_config_manual.h
>> is ok for that.
>
> Also, this doesn't seem to be complete. This now aligns sizes to
> cacheline boundaries, but it doesn't actually align the returned values
> afaics? That might kind of work sometimes, if freeoffset is initially
> aligned to PG_CACHE_LINE_SIZE, but that's not guaranteed, it's just
> shmhdr->freeoffset += MAXALIGN(sizeof(slock_t));

And tries to fix that.

> Additionally, doesn't this obsolete
>
> /*
> * Preferred alignment for disk I/O buffers. On some CPUs, copies between
> * user space and kernel space are significantly faster if the user buffer
> * is aligned on a larger-than-MAXALIGN boundary. Ideally this should be
> * a platform-dependent value, but for now we just hard-wire it.
> */
> #define ALIGNOF_BUFFER 32

I didn't go as far as trying to remove this; a few other random things
are using it.

> and
>
> /* extra alignment for large requests, since they are probably buffers */
> if (size >= BLCKSZ)
> newStart = BUFFERALIGN(newStart);

But I got this one.

I fixed the InitBufferPool issue you mentioned in the other email, too.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
fix-alignment-stuff.patch text/x-diff 2.2 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2016-04-11 11:31:38 Re: [COMMITTERS] pgsql: Move each SLRU's lwlocks to a separate tranche.
Previous Message Fujii Masao 2016-04-11 06:53:28 pgsql: Use ereport(ERROR) instead of Assert() to emit syncrep_parser er

Browse pgsql-hackers by date

  From Date Subject
Next Message nummervet nummervet 2016-04-11 11:11:56 Re[4]: [HACKERS] Execute ignoring cursor?
Previous Message Stas Kelvich 2016-04-11 10:16:37 Re: Speedup twophase transactions