【verbs】使用ibverbs api注意事项|libibverbs 中 fork() 支持的状态如何?

问:libibverbs 中 fork() 支持的状态如何?是否仍然如下面的中描述:

https://www.csm.ornl.gov/workshops/openshmem2014/documents/presentations_and_tutorials/Tutorials/Verbs%20programming%20t… 

https://www.csm.ornl.gov/workshops/openshmem2014/documents/presentations_and_tutorials/Tutorials/Verbs%20programming%20tutorial-final.pdf

 (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

猜你喜欢

转载自blog.csdn.net/bandaoyu/article/details/124327417