问:libibverbs 中 fork() 支持的状态如何?是否仍然如下面的中描述:
(as listed below) ? Or is there some improvement (less constraint) to support fork() since then?
- When possible, avoid using fork()
• fork() or other system calls that call fork(), for example: system(), popen(), etc.
- If fork() must be used, the next rules should be followed:
• Prepare libibverbs to work with fork():
- Call the verb ibv_fork_init()
or
Setting the environment variables RDMAV_FORK_SAFE or IBV_FORK_SAFE
- This will allocate internal structures in way which is more “fork()”-friendly
• RDMA should be used only in the parent process
• Child process should call immediately exec*() or exit()
• If huge pages are used, set the environment variable RDMAV_HUGEPAGES_SAFE as well
- Warning: Not following those rules may lead to data corruption or segmentation fault!
答:是的,除了你提到的那些,你应该还需要参考:
https://network.nvidia.com/related-docs/prod_software/RDMA_Aware_Programming_user_manual.pdf
原文:What's the status of fork() support in libibverbs? - Mellanox OFED - NVIDIA Developer Forums