From: Thomas Monjalon <thomas@monjalon.net>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, james.r.harris@intel.com
Subject: Re: [dpdk-dev] [PATCH] mem: fix deadlock on secondary allocation
Date: Sat, 30 Jan 2021 00:37:51 +0100 [thread overview]
Message-ID: <3438169.Cr2niX57Iq@thomas> (raw)
In-Reply-To: <da3d4f77-600b-d403-18cc-d513a38cf193@intel.com>
29/01/2021 17:07, Burakov, Anatoly:
> On 29-Jan-21 3:40 PM, Thomas Monjalon wrote:
> > 29/01/2021 16:29, Anatoly Burakov:
> >> Previous fix used `rte_malloc_heap_socket_is_external()` to check if the
> >> heap was an external heap. However, that API is thread-safe, and when
> >> we're inside the allocation process, we're already write-locked, so
> >> calling `rte_malloc_heap_socket_is_external()` will result in a
> >> deadlock followed by a timeout.
> >>
> >> Fix it by replacing the API call with a check against maximum number of
> >> NUMA nodes, because external heaps always have higher socket ID's.
> >
> > Is there some unit tests for such thing?
>
> I couldn't reproduce this using autotests, but Jim has SPDK tests which
> triggered this error.
>
> Since this is dependent upon secondary process, any test would
> necessarily have to be manual here, i think.
>
> >> Fixes: 7ac31e82bc8f ("mem: improve parameter checking on memory hotplug")
> >>
> >> Reported-by: Jim Harris <james.r.harris@intel.com>
> >>
> >
> > No need of blank line here.
>
> Need to update my scripts :P
>
> >> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> >> ---
[...]
> >> + /*
> >> + * for allocations, we must only use internal heaps, but since the
> >> + * rte_malloc_heap_socket_is_external() is thread-safe and we're already
> >> + * read-locked, we'll have to take advantage of the fac that internal
> >
> > fac -> fact?
>
> Yes.
>
> >> + * socket ID's are always lower than RTE_MAX_NUMA_NODES.
> >> + */
Applied with minor changes, thanks.
prev parent reply other threads:[~2021-01-29 23:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-29 15:29 [dpdk-dev] [PATCH] mem: fix deadlock on secondary allocation Anatoly Burakov
2021-01-29 15:40 ` Thomas Monjalon
2021-01-29 16:07 ` Burakov, Anatoly
2021-01-29 23:37 ` Thomas Monjalon [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=3438169.Cr2niX57Iq@thomas \
--to=thomas@monjalon.net \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=james.r.harris@intel.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.