From patchwork Sat May 16 05:53:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 1291842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ejDsTxmm; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49PDxM1n5Lz9sTD for ; Sat, 16 May 2020 15:54:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 97BE4888CF; Sat, 16 May 2020 05:54:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YY822B2p3Xla; Sat, 16 May 2020 05:54:12 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 0370C88AC7; Sat, 16 May 2020 05:54:12 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DE1D7C088F; Sat, 16 May 2020 05:54:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id AB1F1C016F for ; Sat, 16 May 2020 05:54:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9535D888B6 for ; Sat, 16 May 2020 05:54:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sZcvij92xArA for ; Sat, 16 May 2020 05:54:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7FFF8888B5 for ; Sat, 16 May 2020 05:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589608447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CQmZtcEC4VEncUZ/xTX3axZ2DW4vPpcKUB35WFWybro=; b=ejDsTxmm6o20he8N8RTGvcyIFA8AQ0uubo6kD4kxdFCy66lM1bTML4Ph1oU0HBytDocUj5 n2ATBTuUX3TSnUd+lygvzHwVu7Ro7xYCEmDNLseQ54+tXsVdGxcs2Yz1S7iSdJMrOocLxy FVkAo70HmijNt5AXAI87wjxqjZyA3h0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-76-KyMnnGpmM2WY4y-Pz7z0BA-1; Sat, 16 May 2020 01:54:03 -0400 X-MC-Unique: KyMnnGpmM2WY4y-Pz7z0BA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 661D81005510; Sat, 16 May 2020 05:54:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-41.sin2.redhat.com [10.67.116.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B9A4579A0; Sat, 16 May 2020 05:53:59 +0000 (UTC) From: Gowrishankar Muthukrishnan To: dev@openvswitch.org Date: Sat, 16 May 2020 11:23:51 +0530 Message-Id: <3435decd0cc431e438bedfbcb92c0619e15e7489.1589605823.git.gmuthukr@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Flavio Leitner Subject: [ovs-dev] [PATCH v2 1/3] system-dpdk: cleanup stale hugepage files after tests X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 --- 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]) + AT_CHECK([cut -d ' ' -f 2 stdout], [], [stdout]) + AT_CHECK([rm -f $(cat stdout)/$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 --------------------------------------------------------------------------