netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <tom@herbertland.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: [PATCH v2 net-next 1/3] net: Add cache alignment in sock_common for socket lookup fields
Date: Tue, 26 May 2015 09:34:07 -0700	[thread overview]
Message-ID: <1432658049-3400132-2-git-send-email-tom@herbertland.com> (raw)
In-Reply-To: <1432658049-3400132-1-git-send-email-tom@herbertland.com>

Use ____cacheline_aligned_in_smp to keep the fields used on socket
lookup in their own cachelines. These are read only fields and will
be often accessed on accross CPUs (would be very common with
SO_REUSEPORT for instance).

Signed-off-by: Tom Herbert <tom@herbertland.com>
---
 include/net/sock.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 26c1c31..bcf6114 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -211,7 +211,13 @@ struct sock_common {
 		struct hlist_node	skc_node;
 		struct hlist_nulls_node skc_nulls_node;
 	};
-	int			skc_tx_queue_mapping;
+
+	/* Cachelines above this point are read mostly and are used in socket
+	 * lookup.
+	 */
+	int			skc_tx_queue_mapping
+				____cacheline_aligned_in_smp;
+
 	atomic_t		skc_refcnt;
 	/* private: */
 	int                     skc_dontcopy_end[0];
-- 
1.8.1

  reply	other threads:[~2015-05-26 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 16:34 [PATCH v2 net-next 0/3] net: Add incoming CPU mask to sockets Tom Herbert
2015-05-26 16:34 ` Tom Herbert [this message]
2015-05-26 17:19   ` [PATCH v2 net-next 1/3] net: Add cache alignment in sock_common for socket lookup fields Eric Dumazet
2015-05-26 17:54     ` Eric Dumazet
2015-05-26 18:02       ` Tom Herbert
2015-05-26 16:34 ` [PATCH v2 net-next 2/3] kernel: Make compat bitmap functions externally visible Tom Herbert
2015-05-26 16:34 ` [PATCH v2 net-next 3/3] net: Add incoming CPU mask to sockets Tom Herbert
2015-05-26 17:18 ` [PATCH v2 net-next 0/3] " Eric Dumazet
2015-05-26 18:00   ` Tom Herbert
2015-05-26 18:19     ` Eric Dumazet
2015-05-26 20:01       ` Tom Herbert
2015-05-26 22:42         ` 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=1432658049-3400132-2-git-send-email-tom@herbertland.com \
    --to=tom@herbertland.com \
    --cc=davem@davemloft.net \
    --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;
as well as URLs for NNTP newsgroup(s).