From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Vlad Yasevich <vladislav.yasevich@hp.com>
Cc: Sridhar Samudrala <sri@us.ibm.com>,
netdev@vger.kernel.org, lksctp-developers@lists.sourceforge.net
Subject: Re: [RFC PATCH 1/2] SCTP: Add RCU synchronization around sctp_localaddr_list
Date: Wed, 12 Sep 2007 08:20:58 -0700 [thread overview]
Message-ID: <20070912152058.GB9830@linux.vnet.ibm.com> (raw)
In-Reply-To: <46E6A096.9010208@hp.com>
On Tue, Sep 11, 2007 at 10:05:10AM -0400, Vlad Yasevich wrote:
> Sridhar, Paul
>
> Thanks for review. Some answers and questions below...
NP!
> Sridhar Samudrala wrote:
> > Paul E. McKenney wrote:
[ . . . ]
> >>> if ((PF_INET == sk->sk_family) &&
> >>> (AF_INET6 == addr->a.sa.sa_family))
> >>> continue;
> >>> +
> >>> cnt++;
> >>> }
> >>> + rcu_read_unlock();
> >>
> >> We are just counting these things, right? If on the other hand we are
> >> keeping a reference outside of rcu_read_lock() protection, then there
> >> needs to be some explicit mechanism preventing the corresponding entry
> >> from being freed.
>
> In this particular case, we are just counting. There are other cases,
> we make a copy of the address in the list. The goal was to reduce the
> probability that an address that is about to be deleted at the rcu
> quiescent state will not be copied/counted.
>
> My other thought was to use atomics, but with all the yelling about atomic_read(),
> that didn't seem any better then a simple __u8 flag.
If just counting, then no worries either way. As long as you are counting
to a local variable, as in fact you are.
Thanx, Paul
next prev parent reply other threads:[~2007-09-12 15:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-10 19:46 [RFC PATH 0/2] Add RCU locking to SCTP address management Vlad Yasevich
2007-09-10 19:46 ` [RFC PATCH 1/2] SCTP: Add RCU synchronization around sctp_localaddr_list Vlad Yasevich
2007-09-10 21:47 ` Paul E. McKenney
2007-09-11 7:24 ` Sridhar Samudrala
2007-09-11 14:05 ` Vlad Yasevich
2007-09-12 15:20 ` Paul E. McKenney [this message]
2007-09-10 19:46 ` [RFC PATCH 2/2] SCTP: Convert bind_addr_list locking to RCU Vlad Yasevich
2007-09-10 22:08 ` Paul E. McKenney
2007-09-11 14:56 ` Vlad Yasevich
2007-09-12 16:50 ` 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=20070912152058.GB9830@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=lksctp-developers@lists.sourceforge.net \
--cc=netdev@vger.kernel.org \
--cc=sri@us.ibm.com \
--cc=vladislav.yasevich@hp.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).