DPDK usage discussions
 help / color / mirror / Atom feed
* lib/mempool: mempool walk not synchronized with mempool free
@ 2022-06-24 11:19 Sanford, Robert
  0 siblings, 0 replies; only message in thread
From: Sanford, Robert @ 2022-06-24 11:19 UTC (permalink / raw)
  To: users; +Cc: Olivier Matz, andrew.rybchenko

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-24 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24 11:19 lib/mempool: mempool walk not synchronized with mempool free Sanford, Robert

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).