Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] tcp/dccp: remove twchain
Date: Thu, 3 Oct 2013 21:04:45 +0100	[thread overview]
Message-ID: <1380830685.3419.13.camel@bwh-desktop.uk.level5networks.com> (raw)
In-Reply-To: <1380784922.19002.198.camel@edumazet-glaptop.roam.corp.google.com>

On Thu, 2013-10-03 at 00:22 -0700, Eric Dumazet wrote:
[...]
> @@ -146,26 +150,21 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
>  	spin_lock(lock);
>  
>  	/*
> -	 * Step 2: Hash TW into TIMEWAIT chain.
> -	 * Should be done before removing sk from established chain
> -	 * because readers are lockless and search established first.
> +	 * Step 2: Hash TW into tcp ehash chain.
> +	 * Notes :
> +	 * - tw_refcnt is set to 3 because :
> +	 * - We have one reference from bhash chain.
> +	 * - We have one reference from ehash chain.
> +	 * We can use atomic_set() because prior spin_lock()/spin_unlock()
> +	 * committed into memory all tw fields.
>  	*/
> -	inet_twsk_add_node_rcu(tw, &ehead->twchain);
> +	atomic_set(&tw->tw_refcnt, 1 + 1 + 1);
> +	inet_twsk_add_node_rcu(tw, &ehead->chain);
[...]

'will commit' rather than 'committed'?

But isn't this also a separate optimisation?

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2013-10-03 20:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03  7:22 [PATCH net-next] tcp/dccp: remove twchain Eric Dumazet
2013-10-03 20:04 ` Ben Hutchings [this message]
2013-10-03 20:31   ` Eric Dumazet
2013-10-03 21:51 ` David Miller
2013-10-03 21:58   ` Eric Dumazet
2013-10-03 22:45     ` David Miller

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=1380830685.3419.13.camel@bwh-desktop.uk.level5networks.com \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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