Re: Support getrandom() for pg_strong_random() source

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support getrandom() for pg_strong_random() source
Date: 2025-07-29 16:38:30
Message-ID: 878qk7hrzt.fsf@wibble.ilmari.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com> writes:

> On Mon, Jul 28, 2025 at 6:30 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
>> Could getentropy() be more efficient at the end on most platforms,
>> meaning that this could limit the meaning of having a GUC switch?
>
> I don't know. [2] implies that the performance comparison depends on
> several factors, and falls in favor of OpenSSL when the number of
> bytes per call is large
[...]
> [2] https://dotat.at/@/2024-10-01-getentropy.html

Note that that test was done on an older Linux kernel without the vDSO
implementation of getentropy(), so on newer kernel (>=6.11) and glibc
(>= 2.41) versions the difference might be smaller or the other way
around.

- ilmari

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-07-29 16:41:01 Re: AIO v2.5
Previous Message Jacob Champion 2025-07-29 15:55:10 Re: Support getrandom() for pg_strong_random() source