DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: reduce size of coredump file
@ 2018-02-09 17:40 Tomasz Kulasek
  2018-02-11  4:34 ` Tan, Jianfeng
  0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Kulasek @ 2018-02-09 17:40 UTC (permalink / raw)
  To: yliu; +Cc: dev, Sebastian Basierski

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 <sebastianx.basierski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
---
 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 +
-- 
2.14.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-28  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09 17:40 [dpdk-dev] [PATCH] vhost: reduce size of coredump file Tomasz Kulasek
2018-02-11  4:34 ` Tan, Jianfeng
2018-03-28  8:48   ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).