DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Gavin Hu (Arm Technology China)" <Gavin.Hu@arm.com>
To: Darek Stojaczyk <dariusz.stojaczyk@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "james.r.harris@intel.com" <james.r.harris@intel.com>,
	"changpeng.liu@intel.com" <changpeng.liu@intel.com>,
	"anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Subject: Re: [dpdk-dev] [PATCH] fbarray: fix attach deadlock
Date: Fri, 29 Mar 2019 08:53:35 +0000	[thread overview]
Message-ID: <VI1PR08MB3167829DE8D9B7844CDC45818F5A0@VI1PR08MB3167.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20190329050951.153202-1-dariusz.stojaczyk@intel.com>



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Darek Stojaczyk
> Sent: Friday, March 29, 2019 1:10 PM
> To: dev@dpdk.org
> Cc: james.r.harris@intel.com; changpeng.liu@intel.com; Darek Stojaczyk
> <dariusz.stojaczyk@intel.com>; anatoly.burakov@intel.com;
> thomas@monjalon.net
> Subject: [dpdk-dev] [PATCH] fbarray: fix attach deadlock
>
> rte_fbarray_attach() currently locks its internal
> spinlock, but never releases it. Secondary processes
> won't even start if there is more than one fbarray
> to be attached to - the second rte_fbarray_attach()
> would be just stuck.
>
> Fix it by releasing the lock at the end of
> rte_fbarray_attach(). I believe this was the original
> intention.
>
> Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas")
> Cc: anatoly.burakov@intel.com
> Cc: thomas@monjalon.net
>
> Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
> ---
>  lib/librte_eal/common/eal_common_fbarray.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/librte_eal/common/eal_common_fbarray.c
> b/lib/librte_eal/common/eal_common_fbarray.c
> index 0e7366e5e..5ca8d6f0e 100644
> --- a/lib/librte_eal/common/eal_common_fbarray.c
> +++ b/lib/librte_eal/common/eal_common_fbarray.c
> @@ -906,6 +906,7 @@ rte_fbarray_attach(struct rte_fbarray *arr)
>
>  /* we're done */
>
> +rte_spinlock_unlock(&mem_area_lock);
>  return 0;
>  fail:
>  if (data)
> @@ -913,6 +914,7 @@ rte_fbarray_attach(struct rte_fbarray *arr)
>  if (fd >= 0)
>  close(fd);
>  free(ma);
> +rte_spinlock_unlock(&mem_area_lock);
>  return -1;
>  }

This is an obvious issue, good catch!
Reviewed-by: Gavin Hu <gavin.hu@arm.com>

> --
> 2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

  parent reply	other threads:[~2019-03-29  8:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29  5:09 Darek Stojaczyk
2019-03-29  5:09 ` Darek Stojaczyk
2019-03-29  8:53 ` Gavin Hu (Arm Technology China) [this message]
2019-03-29  8:53   ` Gavin Hu (Arm Technology China)
2019-03-29  9:52 ` [dpdk-dev] [PATCH v2] " Darek Stojaczyk
2019-03-29  9:52   ` Darek Stojaczyk
2019-03-29 10:42   ` Burakov, Anatoly
2019-03-29 10:42     ` Burakov, Anatoly
2019-03-29 11:15     ` Thomas Monjalon
2019-03-29 11:15       ` Thomas Monjalon

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=VI1PR08MB3167829DE8D9B7844CDC45818F5A0@VI1PR08MB3167.eurprd08.prod.outlook.com \
    --to=gavin.hu@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=anatoly.burakov@intel.com \
    --cc=changpeng.liu@intel.com \
    --cc=dariusz.stojaczyk@intel.com \
    --cc=dev@dpdk.org \
    --cc=james.r.harris@intel.com \
    --cc=thomas@monjalon.net \
    /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).