public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ashutosh Bapat <[email protected]>
To: Heikki Linnakangas <[email protected]>
Cc: Matthias van de Meent <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: [email protected]
Subject: Re: Better shared data structure management and resizable shared data structures
Date: Sun, 5 Apr 2026 19:38:09 +0530
Message-ID: <CAExHW5sYaeZqzjUrG2V9U5ZFnZHW+X-Q2Zb9L62CRbeuAwC4EA@mail.gmail.com> (raw)
In-Reply-To: <CAExHW5twYLhVjtApX3osdaz-4b0Tjvjj_Zr20orUb61qgiJmUw@mail.gmail.com>
References: <CAExHW5vM1bneLYfg0wGeAa=52UiJ3z4vKd3AJ72X8Fw6k3KKrg@mail.gmail.com>
	<[email protected]>
	<CA+TgmoauqYXm8iA3FGRAVKxYShUxWBiS_MSLmQpTrmO7wNHamw@mail.gmail.com>
	<[email protected]>
	<CAExHW5uTNWOSxJDWQAUnS0tZawob2_J3dRAtc67NHNZ98X4_xA@mail.gmail.com>
	<CAExHW5t439y61YD9bc7d5wZWHp6J=M43Qu3eEZOBPguZML7o2A@mail.gmail.com>
	<CAExHW5v5FVZbsO9sLzztMZ11C3hgGStE=HkkV2bQkCyncess4w@mail.gmail.com>
	<[email protected]>
	<CAExHW5tCC0T1ky=Jnq-AvMxa67Adaw7aQ4iQAO=BSdHcbSNBVg@mail.gmail.com>
	<[email protected]>
	<CAExHW5tS7GncN90oJWOSzW_3F1EHL9xwe59L7Req3nUVgmObUw@mail.gmail.com>
	<[email protected]>
	<CAEze2WhMOHVgH2Xeyzx=VEk-Ta_YnQUqT+TdBiv5Lx8ESn2WZA@mail.gmail.com>
	<CAExHW5s6h=c_q2m72Nvyj1ghMEhPkOBkeN5Htn7YR=1BrNN-Sw@mail.gmail.com>
	<[email protected]>
	<CAEze2WjQZff3znd6CtG-OBzYZMMqy5TyQSoAo=QTFT38tDndeQ@mail.gmail.com>
	<[email protected]>
	<CAExHW5twYLhVjtApX3osdaz-4b0Tjvjj_Zr20orUb61qgiJmUw@mail.gmail.com>

On Sun, Apr 5, 2026 at 11:18 AM Ashutosh Bapat
<[email protected]> wrote:
>
>
> I will post my resizable shmem structures patch in a separate email in
> this thread but continue to review your patches.

I reviewed the SLRU patch. This is the first time I am looking at SLRU
code, so my review may not be sufficient. As far as I understand, the
patch faithfully copies the functionality from the old system to the
new system. I didn't find any issues there.

I think calls to SimpleLruRequest() reads much better than SimpleLruInit().

Both MultiXactShmemInit and MultiXactShmemAttach set
OldestMemberMXactId, OldestVisibleMXactId. In future if we add another
global variable to point to the shared memory, somebody needs to
remember to initialize it in both these functions. Maybe deduplicate
it with something like attached? Similarly for PredicateLock related
changes.

shmem_slru_init and shmem_slru_attach() also have the following
duplicate lines, which can be deduplicated in a similar fashion.
desc->shared = shared;
desc->nbanks = nbanks;
memcpy(&desc->options, options, sizeof(SlruOpts));

Including "access/slru.h" in shmem.h is circular inclusion. I am
wondering whether we need to create shmem_slru.h like shmem_hash.h to
handle shared memory APIs related to SLRU. Given that SLRU also has a
disk component, the bifurcation may not be straightforward. I haven't
looked into this aspect in detail.


--
Best Wishes,
Ashutosh Bapat


Attachments:

  [application/octet-stream] 0014_edits.diff.nocibot (696B, 2-0014_edits.diff.nocibot)
  download

view thread (82+ 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]
  Subject: Re: Better shared data structure management and resizable shared data structures
  In-Reply-To: <CAExHW5sYaeZqzjUrG2V9U5ZFnZHW+X-Q2Zb9L62CRbeuAwC4EA@mail.gmail.com>

* 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