netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, mcroce@redhat.com
Subject: Re: [PATCH net] pktgen: do not sleep with the thread lock held.
Date: Thu, 06 Jun 2019 10:27:10 +0200	[thread overview]
Message-ID: <ded588b08ae052fcb47b78642720f900a7f66c9e.camel@redhat.com> (raw)
In-Reply-To: <20190605.120559.1335640243691845984.davem@davemloft.net>

Hi,

Thank you for the feedback.

On Wed, 2019-06-05 at 12:05 -0700, David Miller wrote:
> From: Paolo Abeni <pabeni@redhat.com>
> Date: Wed,  5 Jun 2019 14:34:46 +0200
> 
> > @@ -3062,20 +3062,49 @@ static int thread_is_running(const struct pktgen_thread *t)
> >       return 0;
> >  }
> >  
> > -static int pktgen_wait_thread_run(struct pktgen_thread *t)
> > +static bool pktgen_lookup_thread(struct pktgen_net *pn, struct pktgen_thread *t)
> > +{
> > +     struct pktgen_thread *tmp;
> > +
> > +     list_for_each_entry(tmp, &pn->pktgen_threads, th_list)
> > +             if (tmp == t)
> > +                     return true;
> > +     return false;
> > +}
> 
> Pointer equality is not object equality.

Indeed. The trick is that pktgen threads are allocated only at net
creation time.

Actaully they are also freed only net exit, so the extra care is not
needed: the current process held a reference to net via fs proxy.

I'll send a v2 cleaning up the unneeded parts and some documenting
comments.

Cheers,

Paolo


      reply	other threads:[~2019-06-06  8:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 12:34 [PATCH net] pktgen: do not sleep with the thread lock held Paolo Abeni
2019-06-05 19:05 ` David Miller
2019-06-06  8:27   ` Paolo Abeni [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=ded588b08ae052fcb47b78642720f900a7f66c9e.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=mcroce@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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).