[dpdk-dev] [PATCH v7 1/2] vfio: allow partially unmapping adjacent memory

Maxime Coquelin maxime.coquelin at redhat.com
Thu Oct 21 11:50:34 CEST 2021



On 10/11/21 09:59, Xuan Ding wrote:
> Currently, if we map a memory area A, then map a separate memory area B
> that by coincidence happens to be adjacent to A, current implementation
> will merge these two segments into one, and if partial unmapping is not
> supported, these segments will then be only allowed to be unmapped in
> one go. In other words, given segments A and B that are adjacent, it
> is currently not possible to map A, then map B, then unmap A.
> 
> Fix this by adding a notion of "chunk size", which will allow
> subdividing segments into equally sized segments whenever we are dealing
> with an IOMMU that does not support partial unmapping. With this change,
> we will still be able to merge adjacent segments, but only if they are
> of the same size. If we keep with our above example, adjacent segments A
> and B will be stored as separate segments if they are of different
> sizes.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> Signed-off-by: Xuan Ding <xuan.ding at intel.com>
> ---
>   lib/eal/linux/eal_vfio.c | 338 ++++++++++++++++++++++++++-------------
>   1 file changed, 228 insertions(+), 110 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Thanks,
Maxime



More information about the dev mailing list