From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 972B441C38;
	Fri, 10 Feb 2023 16:53:43 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 7A19D410EA;
	Fri, 10 Feb 2023 16:53:43 +0100 (CET)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by mails.dpdk.org (Postfix) with ESMTP id 5D4E1410D3
 for <dev@dpdk.org>; Fri, 10 Feb 2023 16:53:41 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1676044420;
 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:
 in-reply-to:in-reply-to:references:references;
 bh=Tknb/hfrqGifiUhBeWl4gc7p9yjgQi1NzvNGKIJQpQk=;
 b=VmVc0lJ3Ypo4gwg28gbeq1SfDGNYnhxlktYkBcozZTOBsCMF+IJer66IcvHplXhcyR3FDB
 /F7axtdOFQbLq5W98ZAzR5rik3YWRyXCIfcFgNFltiSgFBGzcZvIoVQksM3g/2NuQf9WNg
 zxtibFQ0DDKSdhjLDPl8vXx1TeCJvj4=
Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com
 [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id
 us-mta-3-G3VbfT21My-Yvlm2L9-gKA-1; Fri, 10 Feb 2023 10:53:39 -0500
X-MC-Unique: G3VbfT21My-Yvlm2L9-gKA-1
Received: by mail-pj1-f70.google.com with SMTP id
 dt6-20020a17090afa4600b00230183006c3so2609551pjb.7
 for <dev@dpdk.org>; Fri, 10 Feb 2023 07:53:39 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=Tknb/hfrqGifiUhBeWl4gc7p9yjgQi1NzvNGKIJQpQk=;
 b=LC20W5u9gZuhzWdwvR/bg+Q57tJCbpcf9tx7bZB+mv85j1jO8j3suepjUKJfmxldNI
 SfuA7gfJ/9QHpQ2b8ja6jRB1CKe2QbwCIxKzQalZh9OBh2AtBgcbgEwus3Xs/Yznh8Si
 1vUJ1keCbr/2tVMoo/hx2FtKJFqu9pAwrXb15lxU52JGxYG5RFlYY581Cgjnvo+8PRoz
 RzVYVegx7VtxXhl0jFIysfBOMUaf+SqR78ziN1VUTKGi4/MyDIrBA92N3vBWWYuBGOkC
 Rsr504f8M2ZZ939wsf/G6j2d0JxZ/ez8Qo6k8UkBm+zdnMtfZ9VVBTSVZKXOHYJDR9Qb
 yk3w==
X-Gm-Message-State: AO0yUKURyklAbjXiGJgGqURRggkAwZc/u8kx7vofYjDDDOMgjluUfkEb
 kvBNNerkM0EkqgIxnhKSRUCd5/GyUxFaWGCkaThTG99N7NwiyXP2v95HfbfeF/b+6aiBQNJQIHQ
 gEcvbtYE3xUznVrTcy3M=
X-Received: by 2002:a17:90b:78a:b0:230:fd8a:de61 with SMTP id
 l10-20020a17090b078a00b00230fd8ade61mr2711717pjz.83.1676044418771; 
 Fri, 10 Feb 2023 07:53:38 -0800 (PST)
X-Google-Smtp-Source: AK7set9UQj2rYUdrSA8CNl55UISQcXiWCTE34qy+S9ZlVzdaakovsDa1SOQ9RVnTEg4NDYWYKruQvAE7/r38egSaTyc=
X-Received: by 2002:a17:90b:78a:b0:230:fd8a:de61 with SMTP id
 l10-20020a17090b078a00b00230fd8ade61mr2711708pjz.83.1676044418474; Fri, 10
 Feb 2023 07:53:38 -0800 (PST)
MIME-Version: 1.0
References: <20221206150509.772408-1-mkp@redhat.com>
 <20221207165408.895018-1-mkp@redhat.com>
In-Reply-To: <20221207165408.895018-1-mkp@redhat.com>
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 10 Feb 2023 16:53:26 +0100
Message-ID: <CAJFAV8yx+CQxTr3UfMY+3E+rny2Umv6pewFoTQ9e9W7xE=4PfA@mail.gmail.com>
Subject: Re: [PATCH v3] vhost: exclude VM hugepages from coredumps
To: Mike Pattrick <mkp@redhat.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
 Chenbo Xia <chenbo.xia@intel.com>, dev@dpdk.org
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Hello Mike,

On Wed, Dec 7, 2022 at 5:54 PM Mike Pattrick <mkp@redhat.com> wrote:
>
> Currently if an application wants to include shared hugepages in
> coredumps in conjunction with the vhost library, the coredump will be
> larger than expected and include unneeded virtual machine memory.
>
> This patch will mark all vhost huge pages as DONTDUMP, except for some
> select pages used by DPDK.
>
> Signed-off-by: Mike Pattrick <mkp@redhat.com>

I noticed the following warnings today on my f37 kernel, while running
a vhost-user/virtio-user testpmd setup on next-virtio branch.
Linux dmarchan 6.1.9-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb  2
00:21:48 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
My system has 2M hugepages, only.


$ rm vhost-net; strace -e trace=madvise -f
./build-clang/app/dpdk-testpmd --in-memory --no-pci
--vdev=net_vhost0,iface=./vhost-net,client=1 -- -i

$ ./build-clang/app/dpdk-testpmd --in-memory --single-file-segment
--no-pci --vdev
'net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,server=1'  --
-i

Then, on the "vhost side" testpmd:
...
VHOST_CONFIG: (./vhost-net) read message VHOST_USER_SET_VRING_NUM
VHOST_CONFIG: (./vhost-net) read message VHOST_USER_SET_VRING_BASE
VHOST_CONFIG: (./vhost-net) vring base idx:0 last_used_idx:0 last_avail_idx:0.
VHOST_CONFIG: (./vhost-net) read message VHOST_USER_SET_VRING_ADDR
VHOST_CONFIG: (./vhost-net) read message VHOST_USER_SET_VRING_KICK
VHOST_CONFIG: (./vhost-net) vring kick idx:0 file:391
[pid 59565] madvise(0x7fa6d8da4000, 2052, MADV_DODUMP) = -1 EINVAL
(Invalid argument)
VHOST_CONFIG: could not set coredump preference (Invalid argument).
[pid 59565] madvise(0x7fa6d8da5000, 2052, MADV_DODUMP) = -1 EINVAL
(Invalid argument)
VHOST_CONFIG: could not set coredump preference (Invalid argument).
[pid 59565] madvise(0x7fa6d8da6000, 2052, MADV_DODUMP) = -1 EINVAL
(Invalid argument)
VHOST_CONFIG: could not set coredump preference (Invalid argument).
VHOST_CONFIG: (./vhost-net) read message VHOST_USER_SET_VRING_NUM
VHOST_CONFIG: (./vhost-net) read message VHOST_USER_SET_VRING_BASE

Looking at the whole trace, only madvise calls with MADV_DODUMP (with
all of them for a 2052 size) fail.

I did not investigate further.
Could you have a look please?


-- 
David Marchand