Re: Elimination of the repetitive code at the SLRU bootstrap functions.

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Evgeny Voropaev <evgeny(dot)voropaev(at)tantorlabs(dot)com>
Cc: Aleksander Alekseev <aleksander(at)timescale(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, alvherre(at)alvh(dot)no-ip(dot)org
Subject: Re: Elimination of the repetitive code at the SLRU bootstrap functions.
Date: 2025-02-17 12:18:39
Message-ID: BA4E87E0-8120-413F-A36D-71C5DB217ADD@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 14 Feb 2025, at 11:54, Evgeny Voropaev <evgeny(dot)voropaev(at)tantorlabs(dot)com> wrote:
>
> <v2-0001-Elimination-of-the-repetitive-code-at-the-SLRU-bo.patch>

Hi! Nice patch!

BootStrapSlruPage() always calls zerofunc(pageno, false) with second argument false.
In case of every possible argument (ZeroCLOGPage, ZeroCommitTsPage, ZeroMultiXactOffsetPage, ZeroMultiXactMemberPage, ZeroSUBTRANSPage) it means just a call to SimpleLruZeroPage().
I think we can safely replace

+ slotno = (*zerofunc)(pageno, false);

with

+ slotno = SimpleLruZeroPage(pageno);

Thus we will not need zerofunc argument at all.

Thanks!

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-02-17 13:00:30 Re: Elimination of the repetitive code at the SLRU bootstrap functions.
Previous Message Maksim Korotkov 2025-02-17 12:12:25 Re: [PATCH] snowball: fix potential NULL dereference