DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: bugzilla@dpdk.org
Cc: dev@dpdk.org
Subject: Re: [Bug 1277] memory_hotplug_lock deadlock during initialization
Date: Wed, 23 Aug 2023 07:56:16 -0700	[thread overview]
Message-ID: <20230823075616.45b2f971@hermes.local> (raw)
In-Reply-To: <bug-1277-3@http.bugs.dpdk.org/>


> It seems the issue arose due to changes in the DPDK read-write lock
> implementation. Following these changes, the RW-lock no longer supports
> recursion, implying that a single thread shouldn't obtain a read lock if it
> already possesses one. The problem arises during initialization: the
> rte_eal_memory_init() function acquires the memory_hotplug_lock, and later on,
> the sequence of calls eal_memalloc_init() -> rte_memseg_list_walk() acquires it
> again without releasing it. This scenario introduces the risk of a potential
> deadlock when concurrent write locks are applied to the same
> memory_hotplug_lock. To address this locally, we resolved the issue by
> replacing rte_memseg_list_walk() with rte_memseg_list_walk_thread_unsafe().

recursive read locks are bad idea and the fact that it worked before was
an accident.

Please send patch for review.

      reply	other threads:[~2023-08-23 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 14:02 bugzilla
2023-08-23 14:56 ` Stephen Hemminger [this message]

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=20230823075616.45b2f971@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bugzilla@dpdk.org \
    --cc=dev@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).