public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, ling.ma.program@gmail.com,
	joe@perches.com, bhutchings@solarflare.com
Subject: Re: [PATCH v2 net-next] net: move inet_dport/inet_num in sock_common
Date: Wed, 28 Nov 2012 11:48:35 -0500 (EST)	[thread overview]
Message-ID: <20121128.114835.1005932954047935079.davem@davemloft.net> (raw)
In-Reply-To: <1354107378.14302.149.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 28 Nov 2012 04:56:18 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> commit 68835aba4d9b (net: optimize INET input path further)
> moved some fields used for tcp/udp sockets lookup in the first cache
> line of struct sock_common.
> 
> This patch moves inet_dport/inet_num as well, filling a 32bit hole
> on 64 bit arches and reducing number of cache line misses.
> 
> Also change INET_MATCH()/INET_TW_MATCH() to perform the ports match
> before addresses match, as this check is more discriminant.
> 
> Remove the hash check from MATCH() macros because we dont need to
> re validate the hash value after taking a refcount on socket, and
> use likely/unlikely compiler hints, as the sk_hash/hash check
> makes the following conditional tests 100% predicted by cpu.
> 
> Introduce skc_addrpair/skc_portpair pair values to better
> document the alignment requirements of the port/addr pairs
> used in the various MATCH() macros, and remove some casts.
> 
> The namespace check can also be done at last.
> 
> This slightly improves TCP/UDP lookup times.
> 
> With help from Ben Hutchings & Joe Perches.
> 
> Idea of this patch came after Ling Ma proposal to move skc_hash
> to the beginning of struct sock_common, and should allow him
> to submit a final version of his patch.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

I like this a lot, applied, thanks Eric!

  reply	other threads:[~2012-11-28 16:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 15:06 [PATCH net-next] net: move inet_dport/inet_num in sock_common Eric Dumazet
2012-11-27 17:23 ` Joe Perches
2012-11-27 21:24   ` Eric Dumazet
2012-11-28  2:23     ` Joe Perches
2012-11-28  3:12       ` Ben Hutchings
2012-11-28  3:31         ` Joe Perches
2012-11-28  3:55           ` Ben Hutchings
2012-11-28  4:11       ` Eric Dumazet
2012-11-28 11:27         ` Eric Dumazet
2012-11-28 12:56           ` [PATCH v2 " Eric Dumazet
2012-11-28 16:48             ` David Miller [this message]
2012-11-28 17:02               ` David Miller
2012-11-28 17:18                 ` Eric Dumazet
2012-11-28 18:20             ` Eric Dumazet
2012-11-27 19:05 ` [PATCH " Ben Hutchings
2012-11-27 21:23   ` Eric Dumazet
2012-11-28  3:13     ` Eric Dumazet

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=20121128.114835.1005932954047935079.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bhutchings@solarflare.com \
    --cc=eric.dumazet@gmail.com \
    --cc=joe@perches.com \
    --cc=ling.ma.program@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