Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the lifetime of the return value of rte_mem_virt2iova #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Mar 20, 2023

  1. Clarify the lifetime of the return value of rte_mem_virt2iova

    The Linux kernel will move memory around (changing physical address while
    keeping the virtual address constant) for various uses. These include
    compaction, autonuma, defragmentation (for future hugetlb allocations) and
    many more.
    
    Because of this, one cannot depend on the physical address of any mapping
    to be a constant, unless a specific kernel component has pinned the
    physical address in place. VFIO_NOIOMMU is an example of a kernel component
    that does this.
    
    Note that "mlock()" does NOT do this. mlock() guarantees that the memory
    will not be swapped out (hard page fault) but the kernel is allowed, and will,
    move memory around for defragmentation. Just using hugetlbfs is also equally
    not sufficient for the same reason.
    
    Signed-off-by: Arjan van de Ven <[email protected]>
    fenrus75 committed Mar 20, 2023
    Configuration menu
    Copy the full SHA
    3acf944 View commit details
    Browse the repository at this point in the history