Skip to content

Commit 6e34a8b

Browse files
netoptimizerdavem330
authored andcommitted
net: cacheline adjust struct inet_frag_queue
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5f8e1e8 commit 6e34a8b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

include/net/inet_frag.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ struct netns_frags {
1616
};
1717

1818
struct inet_frag_queue {
19-
struct hlist_node list;
20-
struct netns_frags *net;
21-
struct list_head lru_list; /* lru list member */
2219
spinlock_t lock;
23-
atomic_t refcnt;
2420
struct timer_list timer; /* when will this queue expire? */
21+
struct list_head lru_list; /* lru list member */
22+
struct hlist_node list;
23+
atomic_t refcnt;
2524
struct sk_buff *fragments; /* list of received fragments */
2625
struct sk_buff *fragments_tail;
2726
ktime_t stamp;
@@ -34,6 +33,8 @@ struct inet_frag_queue {
3433
#define INET_FRAG_LAST_IN 1
3534

3635
u16 max_size;
36+
37+
struct netns_frags *net;
3738
};
3839

3940
#define INETFRAGS_HASHSZ 64

0 commit comments

Comments
 (0)