netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH net-next 2/2] pfifo_fast: drop unneeded additional lock on dequeue
Date: Wed, 16 May 2018 11:57:23 +0200	[thread overview]
Message-ID: <1526464643.2553.27.camel@redhat.com> (raw)
In-Reply-To: <1526457376.2553.1.camel@redhat.com>

On Wed, 2018-05-16 at 09:56 +0200, Paolo Abeni wrote:
> On Tue, 2018-05-15 at 23:17 +0300, Michael S. Tsirkin wrote:
> > On Tue, May 15, 2018 at 04:24:37PM +0200, Paolo Abeni wrote:
> > > After the previous patch, for NOLOCK qdiscs, q->seqlock is
> > > always held when the dequeue() is invoked, we can drop
> > > any additional locking to protect such operation.
> > > 
> > > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > > ---
> > >  include/linux/skb_array.h | 5 +++++
> > >  net/sched/sch_generic.c   | 4 ++--
> > >  2 files changed, 7 insertions(+), 2 deletions(-)
> > 
> > Is the seqlock taken during qdisc_change_tx_queue_len?
> > We need to prevent that racing with dequeue.
> 
> Thanks for the head-up! I missed that code-path.
> 
> I'll add the lock in qdisc_change_tx_queue_len() in v2.

Actually the lock is not needed in qdisc_change_tx_queue_len(): the
device is deactivated before calling ops->change_tx_queue_len, so the
latter can't race with ops->dequeue().

I think the current patch is safe.

Cheers,

Paolo

  reply	other threads:[~2018-05-16  9:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 14:24 [PATCH net-next 0/2] sched: refactor NOLOCK qdiscs Paolo Abeni
2018-05-15 14:24 ` [PATCH net-next 1/2] sched: replace __QDISC_STATE_RUNNING bit with a spin lock Paolo Abeni
2018-05-15 14:24 ` [PATCH net-next 2/2] pfifo_fast: drop unneeded additional lock on dequeue Paolo Abeni
2018-05-15 20:17   ` Michael S. Tsirkin
2018-05-16  7:56     ` Paolo Abeni
2018-05-16  9:57       ` Paolo Abeni [this message]
2018-05-16 14:24       ` Michael S. Tsirkin
2018-05-17 17:06 ` [PATCH net-next 0/2] sched: refactor NOLOCK qdiscs David Miller

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=1526464643.2553.27.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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).