DPDK usage discussions
 help / color / mirror / Atom feed
From: "Sanford, Robert" <rsanford@akamai.com>
To: "users@dpdk.org" <users@dpdk.org>
Cc: Olivier Matz <olivier.matz@6wind.com>,
	"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>
Subject: lib/mempool: mempool walk not synchronized with mempool free
Date: Fri, 24 Jun 2022 11:19:47 +0000	[thread overview]
Message-ID: <484F07F6-7DCB-456A-B678-9915A44ADE20@akamai.com> (raw)

Hello guys,

I was surprised to discover that rte_mempool_walk()
occasionally passes a NULL rte_mempool pointer to the callback.
Concurrently in other threads of our app, we may invoke
rte_mempool_create() or rte_mempool_free().

Upon further inspection, we see:
1. rte_mempool_create_empty holds both the mcfg_mempool and
   mcfg_tailq locks (write mode).
2. rte_mempool_free holds only the mcfg_tailq lock (write mode).
3. rte_mempool_list_dump, rte_mempool_lookup, and
   rte_mempool_walk hold only the mcfg_mempool lock (read mode).

I believe all functions in #3 might need to hold both the
mcfg_mempool and mcfg_tailq locks (read mode).

I haven't studied the code enough to say whether
rte_mempool_free requires any changes.

What do you guys think?

--
Thanks for your time,
Robert


                 reply	other threads:[~2022-06-24 11:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=484F07F6-7DCB-456A-B678-9915A44ADE20@akamai.com \
    --to=rsanford@akamai.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=olivier.matz@6wind.com \
    --cc=users@dpdk.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).