DPDK patches and discussions
 help / color / mirror / Atom feed
From: Lewis Donzis <lew@perftech.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, dev <dev@dpdk.org>
Subject: Re: Including contigmem in core dumps
Date: Tue, 22 Oct 2024 11:00:55 -0500 (CDT)	[thread overview]
Message-ID: <1265725412.9011449.1729612855836.JavaMail.zimbra@donzis.com> (raw)
In-Reply-To: <20241022083926.355b8b16@hermes.local>



----- On Oct 22, 2024, at 10:39 AM, Stephen Hemminger stephen@networkplumber.org wrote:

> On Tue, 22 Oct 2024 17:47:11 +0300
> Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote:
> 
>> 2024-10-22 07:41 (UTC-0500), Lewis Donzis:
>> > I've been wondering why we exclude memory allocated by
>> > eal_get_virtual_area() from core dumps? (More specifically, it calls
>> > eal_mem_set_dump() to call madvise() to disable core dumps from the
>> > allocated region.)
>> > 
>> > On many occasions, when debugging after a crash, it would have been very
>> > convenient to be able to see the contents of an mbuf or other object
>> > allocated in contigmem space. And we often avoid using the rte memory
>> > allocator just because of this.
>> > 
>> > Is there any reason for this, or could it perhaps be a compile-time
>> > configuration option not to call madvise()?
>> 
>> The commit that originally added madvise() argued that dumping everything
>> ended up in coredumps with "useless" data [non-mapped or unused pages]:
>> 
>> http://git.dpdk.org/dpdk/commit/?id=d72e4042c5ebda7af81448b387af8218136402d0
>> 
>> Dumping mapped pages sounds reasonable in many cases.
>> Not in all cases admittedly:
>> - legacy memory mode mapping a lot of pages that are not (yet) used;
>> - if packet data is confidential while the app is not.
>> 
>> The option to dump or not can easily be a runtime one.
>> The safe default however seems to be "off".
>> 
>> In dynamic memory node (not FreeSBD, unfortunately)
>> rte_mem_event_callback-register() may be used to call madvise().
>> Maybe DPDK should allow such callbacks in any mode
>> and invoke them during initialization to make the above solution universal.
> 
> It is not unusual to have 2 or 4 Gigabytes of huge pages mapped.
> Many embedded systems do not have 6G of extra storage available for a single
> core
> dump, not to mention multiples. Plus any storage can be really slow on embedded
> systems.
> 
> And the common scenario on Linux is to use systemd to capture and compress
> core dumps.

Totally agree.  Most of the time, we wouldn't want this enabled because the core dumps would be huge, but in environments where we do have storage available, it can greatly help troubleshooting to be able to examine the contents of contigmem in the debugger.  Unfortunately, on FreeBSD, we don't have the luxury of systemd's ability to do this, or even to compress the core dumps, although we do have ZFS compression on the local filesystem, which does a pretty decent job on on core dumps.

  parent reply	other threads:[~2024-10-22 16:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 12:41 Lewis Donzis
2024-10-22 14:47 ` Dmitry Kozlyuk
2024-10-22 15:39   ` Stephen Hemminger
2024-10-22 15:57     ` Morten Brørup
2024-10-22 16:00     ` Lewis Donzis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-28  0:34 Lewis Donzis
2024-05-28  6:55 ` Dmitry Kozlyuk
2024-05-28 13:19   ` Lewis Donzis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265725412.9011449.1729612855836.JavaMail.zimbra@donzis.com \
    --to=lew@perftech.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).