Linux repositories inspector

ibv_fork_init(3)

libibverbs
2006-10-31

libibverbs-dev

Development files for the libibverbs library

rdma-core-devel

RDMA core development libraries and headers

libibverbs-devel

Development files for the libibverbs library

NAME

ibv_fork_init - initialize libibverbs to support fork()

SYNOPSIS

C]
#include <infiniband/verbs.h>

int ibv_fork_init(void);
R]

DESCRIPTION

B]ibv_fork_init()R] initializes libibverbs[cq]s data structures to handle B]fork()R] function calls correctly and avoid data corruption, whether B]fork()R] is called explicitly or implicitly (such as in B]system()R]).
It is not necessary to use this function if all parent process threads are always blocked until all child processes end or change address spaces via an B]exec()R] operation.

RETURN VALUE

B]ibv_fork_init()R] returns 0 on success, or the value of errno on failure (which indicates the failure reason).

NOTES

B]ibv_fork_init()R] works on Linux kernels supporting the B]MADV_DONTFORKR] flag for B]madvise()R] (2.6.17 and higher).
Setting the environment variable B]RDMAV_FORK_SAFER] or B]IBV_FORK_SAFER] has the same effect as calling B]ibv_fork_init()R].
Setting the environment variable B]RDMAV_HUGEPAGES_SAFER] tells the library to check the underlying page size used by the kernel for memory regions. This is required if an application uses huge pages either directly or indirectly via a library such as libhugetlbfs.
Calling B]ibv_fork_init()R] will reduce performance due to an extra system call for every memory registration, and the additional memory allocated to track memory regions. The precise performance impact depends on the workload and usually will not be significant.
Setting B]RDMAV_HUGEPAGES_SAFER] adds further overhead to all memory registrations.

SEE ALSO

B]execR](3), B]forkR](2), B]ibv_get_device_listR](3), B]systemR](3), B]waitR](2)

AUTHOR

Dotan Barak <>
⇧ Top