You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a low-priority item, but I'm creating this issue so we don't forget this idea.
Currently, OSv's default (non-debugging) malloc(), large allocations (over a page size) call malloc_large() which returns a chunk of memory which is not only contiguous in virtual memory, it is also contiguous in physical memory. This may fail if we are doing a very large allocation and the memory is already fragmented - even if enough memory is available.
If the allocation request is very big (e.g., bigger than a huge page) or contiguous allocation fails, it might make sense to fall back to mmap(). If we do this, there are additional complications: We need free() to recognize this memory (and remember its size) and be able to unmap it. For potential use in drivers which want physical memory, it would also be nice to fix virt_to_phys() to work on mmap'ed memory, or more efficiently - create a function which can take a virtual address range and returns a list of physical address ranges (the virt_to_phys template in <osv/mmu.hh> does exactly this, but needs support for mmap'ed memory).
The text was updated successfully, but these errors were encountered:
This is a low-priority item, but I'm creating this issue so we don't forget this idea.
Currently, OSv's default (non-debugging) malloc(), large allocations (over a page size) call malloc_large() which returns a chunk of memory which is not only contiguous in virtual memory, it is also contiguous in physical memory. This may fail if we are doing a very large allocation and the memory is already fragmented - even if enough memory is available.
If the allocation request is very big (e.g., bigger than a huge page) or contiguous allocation fails, it might make sense to fall back to mmap(). If we do this, there are additional complications: We need free() to recognize this memory (and remember its size) and be able to unmap it. For potential use in drivers which want physical memory, it would also be nice to fix virt_to_phys() to work on mmap'ed memory, or more efficiently - create a function which can take a virtual address range and returns a list of physical address ranges (the virt_to_phys template in <osv/mmu.hh> does exactly this, but needs support for mmap'ed memory).
The text was updated successfully, but these errors were encountered: