DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: David Marchand <david.marchand@redhat.com>
Cc: "Dmitry Malloy (MESHCHANINOV)" <dmitrym@microsoft.com>,
	Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>, dev <dev@dpdk.org>,
	dpdk stable <stable@dpdk.org>,
	Qiming Yang <qiming.yang@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Haiyue Wang <haiyue.wang@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 2/2] net/ice: fix leak on thread termination
Date: Fri, 7 May 2021 20:14:46 +0300	[thread overview]
Message-ID: <20210507201446.2d61d59b@sovereign> (raw)
In-Reply-To: <CAJFAV8x9P5gN6rjDC8kgRW618qP2XKZhijn8oQZqvO_-=nFcVQ@mail.gmail.com>

2021-05-07 10:13 (UTC+0200), David Marchand:
> On Thu, May 6, 2021 at 11:45 AM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > A terminated pthread should be joined or detached so that its associated
> > resources are released.
> >
> > The "ice-reset-<vf_id>" threads are used to service some reset task in the
> > background, but they are never joined by the thread that created them.
> > The easiest solution is to detach new threads.  
> 
> Not so "easy" for Windows.
> 
> I think I'll simply #ifndef WINDOWS my addition.
> Maybe the leak does not exist on Windows? but if it does, the
> situation won't change by doing nothing on Windows.
>
> If there is strong objection, I'll need some help to add a
> pthread_detach() wrapper in windows EAL.
> From my quick read at the API, I'd say I need to find the current
> thread handle (via OpenThread) then CloseHandle it.
> But does it work from "pthread_self()" ?
> 
> 
> Since a new API thread is in preparation, the "thread detaching" from
> the pthread API is something to consider.
> I could not find it in Narcissa series.

There is no leak.
On Windows, pthread_t is just a number, not a handle.
pthread_detach can be implemented as a no-op and added to new API.
See also: https://devblogs.microsoft.com/oldnewthing/20100827-00/?p=13023

  reply	other threads:[~2021-05-07 17:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06  9:44 [dpdk-dev] [PATCH 0/2] Thread termination leak fixes David Marchand
2021-05-06  9:44 ` [dpdk-dev] [PATCH 1/2] net/ark: fix leak on thread termination David Marchand
2021-05-11 17:55   ` Ed Czeck
2021-05-06  9:44 ` [dpdk-dev] [PATCH 2/2] net/ice: " David Marchand
2021-05-06 10:31   ` Wang, Haiyue
2021-05-07  8:13   ` [dpdk-dev] [dpdk-stable] " David Marchand
2021-05-07 17:14     ` Dmitry Kozlyuk [this message]
2021-05-11 11:33 ` [dpdk-dev] [PATCH v2 0/2] Thread termination leak fixes David Marchand
2021-05-11 11:33   ` [dpdk-dev] [PATCH v2 1/2] net/ark: fix leak on thread termination David Marchand
2021-05-11 11:33   ` [dpdk-dev] [PATCH v2 2/2] net/ice: " David Marchand
2021-05-11 17:34     ` Dmitry Kozlyuk
2021-05-11 21:41   ` [dpdk-dev] [PATCH v2 0/2] Thread termination leak fixes Ferruh Yigit

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=20210507201446.2d61d59b@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dmitrym@microsoft.com \
    --cc=haiyue.wang@intel.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --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).