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 <[email protected]>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to