From: Thomas Monjalon <thomas@monjalon.net>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: dev@dpdk.org, shperetz@nvidia.com, viacheslavo@nvidia.com,
bruce.richardson@intel.com, stephen@networkplumber.org
Subject: Re: [PATCH v7 3/7] mbuf: record mbuf operations history
Date: Fri, 17 Oct 2025 11:09:19 +0200 [thread overview]
Message-ID: <21751345.Yz81rIOvuz@thomas> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35F654D9@smartserver.smartshare.dk>
17/10/2025 09:55, Morten Brørup:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > Sent: Friday, 17 October 2025 09.32
> >
> > 17/10/2025 00:29, Morten Brørup:
> > > > + /* Calculate total allocated mbufs */
> > > > + uint64_t total_allocated = 0;
> > > > + for (enum rte_mbuf_history_op op = RTE_MBUF_HISTORY_OP_LIB_ALLOC;
> > > > + op < RTE_MBUF_HISTORY_OP_MAX; op++)
> > > > + total_allocated += stats[op];
> > >
> > > I might be overly cautious here, but the app (or driver) might have a
> > bug, and mark the mbuf with OP_APP_FREE (or OP_PMD_FREE) without
> > actually freeing the mbuf back to the mempool.
> >
> > Yes
> >
> > > So you should only trust the mempool library (OP_LIB_FREE) to mark
> > the mbuf as actually freed. I.e. start the loop at op =
> > RTE_MBUF_HISTORY_OP_LIB_FREE.
> >
> > We cannot because these statistics are about the latest state.
> > So if the app marks the mbuf as freed after the library,
> > they should be reported as non allocated.
>
> The app cannot mark the mbuf after calling rte_mbuf_raw_free_bulk(). That would be a "use after free" bug.
Yes but it can happen :)
Anyway there is also the transient of mbuf marked by PMD or app
before being marked by the lib.
I think in those cases it is expected to consider the mbuf
as non-allocated in the stats.
> > > The app/driver should eventually call rte_mbuf_raw_free_bulk() or
> > similar to release the mbuf back to the mempool.
> >
> > Because we don't know in which order the mbufs are marked
> > in the call stack, we must trust these free ops.
> >
> > I really think there is room for improvements in the details of the
> > marks
> > and their usage. I suggest we merge and play with this experimental
> > feature,
> > and discuss in the next cycle how to improve the markers.
> >
>
> Since it's only a minor detail in the dump function that I'm having minor doubts about, merging as-is is OK with me.
>
> It's more important getting the feature included than making it perfect at its introduction - as you mention yourself: it's an experimental feature.
Yes let's play with it, we may discover that the markers should be changed more deeply.
next prev parent reply other threads:[~2025-10-17 9:09 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 7:29 [RFC PATCH 0/5] Introduce mempool object new debug capabilities Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 1/5] mempool: record mempool objects operations history Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 2/5] drivers: add mempool history compilation flag Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 3/5] net/mlx5: mark an operation in mempool object's history Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 4/5] app/testpmd: add testpmd command to dump mempool history Shani Peretz
2025-06-16 7:29 ` [RFC PATCH 5/5] usertool: add a script to parse mempool history dump Shani Peretz
2025-06-16 15:30 ` [RFC PATCH 0/5] Introduce mempool object new debug capabilities Stephen Hemminger
2025-06-19 12:57 ` Morten Brørup
2025-07-07 5:46 ` Shani Peretz
2025-07-07 5:45 ` Shani Peretz
2025-07-07 12:10 ` Morten Brørup
2025-07-19 14:39 ` Morten Brørup
2025-08-25 11:27 ` Slava Ovsiienko
2025-09-01 15:34 ` Morten Brørup
2025-09-16 15:12 ` [PATCH v2 0/4] add mbuf " Shani Peretz
2025-09-16 15:12 ` [PATCH v2 1/4] mbuf: record mbuf operations history Shani Peretz
2025-09-16 21:17 ` Stephen Hemminger
2025-09-16 21:33 ` Thomas Monjalon
2025-09-17 1:22 ` Morten Brørup
2025-09-17 14:46 ` Morten Brørup
2025-09-19 9:14 ` Shani Peretz
2025-09-16 15:12 ` [PATCH v2 2/4] net/mlx5: mark an operation in mbuf's history Shani Peretz
2025-09-16 21:14 ` Stephen Hemminger
2025-09-16 21:31 ` Thomas Monjalon
2025-09-17 15:04 ` Stephen Hemminger
2025-09-16 15:12 ` [PATCH v2 3/4] app/testpmd: add testpmd command to dump mbuf history Shani Peretz
2025-09-16 15:12 ` [PATCH v2 4/4] usertool: add a script to parse mbuf history dump Shani Peretz
2025-09-30 23:25 ` [PATCH v3 0/5] add mbuf debug capabilities Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 1/5] mbuf: move header include for logs Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 2/5] mbuf: record mbuf operations history Thomas Monjalon
2025-10-01 0:12 ` Thomas Monjalon
2025-10-02 7:37 ` Morten Brørup
2025-10-02 21:23 ` Thomas Monjalon
2025-10-13 18:39 ` Thomas Monjalon
2025-10-13 20:08 ` Morten Brørup
2025-10-13 21:07 ` Thomas Monjalon
2025-10-14 10:04 ` Morten Brørup
2025-09-30 23:25 ` [PATCH v3 3/5] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-02 7:44 ` Morten Brørup
2025-10-13 15:32 ` Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 4/5] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-01 8:20 ` Stephen Hemminger
2025-10-13 15:31 ` Thomas Monjalon
2025-09-30 23:25 ` [PATCH v3 5/5] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-02 8:07 ` Robin Jarry
2025-10-13 21:16 ` [PATCH v4 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-13 21:16 ` [PATCH v4 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-14 8:47 ` Morten Brørup
2025-10-14 6:58 ` [PATCH v5 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-14 9:59 ` Morten Brørup
2025-10-14 12:03 ` Thomas Monjalon
2025-10-14 12:31 ` Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-14 8:45 ` Morten Brørup
2025-10-14 9:43 ` Thomas Monjalon
2025-10-14 9:48 ` Bruce Richardson
2025-10-14 9:55 ` Thomas Monjalon
2025-10-14 6:58 ` [PATCH v5 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-16 9:04 ` Morten Brørup
2025-10-16 9:53 ` Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-16 9:26 ` Morten Brørup
2025-10-14 12:33 ` [PATCH v6 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-15 17:52 ` Stephen Hemminger
2025-10-15 19:10 ` Thomas Monjalon
2025-10-16 9:28 ` Morten Brørup
2025-10-14 12:33 ` [PATCH v6 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-14 12:33 ` [PATCH v6 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-14 14:03 ` Robin Jarry
2025-10-15 17:50 ` Stephen Hemminger
2025-10-15 19:11 ` Thomas Monjalon
2025-10-15 19:41 ` Robin Jarry
2025-10-16 8:10 ` Bruce Richardson
2025-10-16 8:42 ` Thomas Monjalon
2025-10-16 12:07 ` Robin Jarry
2025-10-16 9:46 ` Morten Brørup
2025-10-16 20:34 ` [PATCH v7 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 1/7] doc: explain debug options in mbuf guide Thomas Monjalon
2025-10-16 22:30 ` Morten Brørup
2025-10-16 20:34 ` [PATCH v7 2/7] mbuf: move header include for logs Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 3/7] mbuf: record mbuf operations history Thomas Monjalon
2025-10-16 22:29 ` Morten Brørup
2025-10-17 7:32 ` Thomas Monjalon
2025-10-17 7:55 ` Morten Brørup
2025-10-17 9:09 ` Thomas Monjalon [this message]
2025-10-16 20:34 ` [PATCH v7 4/7] ethdev: mark mbufs in burst functions Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 5/7] app/testpmd: use space separator in dump commands Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 6/7] app/testpmd: add commands to dump mbuf history Thomas Monjalon
2025-10-16 20:34 ` [PATCH v7 7/7] usertools/mbuf: parse mbuf history dump Thomas Monjalon
2025-10-17 16:10 ` [PATCH v7 0/7] add mbuf debug capabilities Thomas Monjalon
2025-10-24 22:25 ` Stephen Hemminger
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=21751345.Yz81rIOvuz@thomas \
--to=thomas@monjalon.net \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.com \
--cc=shperetz@nvidia.com \
--cc=stephen@networkplumber.org \
--cc=viacheslavo@nvidia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.