Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

rpma: mmap() memory for rpma_mr_reg() in rpma_flush_apm_new() #866

Commits on Feb 11, 2021

  1. rpma: mmap() memory for rpma_mr_reg() in rpma_flush_apm_new()

    The memory region passed to rpma_mr_reg() (ibv_mr_reg())
    cannot be allocated from the heap (using malloc()
    or posix_memalign()), but should be mapped using mmap().
    
    Rationale:
    
    If ibv_fork_init() was called, the memory region
    passed to ibv_mr_reg() is marked by this function
    with flag “do not copy on fork”
    and after having called fork(), the child process
    does not receive this range of virtual addresses.
    If this memory region was allocated from the heap,
    the child process receives a corrupted heap
    with a “hole” of inaccessible addresses inside.
    A memory allocator knows nothing about this “hole”
    and if it tries to access (read or write)
    that range of virtual addresses, it causes a segfault.
    
    Ref: pmem#751
    ldorau committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    5ef2a8d View commit details
    Browse the repository at this point in the history