pmem2_source_numa_node(3)

pmem2_source_numa_node3

Returns data source numa node

Usage

#include <libpmem2.h>
struct pmem2_source;
int pmem2_source_numa_node(const struct pmem2_source *source, int *numa_node);

Overview

The pmem2_source_numa_node() function retrieves the numa node of the given data source. The numa node can be used to, e.g., pin threads to near-memory cores. The numa node is stored in *numa_node. It is the same value that is shown as numa_node in ndctl list -v.

Return value

The pmem2_source_numa_node() function returns 0 on success. If the function fails, the *numa_node variable is left unmodified and a negative error code is returned.

Errors

The pmem2_source_numa_node() can fail with the following errors:

On all systems:

•

PMEM2_E_NOSUPP - source type or operating system not supported (see #caveats for details.)

on Linux:

•

PMEM2_E_DAX_REGION_NOT_FOUND - no ndctl_region could be determined for the source.

•

PMEM2_E_INVALID_FILE_TYPE - if the source points to a directory.

•

-errno set by failing ndctl_new, while trying to create a new context.

Caveats

This call requires libndctl to retrieve the numa information. It only works for sources that are actually located on persistent memory, i.e., devdax or fsdax. As anonymous sources are not backed by files on persistent memory, this method is not supported for them. It also does not work under Windows or systems without libndctl.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

From libpmem2-dev 1.13.1-1.1+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.