[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1226583265.7685.4797.camel@twins>
Date: Thu, 13 Nov 2008 14:34:25 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Eric Dumazet <dada1@...mosbay.com>
Cc: David Miller <davem@...emloft.net>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Corey Minyard <minyard@....org>,
Stephen Hemminger <shemminger@...tta.com>,
benny+usenet@...rsen.dk,
Linux Netdev List <netdev@...r.kernel.org>,
Christoph Lameter <cl@...ux-foundation.org>,
Evgeniy Polyakov <zbr@...emap.net>,
Christian Bell <christian@...i.com>
Subject: Re: [PATCH 3/3] net: Convert TCP & DCCP hash tables to use RCU /
hlist_nulls
On Thu, 2008-11-13 at 14:15 +0100, Eric Dumazet wrote:
> +begin:
> + sk_nulls_for_each_rcu(sk, node, &head->chain) {
> if (INET_MATCH(sk, net, hash, acookie,
> + saddr, daddr, ports, dif)) {
> + if (unlikely(!atomic_inc_not_zero(&sk->sk_refcnt)))
> + goto begintw;
> + if (unlikely(!INET_MATCH(sk, net, hash, acookie,
> + saddr, daddr, ports, dif))) {
> + sock_put(sk);
> + goto begin;
> + }
This is the validation step that verifies the race opened by using
SLAB_DESTROY_BY_RCU, right?
Does it make sense to add a little comment to these validation steps to
keep people on their toes and aware of the trickery?
> + goto out;
> + }
> }
> + /*
> + * if the nulls value we got at the end of this lookup is
> + * not the expected one, we must restart lookup.
> + * We probably met an item that was moved to another chain.
> + */
> + if (get_nulls_value(node) != slot)
> + goto begin;
>
--
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