Remove freelist reference in buf_init.c

Started by Ashutosh Bapat8 months ago4 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t53239
psql -h localhost -U postgres

Built from patchset v1 (message #1), September 20, 2026 at 09:11 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t53239_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t53239_1 && git checkout t53239_1

Patchset v1 (message #1) is on t53239_1

Jump to latest
#1Ashutosh Bapat
ashutosh.bapat.oss@gmail.com

Hi All,
We have gotten rid of freelist in buffer manager, but buf_init.c still
has a reference to it in a comment. Patch to remove the reference.

Other references to freelist refer to freelist.c which is still a
valid filename reference. Hence I didn't touch it.

--
Best Wishes,
Ashutosh Bapat

Attachments:

t53239_1
buf_init_freelist.patchtext/x-patch; charset=US-ASCII; name=buf_init_freelist.patchDownload+1-1
#2Michael Paquier
michael@paquier.xyz
In reply to: Ashutosh Bapat (#1)
Re: Remove freelist reference in buf_init.c

On Tue, Feb 03, 2026 at 10:48:30AM +0530, Ashutosh Bapat wrote:

Other references to freelist refer to freelist.c which is still a
valid filename reference. Hence I didn't touch it.

Thanks, confirmed. Grabbed for later.
--
Michael

#3Andres Freund
andres@anarazel.de
In reply to: Ashutosh Bapat (#1)
Re: Remove freelist reference in buf_init.c

Hi,

On 2026-02-03 10:48:30 +0530, Ashutosh Bapat wrote:

We have gotten rid of freelist in buffer manager, but buf_init.c still
has a reference to it in a comment. Patch to remove the reference.

Other references to freelist refer to freelist.c which is still a
valid filename reference. Hence I didn't touch it.

I'm not sure this enough of an improvement to really be worth it. I think we
probably ought to rename freelist.c to buf_replacement.c or such. Which of
course will require more comment changes.

Even if we don't, I think that the entire comment in buf_init.c is misplaced
and bound to not be updated. Nobody is looking for it there, both when trying
to learn about the code and when changing the code.

Greetings,

Andres Freund

#4Ashutosh Bapat
ashutosh.bapat.oss@gmail.com
In reply to: Andres Freund (#3)
Re: Remove freelist reference in buf_init.c

On Tue, Feb 3, 2026 at 8:44 PM Andres Freund <andres@anarazel.de> wrote:

Hi,

On 2026-02-03 10:48:30 +0530, Ashutosh Bapat wrote:

We have gotten rid of freelist in buffer manager, but buf_init.c still
has a reference to it in a comment. Patch to remove the reference.

Other references to freelist refer to freelist.c which is still a
valid filename reference. Hence I didn't touch it.

I'm not sure this enough of an improvement to really be worth it. I think we
probably ought to rename freelist.c to buf_replacement.c or such. Which of
course will require more comment changes.

Even if we don't, I think that the entire comment in buf_init.c is misplaced
and bound to not be updated. Nobody is looking for it there, both when trying
to learn about the code and when changing the code.

Hmm,
I think that whole comment block is misleading; it seems to be
outdated or at least incomplete. We have two options
1. Replace the comment block with a comment block mentioning all the
shared memory structures that buffer manager uses, their purpose, and
point to respective comments in buf_internals.h.
2. Remove that comment entirely from there and add the comment block
as above to README.

--
Best Wishes,
Ashutosh Bapat