From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 68AA4A0561; Mon, 20 Apr 2020 09:08:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C59EE1BEE3; Mon, 20 Apr 2020 09:08:02 +0200 (CEST) Received: from mail-vk1-f193.google.com (mail-vk1-f193.google.com [209.85.221.193]) by dpdk.org (Postfix) with ESMTP id EA6A81BE9D for ; Mon, 20 Apr 2020 09:08:00 +0200 (CEST) Received: by mail-vk1-f193.google.com with SMTP id 10so2289220vkr.7 for ; Mon, 20 Apr 2020 00:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1r07bQsTuc+EaOtsa0MF4lBOoz2FKWd0jpSKhsLe5gE=; b=e7OoNj0bULbYQb+TEPoT6NFv/t1imKoh2uwZSiL0Rc57osqNMssG0NBxS8XcphTN/Q eoe7X/gdrQ1vugnKo7IqEl+ewYVMTbIzV0XZhsWwbRbqBl5mJ8BCDKvAdIuvUyg1iJTn HyJnig2igNNd+pzNU7G0ZRdso2KdUnnQDzBmjAHP4OXLZHpP7Et5mjZrSHStksvstUqF +E+R2xr9Gh+xhvANNYRYjC9KfnGfUwT82J01OAInceLfCpwFGa02G1mpjHFSr9+vHz8E WfP5ivAELwR4I4Yrh0R4NH5ycHYyoafjGdAmL38jhchxQn3L9QKp8M3GgcbeFvgW3VRc 0oBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1r07bQsTuc+EaOtsa0MF4lBOoz2FKWd0jpSKhsLe5gE=; b=FI3t/QdRmxlxEH4mzqo+XaDY1XIPonqo36gVNBPUr/pobciRiKVsU63AqE9zJLw5KV pVPsdnT3OJShXm+JPSJXFqGxbFJCj3Pj7fGKFEpE8HJlzgR+cBorPoUQHYRT6uLycNKf KGYEfNmwtBveXhX0ABLX0oh1mFN1VmVc/NdGxR2V1t6Cf9i+pE5+YUROTD7OU2VKZ/ms bv7olokr5I6CnNarQUSVYlMQrwbRoBojEeJiCHZCNY0EFn6ypSH4jtV+LSviaaERUXoC w6Z8ulKOg9wX+j+MF5pT8aM9CKDIEaL47BPihVoch41hI6cLL9D07OaIDakZZ79nVINx V/Rw== X-Gm-Message-State: AGi0Pub7rgXH9XlB1AySugBC/GATN6bxtg5KshVdNOwDG19t6s5MI1o5 L+g3ogSM/V1Z+bvqBHDLJU1zGjrJbKxtwvkO5ZC0EaxyhVMJirE3bUzwJA+pgQaDc25lNYnNh2M IpW5TjXaSArS2 X-Google-Smtp-Source: APiQypLCqpQi6jItb8ylMqOBebHVjVq2KTp4vE0HZv5rf0b90aQ9K/jEaViQLF40vMDMZ9SLASOssusfPkBHhM7xm5E= X-Received: by 2002:a1f:a756:: with SMTP id q83mr10124652vke.97.1587366479849; Mon, 20 Apr 2020 00:07:59 -0700 (PDT) MIME-Version: 1.0 References: <20200420070508.645533-1-fengli@smartx.com> In-Reply-To: <20200420070508.645533-1-fengli@smartx.com> From: Li Feng Date: Mon, 20 Apr 2020 15:07:47 +0800 Message-ID: To: Anatoly Burakov Cc: lifeng1519@gmail.com, Kyle Zhang , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] eal: add madvise to avoid dump memory 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" Add cc dev@dpdk.org Thanks, Feng Li Li Feng =E4=BA=8E2020=E5=B9=B44=E6=9C=8820=E6=97=A5=E5= =91=A8=E4=B8=80 =E4=B8=8B=E5=8D=883:04=E5=86=99=E9=81=93=EF=BC=9A > > Avoid dump all mmapped memory to coredump file when crash. > Otherwise it will very large and it's hard to analyze with gdb. > > In my test, it will dump 128GiB memory to coredump file when integrated > to spdk with default configuration. > > Signed-off-by: Li Feng > --- > lib/librte_eal/common/eal_common_memory.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/c= ommon/eal_common_memory.c > index cc7d54e0c..cc6743d56 100644 > --- a/lib/librte_eal/common/eal_common_memory.c > +++ b/lib/librte_eal/common/eal_common_memory.c > @@ -102,6 +102,13 @@ eal_get_virtual_area(void *requested_addr, size_t *s= ize, > if (mapped_addr =3D=3D MAP_FAILED && allow_shrink) > *size -=3D page_sz; > > + if (mapped_addr !=3D MAP_FAILED) { > + if (madvise(mapped_addr, map_sz, MADV_DONTDUMP) != =3D 0) > + RTE_LOG(INFO, EAL, "MADV_DONTDUMP advice = setting failed.\n"); > + RTE_LOG(DEBUG, EAL, "madvise with MADV_DONTDUMP, = addr: %p size: %ld\n", > + mapped_addr, (size_t)map_sz); > + } > + > if (mapped_addr !=3D MAP_FAILED && addr_is_hint && > mapped_addr !=3D requested_addr) { > try++; > -- > 2.11.0 > --=20 The SmartX email address is only for business purpose. Any sent message=20 that is not related to the business is not authorized or permitted by=20 SmartX. =E6=9C=AC=E9=82=AE=E7=AE=B1=E4=B8=BA=E5=8C=97=E4=BA=AC=E5=BF=97=E5=87=8C=E6= =B5=B7=E7=BA=B3=E7=A7=91=E6=8A=80=E6=9C=89=E9=99=90=E5=85=AC=E5=8F=B8=EF=BC= =88SmartX=EF=BC=89=E5=B7=A5=E4=BD=9C=E9=82=AE=E7=AE=B1. =E5=A6=82=E6=9C=AC= =E9=82=AE=E7=AE=B1=E5=8F=91=E5=87=BA=E7=9A=84=E9=82=AE=E4=BB=B6=E4=B8=8E=E5= =B7=A5=E4=BD=9C=E6=97=A0=E5=85=B3,=E8=AF=A5=E9=82=AE=E4=BB=B6=E6=9C=AA=E5= =BE=97=E5=88=B0=E6=9C=AC=E5=85=AC=E5=8F=B8=E4=BB=BB=E4=BD=95=E7=9A=84=E6=98= =8E=E7=A4=BA=E6=88=96=E9=BB=98=E7=A4=BA=E7=9A=84=E6=8E=88=E6=9D=83.