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
However, the allocated memory space might not be aligned to the page size. I have encountered this situation where the allocation is successful but the alignment is not satisfied, but I am not sure whether it was caused by VMs or small DRAM size that was used in the VM.
From kernel-5.4, the documentation confirms the alignment guarantee of kmalloc. However, it also suggests to use the page allocator for large allocations. The blow code is the APIs of the page allocator.
Issue
In snapshot management, NOVA uses
kmalloc
to allocate the page-sized memory, and then checks the alignment, as the below code shows.linux-nova/fs/nova/snapshot.c
Lines 313 to 320 in 976a4d1
However, the allocated memory space might not be aligned to the page size. I have encountered this situation where the allocation is successful but the alignment is not satisfied, but I am not sure whether it was caused by VMs or small DRAM size that was used in the VM.
The documentation of kernel-5.1 does not say the alignment is guaranteed (https://www.kernel.org/doc/html/v5.1/core-api/memory-allocation.html). There also have discussions regarding the alignment of
kmalloc
(https://lwn.net/Articles/787740/).From kernel-5.4, the documentation confirms the alignment guarantee of
kmalloc
. However, it also suggests to use the page allocator for large allocations. The blow code is the APIs of the page allocator.linux-nova/include/linux/gfp.h
Lines 524 to 555 in 976a4d1
Fix
Replacing
kmalloc
as__get_free_page
andkfree
asfree_page
, as below code showsThe text was updated successfully, but these errors were encountered: