On Sat, May 16, 2020 at 11:23:51AM +0530, Gowrishankar Muthukrishnan wrote:
> After dpdk tests completes, cleaning up hugepage map files
> created by tests is helpful to release used memory into
> hugepage memory allocator.
>
> Signed-off-by: Gowrishankar Muthukrishnan <[email protected]>
> ---
> tests/system-dpdk-macros.at | 13 +++++++++++++
> tests/system-dpdk.at | 7 +++++++
> 2 files changed, 20 insertions(+)
>
> diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
> index c6708ca..d3a3aea 100644
> --- a/tests/system-dpdk-macros.at
> +++ b/tests/system-dpdk-macros.at
> @@ -63,3 +63,16 @@ m4_define([OVS_DPDK_START],
> AT_CAPTURE_FILE([ovs-vswitchd.log])
> on_exit "kill_ovs_vswitchd `cat ovs-vswitchd.pid`"
> ])
> +
> +
> +# OVS_DPDK_HUGEPAGE_CLEANUP([file])
> +#
> +# Cleanup system for stale hugepages.
> +#
> +m4_define([OVS_DPDK_HUGEPAGE_CLEANUP],
> + [dnl Cleanup mapping files in hugetlbfs mount point
> + AT_CHECK([cat /proc/mounts | grep hugetlbfs], [], [stdout])
This could be:
AT_CHECK([grep hugetlbfs /proc/mounts], [], [stdout])
> + AT_CHECK([cut -d ' ' -f 2 stdout], [], [stdout])
> + AT_CHECK([rm -f $(cat stdout)/$1], [], [])
Or combine all the above in a single line:
rm -f $(awk '/hugetlbfs/ { print $2 }' /proc/mounts)/$1
> +
> +])
> diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
> index a015d52..01ac970 100644
> --- a/tests/system-dpdk.at
> +++ b/tests/system-dpdk.at
> @@ -16,6 +16,7 @@ OVS_VSWITCHD_STOP(["/Global register is changed during/d
> /EAL: Invalid NUMA socket, default to 0/d
> /EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable
> clock cycles !/d
> /EAL: No free hugepages reported in hugepages-1048576kB/d"])
> +OVS_DPDK_HUGEPAGE_CLEANUP([rtemap_*])
> AT_CLEANUP
> dnl
> --------------------------------------------------------------------------
>
> @@ -43,6 +44,7 @@ OVS_VSWITCHD_STOP("/does not exist. The Open vSwitch kernel
> module is probably n
> /EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable
> clock cycles !/d
> /EAL: No free hugepages reported in hugepages-1048576kB/d
> ")
> +OVS_DPDK_HUGEPAGE_CLEANUP([rtemap_*])
> AT_CLEANUP
> dnl
> --------------------------------------------------------------------------
>
> @@ -75,6 +77,7 @@ OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch
> kernel module is probably
> \@EAL: Invalid NUMA socket, default to 0@d
> \@EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using
> unreliable clock cycles !@d
> \@EAL: No free hugepages reported in hugepages-1048576kB@d"])
> +OVS_DPDK_HUGEPAGE_CLEANUP([rtemap_*])
> AT_CLEANUP
> dnl
> --------------------------------------------------------------------------
>
> @@ -154,6 +157,8 @@ OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch
> kernel module is probably
> \@EAL: Invalid NUMA socket, default to 0@d
> \@EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using
> unreliable clock cycles !@d
> \@EAL: No free hugepages reported in hugepages-1048576kB@d"])
> +OVS_DPDK_HUGEPAGE_CLEANUP([rtemap_*])
> +OVS_DPDK_HUGEPAGE_CLEANUP([page0map_0])
> AT_CLEANUP
> dnl
> --------------------------------------------------------------------------
>
> @@ -230,5 +235,7 @@ OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch
> kernel module is probably
> \@EAL: Invalid NUMA socket, default to 0@d
> \@EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using
> unreliable clock cycles !@d
> \@EAL: No free hugepages reported in hugepages-1048576kB@d"])
> +OVS_DPDK_HUGEPAGE_CLEANUP([rtemap_*])
> +OVS_DPDK_HUGEPAGE_CLEANUP([page0map_0])
> AT_CLEANUP
> dnl
> --------------------------------------------------------------------------
> --
> 1.8.3.1
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
--
fbl
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev