1IBV_FORK_INIT(3) Libibverbs Programmer's Manual IBV_FORK_INIT(3)
2
3
4
6 ibv_fork_init - initialize libibverbs to support fork()
7
9 #include <infiniband/verbs.h>
10
11 int ibv_fork_init(void);
12
14 ibv_fork_init() initializes libibverbs's data structures to handle
15 fork() function calls correctly and avoid data corruption, whether
16 fork() is called explicitly or implicitly (such as in system()).
17
18 It is not necessary to use this function if all parent process threads
19 are always blocked until all child processes end or change address spa‐
20 ces via an exec() operation.
21
23 ibv_fork_init() returns 0 on success, or the value of errno on failure
24 (which indicates the failure reason).
25
27 ibv_fork_init() works on Linux kernels supporting the MADV_DONTFORK
28 flag for madvise() (2.6.17 and higher).
29
30 Setting the environment variable RDMAV_FORK_SAFE or IBV_FORK_SAFE has
31 the same effect as calling ibv_fork_init().
32
33 Calling ibv_fork_init() will reduce performance due to an extra system
34 call for every memory registration, and the additional memory allocated
35 to track memory regions. The precise performance impact depends on the
36 workload and usually will not be significant.
37
39 fork(2), wait(2), system(3), exec(3), ibv_get_device_list(3)
40
42 Dotan Barak <dotanba@gmail.com>
43
44
45
46libibverbs 2006-10-31 IBV_FORK_INIT(3)