mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Add support for basic NUMA awareness
Add basic NUMA awareness routines, using a minimal src/port/pg_numa.c portability wrapper and an optional build dependency, enabled by --with-libnuma configure option. For now this is Linux-only, other platforms may be supported later. A built-in SQL function pg_numa_available() allows checking NUMA support, i.e. that the server was built/linked with the NUMA library. The main function introduced is pg_numa_query_pages(), which allows determining the NUMA node for individual memory pages. Internally the function uses move_pages(2) syscall, as it allows batching, and is more efficient than get_mempolicy(2). Author: Jakub Wartak <jakub.wartak@enterprisedb.com> Co-authored-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Tomas Vondra <tomas@vondra.me> Discussion: https://postgr.es/m/CAKZiRmxh6KWo0aqRqvmcoaX2jUxZYb4kGp3N%3Dq1w%2BDiH-696Xw%40mail.gmail.com
This commit is contained in:
@ -25143,6 +25143,19 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
|
||||
</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry role="func_table_entry"><para role="func_signature">
|
||||
<indexterm>
|
||||
<primary>pg_numa_available</primary>
|
||||
</indexterm>
|
||||
<function>pg_numa_available</function> ()
|
||||
<returnvalue>boolean</returnvalue>
|
||||
</para>
|
||||
<para>
|
||||
Returns true if the server has been compiled with <acronym>NUMA</acronym> support.
|
||||
</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry role="func_table_entry"><para role="func_signature">
|
||||
<indexterm>
|
||||
|
@ -1156,6 +1156,17 @@ build-postgresql:
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="configure-option-with-libnuma">
|
||||
<term><option>--with-libnuma</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Build with libnuma support for basic NUMA support.
|
||||
Only supported on platforms for which the <productname>libnuma</productname>
|
||||
library is implemented.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="configure-option-with-liburing">
|
||||
<term><option>--with-liburing</option></term>
|
||||
<listitem>
|
||||
@ -2645,6 +2656,17 @@ ninja install
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="configure-with-libnuma-meson">
|
||||
<term><option>-Dlibnuma={ auto | enabled | disabled }</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Build with libnuma support for basic NUMA support.
|
||||
Only supported on platforms for which the <productname>libnuma</productname>
|
||||
library is implemented. The default for this option is auto.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="configure-with-libxml-meson">
|
||||
<term><option>-Dlibxml={ auto | enabled | disabled }</option></term>
|
||||
<listitem>
|
||||
|
Reference in New Issue
Block a user