pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yura Sokolov <y.sokolov@postgrespro.ru>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Subject: Re: Fix bank selection logic in SLRU
Date: Thu, 19 Dec 2024 13:37:48 +0300
Message-ID: <438161d6-6f76-45cf-b8cd-0e756c9973e1@postgrespro.ru> (raw)
In-Reply-To: <CA2D0CC8-D2F3-42F8-AF32-8FB30D1FC93A@yandex-team.ru>
References: <9444dc46-ca47-43ed-9058-89c456316306@postgrespro.ru>
	<4009750D-3EAE-4375-A7A8-3AD9922CDE1F@yandex-team.ru>
	<CAFiTN-vwHHrsNdpwoQN-e495TXvGKAScW8XLsdUEqDEk1woGmA@mail.gmail.com>
	<a325474f-5fd2-48f1-bdaf-5ded7af8c8b3@postgrespro.ru>
	<CA2D0CC8-D2F3-42F8-AF32-8FB30D1FC93A@yandex-team.ru>

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





view thread (16+ messages)  latest in thread

Message-ID: <438161d6-6f76-45cf-b8cd-0e756c9973e1@postgrespro.ru>
Permalink:  ../438161d6-6f76-45cf-b8cd-0e756c9973e1@postgrespro.ru/
Also on:    postgresql.org/message-id/438161d6-6f76-45cf-b8cd-0e756c9973e1@postgrespro.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: y.sokolov@postgrespro.ru, x4mmm@yandex-team.ru, dilipbalaut@gmail.com, alvherre@alvh.no-ip.org
  Subject: Re: Fix bank selection logic in SLRU
  In-Reply-To: <438161d6-6f76-45cf-b8cd-0e756c9973e1@postgrespro.ru>
  References: <9444dc46-ca47-43ed-9058-89c456316306@postgrespro.ru> <4009750D-3EAE-4375-A7A8-3AD9922CDE1F@yandex-team.ru> <CAFiTN-vwHHrsNdpwoQN-e495TXvGKAScW8XLsdUEqDEk1woGmA@mail.gmail.com> <a325474f-5fd2-48f1-bdaf-5ded7af8c8b3@postgrespro.ru> <CA2D0CC8-D2F3-42F8-AF32-8FB30D1FC93A@yandex-team.ru> <438161d6-6f76-45cf-b8cd-0e756c9973e1@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox