DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, probb@iol.unh.edu, matan@nvidia.com,
	ferruh.yigit@amd.com,  andrew.rybchenko@oktetlabs.ru,
	anatoly.burakov@intel.com,  bruce.richardson@intel.com
Subject: Re: [PATCH v3 0/3] Release ethdev shared memory on port cleanup
Date: Fri, 1 Sep 2023 09:32:26 +0200	[thread overview]
Message-ID: <CAJFAV8w4dvN2uyYJTyF9hK=JhSSUNJ7AKN9tLvy77cMBJCSvAw@mail.gmail.com> (raw)
In-Reply-To: <3559497.LM0AJKV5NW@thomas>

On Thu, Aug 31, 2023 at 6:14 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 21/08/2023 10:58, David Marchand:
> > This series was triggered after investigating why the
> > eal_flags_file_prefix_autotest unit test was failing in the case of
> > statically built binaries [1]).
> >
> > For now, I went with a simple (naive) approach and put all accesses to the
> > shared data under a single lock: ethdev maintainers, it is your turn to
> > shine and give me reasons why we should keep the locks the way they
> > were ;-).
>
> I think the reasons are:
> - we wanted to call rte_spinlock_init()
> - we didn't want to allocate an ethdev lock in EAL memory config

Hum, it is a choice of implementation, not a list of locking requirements.

As to why we would not want ethdev lock in EAL, I can understand the concern.
This could be enhanced with a new service provided by EAL to register
some space in the shared configuration for use by libraries.
However, seeing how the mempool and timer libraries already had one
lock stored there, I assumed it was ok to do the same.


> How eliminating a lock is making the last patch easier exactly?

Let's say that my goal is to cleanup resources once a DPDK application
exits (no hugepage files left).
Here, it is a first step in that direction, with releasing ethdev
shared mem data.
It is not a complete solution, as other device classes probably have
the same issues of leaving some shared data behind.


The ethdev shared memory hosts ethdev ports, and the ownership notion.
The current code implicitly relies on the assumption that the shared
memory will never go away.
So I had to revisit and protect places accessing this shared memory,
and having one shared lock for protecting access was necessary.
But doing so, the ownership lock would be nested in this global lock
while doing nothing more that the ethdev shared data lock.

I will enhance the patches description.


-- 
David Marchand


  reply	other threads:[~2023-09-01  7:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  9:13 [PATCH 0/2] " David Marchand
2023-08-18  9:13 ` [PATCH 1/2] ethdev: protect shared memory accesses under one lock David Marchand
2023-08-18  9:13 ` [PATCH 2/2] ethdev: cleanup shared data with the last port David Marchand
2023-08-18 11:36   ` David Marchand
2023-08-18 10:18 ` [PATCH 0/2] Release ethdev shared memory on port cleanup Morten Brørup
2023-08-31 15:34   ` Thomas Monjalon
2023-08-18 13:41 ` [PATCH v2 " David Marchand
2023-08-18 13:41   ` [PATCH v2 1/2] ethdev: protect shared memory accesses under one lock David Marchand
2023-08-18 13:41   ` [PATCH v2 2/2] ethdev: cleanup shared data with the last port David Marchand
2023-08-21  8:58 ` [PATCH v3 0/3] Release ethdev shared memory on port cleanup David Marchand
2023-08-21  8:58   ` [PATCH v3 1/3] ethdev: protect shared memory accesses under one lock David Marchand
2023-08-21  8:58   ` [PATCH v3 2/3] ethdev: avoid panicking in absence of ethdev shared data David Marchand
2023-08-21  8:58   ` [PATCH v3 3/3] ethdev: cleanup shared data with the last port David Marchand
2023-08-31 16:05   ` [PATCH v3 0/3] Release ethdev shared memory on port cleanup Thomas Monjalon
2023-09-01  7:32     ` David Marchand [this message]
2023-09-27 11:45 ` [PATCH v4 " David Marchand
2023-09-27 11:45   ` [PATCH v4 1/3] ethdev: protect shared memory accesses under one lock David Marchand
2023-09-27 11:45   ` [PATCH v4 2/3] ethdev: avoid panicking in absence of ethdev shared data David Marchand
2023-09-27 11:45   ` [PATCH v4 3/3] ethdev: cleanup shared data with the last port David Marchand
2023-10-11 12:53   ` [PATCH v4 0/3] Release ethdev shared memory on port cleanup 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='CAJFAV8w4dvN2uyYJTyF9hK=JhSSUNJ7AKN9tLvy77cMBJCSvAw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=matan@nvidia.com \
    --cc=probb@iol.unh.edu \
    --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).