public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks•com>
To: zyjzyj2000@gmail•com, j.vosburgh@gmail•com, vfalico@gmail•com,
	gospo@cumulusnetworks•com, netdev@vger•kernel.org
Subject: Re: [PATCH 1/1] bond: relocate rcu_read_lock and rcu_read_unlock
Date: Mon, 1 Feb 2016 12:08:05 +0100	[thread overview]
Message-ID: <56AF3C95.3040606@cumulusnetworks.com> (raw)
In-Reply-To: <56AF3B24.7000207@cumulusnetworks.com>

On 02/01/2016 12:01 PM, Nikolay Aleksandrov wrote:
> On 02/01/2016 04:31 AM, zyjzyj2000@gmail•com wrote:
>> From: Zhu Yanjun <zyjzyj2000@gmail•com>
>>
>> rcu_read_lock and rcu_read_unlock are to protect the function
>> bond_miimon_inspect. As such, moving rcu_read_lock and rcu_read_unlock
>> to the function bond_miimon_inspect to make the source code compact.
>>
>> CC: Jay Vosburgh <j.vosburgh@gmail•com>
>> CC: Veaceslav Falico <vfalico@gmail•com>
>> CC: Andy Gospodarek <gospo@cumulusnetworks•com>
>> Signed-off-by: Zhu Yanjun <zyjzyj2000@gmail•com>
>> ---
>>  drivers/net/bonding/bond_main.c | 9 ++++-----
>>  1 file changed, 4 insertions(+), 5 deletions(-)
>>
> 
> Not true, RCU also protects the slave dereference in bond_should_notify_peers().
> Even though there's already a rcu_read_lock() while doing the dereference
> itself, it is there only to please RCU, IIRC. The only "simplification" you

Err, I meant to please lockdep when being called with RTNL.

> can do is remove the rcu_read_lock/unlock() around the slave deref in
> bond_should_notify_peers and use rcu_dereference_rtnl() as it can be used either
> in RCU protected region or with RTNL held. Also I think net-next is still
> closed (and that's where this should be targeted at).
> 
> Cheers,
>  Nik
> 
> 

      reply	other threads:[~2016-02-01 11:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01  3:31 [PATCH 1/1] bond: relocate rcu_read_lock and rcu_read_unlock zyjzyj2000
2016-02-01 11:01 ` Nikolay Aleksandrov
2016-02-01 11:08   ` Nikolay Aleksandrov [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=56AF3C95.3040606@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks$(echo .)com \
    --cc=gospo@cumulusnetworks$(echo .)com \
    --cc=j.vosburgh@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=vfalico@gmail$(echo .)com \
    --cc=zyjzyj2000@gmail$(echo .)com \
    /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