Skip to contentSkip to conversation

Question regarding pinning of memory

DISCUSSION sunil bhargo 2 participants 2 messages May 7, 2024 1 message not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,   We have written an application that would open a device and then mmap it.   In the kernel module the memory is allocated using vmalloc (don't require contiguous physical memory)  and in mmap we are calling remap_pfn_range to map the memory to user space.   The question is would this mechanism be enough that the memory would be pinned (neither swappable nor the page migration would happen) ? Thanks,Sunil Bhargo

#2 lore raw
Quoted 7 lines · sunil bhargo

Hi,
   We have written an application that would open a device and then
mmap it.
   In the kernel module the memory is allocated using vmalloc (don't
require contiguous physical memory)  and in mmap we are calling remap_pfn_range to map the memory to user space.
   The question is would this mechanism be enough that the memory would
be pinned (neither swappable nor the page migration would happen) ?

Recent related question:

https://lore.kernel.org/linux-mm/[email protected]/T/

Signature · 3 lines
Cheers,

David / dhildenb