Skip to content

Conversation

fenrus75
Copy link

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.

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]>
@tmonjalo
Copy link
Member

tmonjalo commented Jun 7, 2023

Hello, I've just noticed your pull request.
DPDK process is to send the patches to [email protected]:
git send-email --to [email protected] --cc-cmd devtools/get-maintainer.sh -1

Please could you send it there?
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants