From: Thomas Monjalon <thomas@monjalon.net>
To: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Cc: dev@dpdk.org, "Burakov, Anatoly" <anatoly.burakov@intel.com>,
rsanford@akamai.com, david.marchand@redhat.com
Subject: Re: [dpdk-dev] [PATCH v3] timer: fix resource leak in finalize
Date: Wed, 05 Jun 2019 11:33:58 +0200 [thread overview]
Message-ID: <4234840.t272voWUu0@xps> (raw)
In-Reply-To: <3809be84-8fa7-b91d-d781-f62e0506f293@intel.com>
09/05/2019 10:29, Burakov, Anatoly:
> On 08-May-19 11:35 PM, Erik Gabriel Carrillo wrote:
> > By using a lock added to the rte_mem_config (which lives in shared
> > memory), we can synchronize multiple processes in init/finalize and
> > safely free allocations made during init.
> >
> > Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
> > ---
> > changes in v3:
> > - The previous version had race condition. This version fixes the race
> > by adding a lock in shared memory outside of the DPDK heap area
> > that can be used to safely free the memzone reserved in the subsystem
> > init call. (Anatoly)
> >
> > This patch depends on http://patches.dpdk.org/patch/53333/.
> >
> > changes in v2:
> > - Handle scenario where primary process exits before secondaries such
> > that memzone is not freed early (Anatoly)
> >
> > lib/librte_eal/common/include/rte_eal_memconfig.h | 3 +++
> > lib/librte_timer/rte_timer.c | 23 ++++++++++++++++++++++-
> > 2 files changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h
> > index 84aabe3..8cbc09c 100644
> > --- a/lib/librte_eal/common/include/rte_eal_memconfig.h
> > +++ b/lib/librte_eal/common/include/rte_eal_memconfig.h
> > @@ -64,6 +64,9 @@ struct rte_mem_config {
> > rte_rwlock_t memory_hotplug_lock;
> > /**< indicates whether memory hotplug request is in progress. */
> >
> > + rte_spinlock_t timer_subsystem_lock;
> > + /**< indicates whether timer subsystem init/finalize is in progress. */
> > +
>
> I believe there's an initialize function somewhere which will initialize
> all of these locks. This lock should be in there as well.
>
> Other than that, i'm OK with this change, however i feel like /just/
> adding this would be a missed opportunity, because next time we want to
> add something here it will be an ABI break again.
>
> We could perhaps use this opportunity to leave some padding for future
> data. I'm not sure how would that look like, just an idea floating in my
> head :)
Any update or other opinion?
next prev parent reply other threads:[~2019-06-05 9:34 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-01 19:00 [dpdk-dev] [PATCH] " Erik Gabriel Carrillo
2019-05-01 19:00 ` Erik Gabriel Carrillo
2019-05-02 9:18 ` Burakov, Anatoly
2019-05-02 9:18 ` Burakov, Anatoly
2019-05-02 12:19 ` Carrillo, Erik G
2019-05-02 12:19 ` Carrillo, Erik G
2019-05-02 13:03 ` Burakov, Anatoly
2019-05-02 13:03 ` Burakov, Anatoly
2019-05-02 13:48 ` Carrillo, Erik G
2019-05-02 13:48 ` Carrillo, Erik G
2019-05-03 22:54 ` [dpdk-dev] [PATCH v2] " Erik Gabriel Carrillo
2019-05-03 22:54 ` Erik Gabriel Carrillo
2019-05-07 11:03 ` Burakov, Anatoly
2019-05-07 11:03 ` Burakov, Anatoly
2019-05-07 22:04 ` Carrillo, Erik G
2019-05-07 22:04 ` Carrillo, Erik G
2019-05-08 8:49 ` Burakov, Anatoly
2019-05-08 8:49 ` Burakov, Anatoly
2019-05-08 23:01 ` Carrillo, Erik G
2019-05-08 23:01 ` Carrillo, Erik G
2019-05-09 7:44 ` Thomas Monjalon
2019-05-09 7:44 ` Thomas Monjalon
2019-05-08 22:35 ` [dpdk-dev] [PATCH v3] " Erik Gabriel Carrillo
2019-05-08 22:35 ` Erik Gabriel Carrillo
2019-05-09 8:29 ` Burakov, Anatoly
2019-05-09 8:29 ` Burakov, Anatoly
2019-06-05 9:33 ` Thomas Monjalon [this message]
2019-06-05 9:47 ` Burakov, Anatoly
2019-06-25 16:11 ` [dpdk-dev] [PATCH 0/2] Fix timer resource leak Anatoly Burakov
2019-07-05 13:20 ` [dpdk-dev] [PATCH v2 0/1] " Anatoly Burakov
2019-07-05 17:22 ` [dpdk-dev] [PATCH v3 " Anatoly Burakov
2019-07-05 17:22 ` [dpdk-dev] [PATCH v3 1/1] timer: fix resource leak in finalize Anatoly Burakov
2019-07-05 22:06 ` Thomas Monjalon
2019-07-05 13:20 ` [dpdk-dev] [PATCH v2 " Anatoly Burakov
2019-06-25 16:11 ` [dpdk-dev] [PATCH 1/2] eal: add internal locks for timer lib into EAL Anatoly Burakov
2019-06-27 18:41 ` Carrillo, Erik G
2019-07-04 9:09 ` David Marchand
2019-07-04 10:44 ` Burakov, Anatoly
2019-06-25 16:11 ` [dpdk-dev] [PATCH 2/2] timer: fix resource leak in finalize Anatoly Burakov
2019-06-27 18:48 ` Carrillo, Erik G
2019-07-04 9:10 ` David Marchand
2019-07-04 10:45 ` Burakov, Anatoly
2019-07-04 10:50 ` David Marchand
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=4234840.t272voWUu0@xps \
--to=thomas@monjalon.net \
--cc=anatoly.burakov@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=erik.g.carrillo@intel.com \
--cc=rsanford@akamai.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 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).