pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Outdated description of PG_CACHE_LINE_SIZE
Date: Sat, 1 Jul 2023 15:49:36 +0800
Message-ID: <20230701074936.p3qcssl4t7murt2q@jrouhaud> (raw)

Hi,

I just noticed that the comment for PG_CACHE_LINE_SIZE still says that "it's
currently used in xlog.c", which hasn't been true for quite some time.

PFA a naive patch to make the description more generic.

Attachments:

v1-0001-Fix-PG_CACHE_LINE_SIZE-description.patch (text/x-patch, 1.7K) download From a554ee9ca3558c1cc67b2f4024c13b26aacff3c9 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud <julien.rouhaud@free.fr> Date: Sat, 1 Jul 2023 15:41:54 +0800 Subject: [PATCH v1] Fix PG_CACHE_LINE_SIZE description. PG_CACHE_LINE_SIZE was originally only used in xlog.c, but this hasn't been true for a very long time and is now wildly used, so modify its description to not mention any explicit source code file. Author: Julien Rouhaud Reviewed-by: FIXME Discussion: FIXME --- src/include/pg_config_manual.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index a1a93ad706..01fe2af499 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -218,12 +218,11 @@ /* * Assumed cache line size. This doesn't affect correctness, but can be used - * for low-level optimizations. Currently, this is used to pad some data - * structures in xlog.c, to ensure that highly-contended fields are on - * different cache lines. Too small a value can hurt performance due to false - * sharing, while the only downside of too large a value is a few bytes of - * wasted memory. The default is 128, which should be large enough for all - * supported platforms. + * for low-level optimizations. This is mostly used to pad various data + * structures, to ensure that highly-contended fields are on different cache + * lines. Too small a value can hurt performance due to false sharing, while + * the only downside of too large a value is a few bytes of wasted memory. The + * default is 128, which should be large enough for all supported platforms. */ #define PG_CACHE_LINE_SIZE 128 -- 2.37.0

view thread (3+ messages)  latest in thread

Message-ID: <20230701074936.p3qcssl4t7murt2q@jrouhaud>
Permalink:  ../20230701074936.p3qcssl4t7murt2q@jrouhaud/
Also on:    postgresql.org/message-id/20230701074936.p3qcssl4t7murt2q@jrouhaud

 ·  · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: rjuju123@gmail.com
  Subject: Re: Outdated description of PG_CACHE_LINE_SIZE
  In-Reply-To: <20230701074936.p3qcssl4t7murt2q@jrouhaud>
  References: <20230701074936.p3qcssl4t7murt2q@jrouhaud>

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

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