From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: Neil Horman <nhorman@tuxdriver.com>,
Jiri Pirko <jpirko@redhat.com>,
Eric Dumazet <dada1@cosmosbay.com>,
netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] dropmon: add ability to detect when hardware dropsrxpackets
Date: Fri, 15 May 2009 17:07:44 -0700 [thread overview]
Message-ID: <20090516000744.GE6759@linux.vnet.ibm.com> (raw)
In-Reply-To: <20090515114029.GB6807@ff.dom.local>
On Fri, May 15, 2009 at 11:40:29AM +0000, Jarek Poplawski wrote:
> On Fri, May 15, 2009 at 07:15:30AM -0400, Neil Horman wrote:
> > On Fri, May 15, 2009 at 11:12:14AM +0000, Jarek Poplawski wrote:
> > > On Fri, May 15, 2009 at 07:01:41AM -0400, Neil Horman wrote:
> > > > On Fri, May 15, 2009 at 05:49:47AM +0000, Jarek Poplawski wrote:
> > > ...
> > > > > IMHO it looks worse now. rcu_read_lock() suggests it's a read side,
> > > > > and spin_lock(&trace_state_lock) protects something else.
> > > > >
> > > > the read lock is required (according to the comments for the list loop
> > > > primitive) to protect against the embedded mutation primitive, so its required.
> > > > I understand that its a bit counterintuitive, but intuition takes a backseat to
> > > > functionality. :)
> > > > Neil
> > > >
> > >
> > > I guess, you missed:
> > >
> > > > Looks good from an RCU viewpoint!
> > > >
> > > > Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > >
> > > for the previous version...
> > >
> > I didn't, our comments passed in flight. Nevertheless, I'm not sure what this
> > adds (other than additional overhead), which I agree is bad and so might should
> > be removed, but there are some outstanding questions regarding if it is needed
> > in relation to the list primitives I'm using here. According to Eric,
> > list_for_each_entry_safe might be less intrusive here, and I'm trying to figure
> > out if I agree. :)
> > Neil
>
> Paul "acked" two variants, and Eric prefers one of them. Adding
> rcu_read_lock() makes sense only "If this code was shared between the
> read side and the update side". Anyway it would need additional
> comment. Otherwise it's misleading (but not wrong). And, since Paul
> reviewed this, it's definitely not needed here because Paul is simply
> always right ;-)
Much as I appreciate the vote of confidence... ;-)
I believe that both versions work correctly, and that the difference
is therefore a matter of style. My mild preference would be to use
rcu_read_lock() only if there was some possibility that a reader (some
task not holding the update-side lock) would execute this code.
Thanx, Paul
next prev parent reply other threads:[~2009-05-16 0:07 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 19:50 [PATCH] dropmon: add ability to detect when hardware drops rx packets Neil Horman
2009-05-09 6:30 ` Eric Dumazet
2009-05-09 18:07 ` Neil Horman
2009-05-12 16:30 ` Neil Horman
2009-05-13 18:23 ` [PATCH] dropmon: add ability to detect when hardware drops rxpackets Paul E. McKenney
2009-05-14 0:45 ` Neil Horman
2009-05-14 1:03 ` [PATCH] dropmon: add ability to detect when hardware dropsrxpackets Paul E. McKenney
2009-05-14 12:33 ` Neil Horman
2009-05-14 12:44 ` Jiri Pirko
2009-05-14 16:17 ` [PATCH] dropmon: add ability to detect when hardwaredropsrxpackets Paul E. McKenney
2009-05-14 17:29 ` [PATCH] dropmon: add ability to detect when hardware dropsrxpackets Neil Horman
2009-05-15 5:49 ` Jarek Poplawski
2009-05-15 11:01 ` Neil Horman
2009-05-15 11:12 ` Jarek Poplawski
2009-05-15 11:15 ` Neil Horman
2009-05-15 11:40 ` Jarek Poplawski
2009-05-16 0:07 ` Paul E. McKenney [this message]
2009-05-15 6:51 ` Jiri Pirko
2009-05-15 7:37 ` Eric Dumazet
2009-05-15 11:12 ` Neil Horman
2009-05-15 10:59 ` Neil Horman
2009-05-15 11:27 ` Jiri Pirko
2009-05-15 16:07 ` Neil Horman
2009-05-15 18:11 ` Eric Dumazet
2009-05-15 18:23 ` Stephen Hemminger
2009-05-15 19:53 ` Neil Horman
2009-05-15 19:23 ` Neil Horman
2009-05-16 12:40 ` Neil Horman
2009-05-18 14:46 ` Neil Horman
2009-05-21 7:17 ` David Miller
2009-05-21 17:36 ` Neil Horman
2009-05-21 22:15 ` David Miller
2009-05-22 0:09 ` Neil Horman
2009-05-15 18:18 ` Stephen Hemminger
2009-05-15 19:12 ` Neil Horman
2009-05-14 16:18 ` [PATCH] dropmon: add ability to detect when hardwaredropsrxpackets Paul E. McKenney
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=20090516000744.GE6759@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=jarkao2@gmail.com \
--cc=jpirko@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.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).