[PATCH v3] vhost: fix madvise arguments alignment
Maxime Coquelin
maxime.coquelin at redhat.com
Thu Mar 2 11:19:38 CET 2023
Hi Mike,
On 3/1/23 21:02, Mike Pattrick wrote:
> The arguments passed to madvise should be aligned to the alignment of
> the backing memory. Now we keep track of each regions alignment and use
> then when setting coredump preferences. To facilitate this, a new member
> was added to rte_vhost_mem_region. A new function was added to easily
The above sentence is no more valid, I can rework it while applying.
> translate memory address back to region alignment. Unneeded calls to
> madvise were reduced, as the cache removal case should already be
> covered by the cache insertion case. The previously inline function
> mem_set_dump was removed from a header file and made not inline.
>
> Fixes: 338ad77c9ed3 ("vhost: exclude VM hugepages from coredumps")
>
> Signed-off-by: Mike Pattrick <mkp at redhat.com>
> ---
> Since v1:
> - Corrected a cast for 32bit compiles
> Since v2:
> - Removed changes from rte_vhost.h
> - Restored set_mem_dump in ioctl remove/evict functions
> ---
> lib/vhost/iotlb.c | 68 +++++++++++++++++++++++++++++++-----------
> lib/vhost/iotlb.h | 5 ++--
> lib/vhost/vhost.h | 12 ++------
> lib/vhost/vhost_user.c | 68 ++++++++++++++++++++++++++++++++++--------
> 4 files changed, 110 insertions(+), 43 deletions(-)
>
Tested-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Thanks,
Maxime
More information about the dev
mailing list