Re: Fix bank selection logic in SLRU

Dilip Kumar <dilipbalaut@gmail.com>

From: Dilip Kumar <dilipbalaut@gmail.com>
To: "Andrey M. Borodin" <x4mmm@yandex-team.ru>
Cc: Yura Sokolov <y.sokolov@postgrespro.ru>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2024-12-10T13:58:29Z
Lists: pgsql-hackers
On Tue, 10 Dec 2024 at 7:24 PM, Andrey M. Borodin <x4mmm@yandex-team.ru>
wrote:

>
>
> > On 10 Dec 2024, at 16:26, Dilip Kumar <dilipbalaut@gmail.com> wrote:
> >
> > IIUC, we do check that it should be in multiple of bank size (i.e.)
> > which is multiple of 2, right?  Am I missing something?
>
> Bank selection code assumes that number of buffers is power of 2.
> If the number of buffers is not power of 2 - only subset of buffers will
> be used. In worst case, e.g. 65 buffers, everything will be buffered only
> in bank 64.


But why that would be the case? the acceptable values for GUC to configure
the slru buffers are in multiple of 16(bank size) we have that check to
check the GUC values.

—
Dilip

>

Commits

  1. Fix SLRU bank selection code