b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] Initial rcu locking patchset
@ 2010-09-16 20:18 Sven Eckelmann
  2010-09-16 20:18 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: Introduce if_list_lock to protect if_list Sven Eckelmann
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Sven Eckelmann @ 2010-09-16 20:18 UTC (permalink / raw)
  To: b.a.t.m.a.n

Hi,

I tried to check through the code and identify problems not yet mentioned by
Paul E. McKenney. They were found by reading through
Documentation/RCU/checklist.txt and related documents in the folder.

It doesn't address the reference counting problem for gw_nodes and interfaces.
Those leaks are happen in gw_election, get_batman_if_by_netdev and
get_active_batman_if. We must increase the refcnt (using atomic_inc) inside the
rcu_read_lock()..rcu_read_unlock() before we attach to the structure it
"leaks". When another function now removed it from its usage context
(primary_if, usage on stack, ...) then atomic_dec_and_test the refcnt. If it is
decremented to zero then we can issue the call_rcu to the freeing function. So
"put" of those functions is not allowed inside an rcu_read_lock. As said before
the hold must always be called inside a rcu_read_lock.

Best regards,
	Sven

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

end of thread, other threads:[~2010-09-17  1:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-16 20:18 [B.A.T.M.A.N.] Initial rcu locking patchset Sven Eckelmann
2010-09-16 20:18 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: Introduce if_list_lock to protect if_list Sven Eckelmann
2010-09-16 20:18 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: Protect update side of gw_list Sven Eckelmann
2010-09-16 20:18 ` [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: Always protect list_for_each_entry_rcu with RCU Sven Eckelmann
2010-09-16 20:18 ` [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: Remove unneeded rcu_read_lock Sven Eckelmann
2010-09-16 21:22 ` [B.A.T.M.A.N.] Adding of basic gw_node/batman_if refcnt Sven Eckelmann
2010-09-17  1:17   ` Sven Eckelmann
2010-09-16 21:22 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Use refcnt to track usage count of gw_node Sven Eckelmann
2010-09-16 21:22 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Use refcnt to track usage count of batman_if Sven Eckelmann
2010-09-16 21:32   ` Sven Eckelmann

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