+1
−0
+198
−22
+277
−1
Loading
It's now possible to use spdk_mem_map to translate addresses with 4KB granularity. 2MB pages are still translated in the same way they were before this patch. Only when a translation for a non-2MB aligned address is set up, the 4KB mapping is used. But it's used just for the portion that cannot be represented by a 2MB mapping, meaning that translating a large memory region, only the beginning and end of that region might use the 4KB mapping. For instance, setting up a translation for 0x1ff000-0x601000 results in: - 4KB mapping for the 0x100000-0x200000 region, with all but the last 4KB page set to the default translation, - two 2MB mappings for the 0x200000-0x600000 region, - 4KB mapping for the 0x600000-0x800000 region, with all but the first 4KB page set to the default translation. The top-level map now has two types of 1GB maps, one for 2MB translations and one for 4KB. If a 1GB address space contains at least one 2MB or 4KB mapping, the appropriate 1GB map is allocated. Obviously, more memory is needed to store these translations. Mapping the same amount of memory using 4KB translations results in a 512x increase compared to 2MB translations. However, when all mappings are 2MB aligned, there is no difference. Change-Id: I97726f334aeab152c3356fc515988b30bcd0635a Signed-off-by:Konrad Sztyber <ksztyber@nvidia.com> Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26213 Community-CI: Mellanox Build Bot Reviewed-by:
Ben Walker <ben@nvidia.com> Tested-by:
SPDK Automated Test System <spdkbot@gmail.com> Reviewed-by:
Jim Harris <jim.harris@nvidia.com>