sctp: Pack dst_cookie into 1st cacheline hole for 64bit host
authorfan.du <fan.du@windriver.com>
Mon, 5 Aug 2013 09:13:03 +0000 (17:13 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Aug 2013 19:20:51 +0000 (12:20 -0700)
As dst_cookie is used in fast path sctp_transport_dst_check.

Before:
struct sctp_transport {
struct list_head           transports;           /*     0    16 */
atomic_t                   refcnt;               /*    16     4 */
__u32                      dead:1;               /*    20:31  4 */
__u32                      rto_pending:1;        /*    20:30  4 */
__u32                      hb_sent:1;            /*    20:29  4 */
__u32                      pmtu_pending:1;       /*    20:28  4 */

/* XXX 28 bits hole, try to pack */

__u32                      sack_generation;      /*    24     4 */

/* XXX 4 bytes hole, try to pack */

struct flowi               fl;                   /*    32    64 */
/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
union sctp_addr            ipaddr;               /*    96    28 */

After:
struct sctp_transport {
struct list_head           transports;           /*     0    16 */
atomic_t                   refcnt;               /*    16     4 */
__u32                      dead:1;               /*    20:31  4 */
__u32                      rto_pending:1;        /*    20:30  4 */
__u32                      hb_sent:1;            /*    20:29  4 */
__u32                      pmtu_pending:1;       /*    20:28  4 */

/* XXX 28 bits hole, try to pack */

__u32                      sack_generation;      /*    24     4 */
u32                        dst_cookie;           /*    28     4 */
struct flowi               fl;                   /*    32    64 */
/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
union sctp_addr            ipaddr;               /*    96    28 */

Signed-off-by: Fan Du <fan.du@windriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h

index c0f4e29eedd54a0966a448450f4636cb239cc48e..d9c93a77b1a94f5383cf6a93611f1eee79b95cc7 100644 (file)
@@ -782,6 +782,7 @@ struct sctp_transport {
 
        /* Has this transport moved the ctsn since we last sacked */
        __u32 sack_generation;
+       u32 dst_cookie;
 
        struct flowi fl;
 
@@ -946,7 +947,6 @@ struct sctp_transport {
        __u64 hb_nonce;
 
        struct rcu_head rcu;
-       u32 dst_cookie;
 };
 
 struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *,