[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200912092349.26264.opurdila@ixiacom.com>
Date: Wed, 9 Dec 2009 23:49:26 +0200
From: Octavian Purdila <opurdila@...acom.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [RFC PATCH] llc: convert the socket list to RCU locking (was Re: [PATCH 3/4] llc: use a device based hash table to speed up multicast delivery)
On Wednesday 09 December 2009 22:36:06 you wrote:
> I think I have everything (in my head :) ) that I need now to come back
> with a v2 llc patch set now.
Hmm, not really :) I still can't see how we can do multicast delivery only with RCU when we need to restart the lookup.
I think you mentioned that it is actually possible to do this for UDP, but I didn't found out how :-?
Also, I think we need to restart the lookup even when only one list is used, when we found out that the object is either free or not the one we were looking for, since the current object might have been added to the end of the
list, thus short circuiting our search. E.g.:
@@ -323,14 +323,16 @@ static struct sock *llc_lookup_dgram(struct llc_sap *sap,
struct hlist_nulls_node *node;
rcu_read_lock_bh();
+again:
sk_nulls_for_each_rcu(rc, node, &sap->sk_list) {
+ if (llc_sk(rc)->sap != sap)
+ goto again;
if (llc_dgram_match(sap, laddr, rc)) {
/* Extra checks required by SLAB_DESTROY_BY_RCU */
if (unlikely(!atomic_inc_not_zero(&rc->sk_refcnt)))
- continue;
+ goto again;
if (unlikely(!llc_dgram_match(sap, laddr, rc))) {
sock_put(rc);
- continue;
+ goto again;
}
goto found;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists