netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATH 0/2] Add RCU locking to SCTP address management
@ 2007-09-10 19:46 Vlad Yasevich
  2007-09-10 19:46 ` [RFC PATCH 1/2] SCTP: Add RCU synchronization around sctp_localaddr_list Vlad Yasevich
  2007-09-10 19:46 ` [RFC PATCH 2/2] SCTP: Convert bind_addr_list locking to RCU Vlad Yasevich
  0 siblings, 2 replies; 10+ messages in thread
From: Vlad Yasevich @ 2007-09-10 19:46 UTC (permalink / raw)
  To: netdev; +Cc: lksctp-developers

Hi All

This is my first attempt to add RCU synchronization to pieces of SCTP
and I want to make sure I do this right.

The RCU docs a somewhat outdated, and the calling conventions differ
between subsystems, so I am using what I've been able to find.

A bit of a background...

The whole problem started with a panic that led me to NULL deref while
walking a global list of addresses that SCTP maitains.  That list
is modified curing the NETDEV_UP and NETDEV_DOWN notifier processing
and all readers are run in user context.  It looks like the list was
modified while a user app was walking it and we crashed.

Easy enough to fix by adding locking.  However, some notifiers
(ipv6 addrconf) run in atomic context and it says that they can't sleep.
(Q1.  Why are ipv6 notifiers atomic, while IPv4 notifires are blocking?)

So, I decided to add RCU locking around that list.  These events are
already synchronized, so no additional locking on the writer side are need,
so should be make for a nice RCU conversion.

While doing this conversion, I saw that the same structures are used to
maintain a list of bound addresses.  This seemed like another opportunity
to use RCU.  In this case, the readers are wide spread, but there are
only 2 wirters: BH processing of specific chunks, and bind() calls.
Again the writers are already synchronized on the socket lock, so they
will keep out of each others way.  Readers are widespread, but rcu takes
care of that nicely.

So, can folks please take a look and make sure I didn't mess up the
rcu conventions.

Thanks a lot
-vlad

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-09-12 16:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).