From patchwork Fri Feb 9 17:40:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Kulasek X-Patchwork-Id: 35100 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1AE6C1B85B; Fri, 9 Feb 2018 18:40:52 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C247C1B829 for ; Fri, 9 Feb 2018 18:40:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2018 09:40:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,483,1511856000"; d="scan'208";a="33466042" Received: from unknown (HELO Sent) ([10.103.103.74]) by orsmga002.jf.intel.com with SMTP; 09 Feb 2018 09:40:47 -0800 Received: by Sent (sSMTP sendmail emulation); Fri, 09 Feb 2018 18:40:25 +0100 From: Tomasz Kulasek To: yliu@fridaylinux.org Cc: dev@dpdk.org, Sebastian Basierski Date: Fri, 9 Feb 2018 18:40:17 +0100 Message-Id: <20180209174017.14644-1-tomaszx.kulasek@intel.com> X-Mailer: git-send-email 2.12.3 Subject: [dpdk-dev] [PATCH] vhost: reduce size of coredump file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If application coredumps with vhost-user devices connected to it, the generated coredump file size is huge. To limit its size, this patch adds call to madvise() with MADV_DONTDUMP on memory regions mapped from the VM. Signed-off-by: Sebastian Basierski Signed-off-by: Tomasz Kulasek --- lib/librte_vhost/vhost_user.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 65ee33919..fc1f1a948 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -723,6 +723,11 @@ vhost_user_set_mem_table(struct virtio_net *dev, struct VhostUserMsg *pmsg) goto err_mmap; } + if (madvise(mmap_addr, mmap_size, MADV_DONTDUMP) != 0) { + RTE_LOG(INFO, VHOST_CONFIG, + "MADV_DONTDUMP advice setting failed.\n"); + } + reg->mmap_addr = mmap_addr; reg->mmap_size = mmap_size; reg->host_user_addr = (uint64_t)(uintptr_t)mmap_addr +