public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: hadi@cyberus•ca, David Miller <davem@davemloft•net>,
	netdev <netdev@vger•kernel.org>
Subject: Re: [PATCH net-next V3] net: dynamic ingress_queue allocation
Date: Mon, 4 Oct 2010 14:06:27 +0200	[thread overview]
Message-ID: <20101004120626.GA2022@del.dom.local> (raw)
In-Reply-To: <1286181729.18293.8.camel@edumazet-laptop>

On Mon, Oct 04, 2010 at 10:42:09AM +0200, Eric Dumazet wrote:
> Le dimanche 03 octobre 2010 ?? 11:42 +0200, Jarek Poplawski a écrit :
> 
> > I'd consider rcu_dereference_rtnl(). Btw, technically qdisc_lookup()
> > doesn't require rtnl, and there was time it was used without it
> > (on xmit path).
> 
> 
> Hmm, for me, rcu_dereference_rtnl() is a bit lazy.
> 
> Either we are a reader and should use rcu_dereference(), or a writer and
> RTNL should be held.
> 
> Mixing two conditions in a "super macro" is a workaround that we used to
> promptly shutup some lockdep splats. Real fix would be to use strict
> lockdep conditions, because this better documents the code and the
> locking invariants.
> 
> BTW, rtnl_dereference() should be changed to use
> rcu_dereference_protected() instead of rcu_dereference_check() :
> If RTBL is held, there is no need to force a barrier.

Actually, I'm one of those (convinced by Patrick btw), who consider
rcu_dereference() on the clear update side as misleading, so I'm not
rtnl_dereference() fan with or without changes.

> 
> 
> > I think you should also add a comment here why this rcu is used, and
> > that it changes only once in dev's liftime.
> > 
> 
> This comment was needed in the previous version of the patch, with the
> smb_wmb() barrier. Now I switched to regular rcu use, nothing prevents
> us to change dev->ingress_queue in flight. Of course there is no current
> interest doing so.

Right, but then at least in qdisc_lookup():

if (dev_ingress_queue(dev))
	q = qdisc_match_from_root(dev_ingress_queue(dev), handle);

you should use a variable instead of the second dereference (rtnl isn't
mandatory here).

Jarek P.

  parent reply	other threads:[~2010-10-04 12:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 15:58 [PATCH net-next2.6] net: rename netdev rx_queue to ingress_queue Eric Dumazet
2010-09-28 18:04 ` Jarek Poplawski
2010-09-29 10:56   ` jamal
2010-09-29 13:18     ` Jarek Poplawski
2010-09-29 16:54       ` Jarek Poplawski
2010-09-30 22:58     ` [PATCH net-next2.6] net: dynamic ingress_queue allocation Eric Dumazet
2010-10-01 11:45       ` jamal
2010-10-01 13:56         ` [PATCH net-next V2] " Eric Dumazet
2010-10-02  9:32           ` Jarek Poplawski
2010-10-02 16:11             ` [PATCH net-next V3] " Eric Dumazet
2010-10-03  9:42               ` Jarek Poplawski
2010-10-03 13:10                 ` jamal
2010-10-04  8:42                 ` Eric Dumazet
2010-10-04  9:00                   ` [PATCH net-next] net: relax rtnl_dereference() Eric Dumazet
2010-10-05  7:29                     ` David Miller
2010-10-04 12:06                   ` Jarek Poplawski [this message]
2010-10-04 12:52                     ` [PATCH net-next V3] net: dynamic ingress_queue allocation Eric Dumazet
2010-10-04 14:24                       ` Jarek Poplawski
2010-10-04 15:21                         ` Eric Dumazet
2010-10-05  7:24               ` David Miller
2010-10-05  7:31                 ` Eric Dumazet
2010-10-02 12:10           ` [PATCH net-next V2] " jamal
2010-09-29 20:27 ` [PATCH net-next2.6] net: rename netdev rx_queue to ingress_queue 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=20101004120626.GA2022@del.dom.local \
    --to=jarkao2@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=hadi@cyberus$(echo .)ca \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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