Questions tagged [vmalloc]
34 questions
1
vote
0 answers
How to solve 'Entry Point Not Found' error in a Vulkan project (CMake 3.21/VisualStudio/C++20/VMA/shaderc)
(firstly I'm a chinese, so there might be some syntax errors. I'm sorry for that)
So yesterday I just update my VulkanSDK version to the newest (version 1.3.216.0) as well as VMA, but there's a runtime error occured when I try to run the code which…

dance_0607
- 11
- 1
1
vote
0 answers
How can i correctly free a struct work_struct allocated with vmalloc
I am developing a kernel module for the Linux kernel. Basically, what I need to do is populating /dev with some special char devices. Upon a write operation on such devices, I need to store the message and then make it available to readers after a…

GiuDaquan
- 13
- 3
1
vote
0 answers
use vmalloc memory to do DMA?
I'm writing a driver which need large memory. Let's say it will be 1GB at least.
The kernel version >= 3.10.
Driver needs run in X86_64 and Arm platform.
The hardware may have IOMMU.
This large memory will mmap to userspace.
Device use those…

randomeval
- 599
- 4
- 13
1
vote
1 answer
Memory Mapping in Linux Kernel - use of vamlloc() and kmalloc()
Considering a 32bit x86 Linux system with 4 GB of RAM memory, So as described in books as well as on many forums that the Memory mapping would be as follows:
Kernel logical address - upto 896 MB - Which is one to one mapped and can be allocated…

Usr1
- 369
- 1
- 6
- 15
1
vote
1 answer
linux kernel vfree() how to synchronize master kernel page table and process's page table?
I know how vmalloc() does。 When a process(in kernel space) want to access the memory that belongs to vmalloc(),a page fault happens and does the synchronization。
But when it invokes the vfree(), how the process update its page table to sync with the…

Zhao Yuhao
- 11
- 1
1
vote
0 answers
How to retrieve memory addresses vmalloc()ed previously by any modules?
First, vmalloc() called many times by any modules. Some of those addresses have be freed, some have not been freed, and some are leaking.
Then, a module driver needs to detect those addresses' status, i.e. are those addresses freed, not freed or…

Jin
- 11
- 2
1
vote
0 answers
UIImagePngRepresentation sometimes cause memory leak
My code shows weird behavior, and I've searched for hours with no luck.
My code snippet:
func loadImageFromLocal(index:String)->UIImage{
var fileManager = NSFileManager.defaultManager()
var containerURL =…

kwmaeng
- 631
- 2
- 5
- 20
1
vote
2 answers
Why physically contiguous memory region is more efficient than virtually contiguous memory.?
It is said that Physically contiguous memory region is more efficient than virtually contiguous memory, for that Robert Love's book says that kernel don't need to set up the page table entries for physically contiguous memory.
But doesn't kernel…

Rahul
- 1,607
- 3
- 23
- 41
0
votes
1 answer
change page order in kernel space
I have a kernel module that works on data that is:
allocated by the kernel
page aligned
the data "mapping" is arbitrary
I allocate the memory in kernel space with kvmalloc(). For userspace representation i use vm_insert_page() to create the…

eddy
- 488
- 5
- 18
0
votes
0 answers
How to pin and get kernel pages in Linux?
I am allocating memory to the buffer in kernel space. I want to pin the pages and get the pinned kernel pages. But I did not find any APIs to do that. There is one API called get_kernel_page(unsigned long start, int write, struct ** pages) which…

Vinay Hasyagar
- 21
- 3
0
votes
2 answers
Using vmalloc (libvmalloc.a) on Mac and CentOS- cannot include vmalloc header
I want to allocate virtually contiguous range memory so that I can use the locality property (spatial locality) when accessing data, with consideration for better performance. I found out at the following page that I need to use vmalloc for better…

all_by_grace
- 2,315
- 6
- 37
- 52
0
votes
0 answers
DMA zone free enough but vmalloc with GFP_DMA still failed
I have a memory leak process which cause OOM kill to other process. The OOM log below:
[3669.400 s]4,1153,3669403826,-;test_process: vmalloc: allocation failure, allocated 102400 of 135168 bytes, mode:0x6000c1(GFP_KERNEL|GFP_DMA), nodemask=(null)
…

Tim Cheng
- 33
- 8
0
votes
1 answer
What's the reason for BUG_ON in __get_vm_area_node?
Why is this assertion in __get_vm_area_node?
static struct vm_struct *__get_vm_area_node(...)
{
// ...
BUG_ON(in_interrupt())
// ...
}

yash
- 47
- 5
0
votes
1 answer
How to comprehend "You can use the slab cache allocator(i.e. kmem_cache_create or kmem_cache_create_usercopy) to allocate many identical objects"?
As per the documentation(https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html), which says[emphasis mine]:
If you need to allocate many identical objects you can use the slab
cache allocator. The cache should be set up with…

John
- 2,963
- 11
- 33
0
votes
0 answers
Can i use ksize on memory allocated by vmalloc
Can i use ksize on memory allocated by vmalloc.
I know ksize is used to determine the actual amount of memory allocated
So, i wanted to find out whether vmalloc round up allocations and return more memory than requested.
Will the below code…

md.jamal
- 4,067
- 8
- 45
- 108