Re: Fix bank selection logic in SLRU - Mailing list pgsql-hackers

From Yura Sokolov
Subject Re: Fix bank selection logic in SLRU
Date
Msg-id 438161d6-6f76-45cf-b8cd-0e756c9973e1@postgrespro.ru
Whole thread Raw
In response to Re: Fix bank selection logic in SLRU  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: Fix bank selection logic in SLRU
List pgsql-hackers
19.12.2024 13:10, Andrey Borodin пишет:
> 
> 
>> On 19 Dec 2024, at 15:01, Yura Sokolov <y.sokolov@postgrespro.ru> wrote:
>>
>> - `&` takes 0.69ns
>> - `mult-rec` takes 2.94ns
>> - `%` takes 3.24ns.
> 
> Thanks, Yura, for benchmarks and off-list conversation.
> I’ve reproduced similar numbers on my Apple M2.
> I agree that additional 3-4ns are negligible in case of SLRU access.
> 
> 
> 
> +    bits16        nbanks;
> 
> Perhaps, it’s not bits anymore. Also, is 64K banks ought enough for everybody?
> 
> 
> Best regards, Andrey Borodin.

There are artificial limit currently:

     #define SLRU_MAX_ALLOWED_BUFFERS ((1024 * 1024 * 1024) / BLCKSZ)
     #define SLRU_BANK_BITSHIFT    4
     #define SLRU_BANK_SIZE    (1 << SLRU_BANK_BITSHIFT)

So, there's no more than 8192 banks at the moment.

But I believe, some customers will want to have more than 1GB of SLRU in 
the future. (They do already actually)

----
Yura



pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: New "single" COPY format
Next
From: Alena Rybakina
Date:
Subject: Re: Vacuum statistics