]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
net: cacheline adjust struct inet_frag_queue
authorJesper Dangaard Brouer <brouer@redhat.com>
Mon, 28 Jan 2013 23:44:49 +0000 (23:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jan 2013 18:36:23 +0000 (13:36 -0500)
Fragmentation code cacheline adjusting of struct inet_frag_queue.

Take advantage of the size of struct timer_list, and move all but
spinlock_t lock, below the timer struct.  On 64-bit 'lru_list',
'list' and 'refcnt', fits exactly into the next cacheline, and a
new cacheline starts at 'fragments'.

The netns_frags *net pointer is moved to the end of the struct,
because its used in a compare, with "next/close-by" elements of
which this struct is embedded into.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_frag.h

index 54c1de781c681a63309bb96c6f27afba5308f950..8e4c42523f59a1aaf30edfc69274f33a6737e74f 100644 (file)
@@ -16,12 +16,11 @@ struct netns_frags {
 };
 
 struct inet_frag_queue {
-       struct hlist_node       list;
-       struct netns_frags      *net;
-       struct list_head        lru_list;   /* lru list member */
        spinlock_t              lock;
-       atomic_t                refcnt;
        struct timer_list       timer;      /* when will this queue expire? */
+       struct list_head        lru_list;   /* lru list member */
+       struct hlist_node       list;
+       atomic_t                refcnt;
        struct sk_buff          *fragments; /* list of received fragments */
        struct sk_buff          *fragments_tail;
        ktime_t                 stamp;
@@ -34,6 +33,8 @@ struct inet_frag_queue {
 #define INET_FRAG_LAST_IN      1
 
        u16                     max_size;
+
+       struct netns_frags      *net;
 };
 
 #define INETFRAGS_HASHSZ               64