pgsql: Add support for basic NUMA awareness - Mailing list pgsql-committers

From Tomas Vondra
Subject pgsql: Add support for basic NUMA awareness
Date
Msg-id E1u1tr8-003BbL-20@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Add support for basic NUMA awareness
Re: pgsql: Add support for basic NUMA awareness
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/65c298f61fc70f2f960437c05649f71b862e2c48

Modified Files
--------------
.cirrus.tasks.yml                   |   2 +
configure                           | 187 ++++++++++++++++++++++++++++++++++++
configure.ac                        |  14 +++
doc/src/sgml/func.sgml              |  13 +++
doc/src/sgml/installation.sgml      |  22 +++++
meson.build                         |  23 +++++
meson_options.txt                   |   3 +
src/Makefile.global.in              |   6 +-
src/backend/utils/misc/guc_tables.c |   2 +-
src/include/catalog/catversion.h    |   2 +-
src/include/catalog/pg_proc.dat     |   4 +
src/include/pg_config.h.in          |   3 +
src/include/port/pg_numa.h          |  40 ++++++++
src/include/storage/pg_shmem.h      |   1 +
src/makefiles/meson.build           |   3 +
src/port/Makefile                   |   1 +
src/port/meson.build                |   1 +
src/port/pg_numa.c                  | 120 +++++++++++++++++++++++
18 files changed, 444 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Álvaro Herrera
Date:
Subject: pgsql: Use specific collation where needed in new test
Next
From: Michael Paquier
Date:
Subject: pgsql: Flush the IO statistics of active WAL senders more frequently