Skip to content

Commit c894504

Browse files
Florian Westphaldavem330
authored andcommitted
sched: place state, next_sched and gso_skb in same cacheline again
Earlier commits removed two members from struct Qdisc which places next_sched/gso_skb into a different cacheline than ->state. This restores the struct layout to what it was before the removal. Move the two members, then add an annotation so they all reside in the same cacheline. This adds a 16 byte hole after cpu_qstats. The hole could be closed but as it doesn't decrease total struct size just do it this way. Reported-by: Eric Dumazet <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a09ceb0 commit c894504

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/net/sch_generic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ struct Qdisc {
7171
struct gnet_stats_basic_cpu __percpu *cpu_bstats;
7272
struct gnet_stats_queue __percpu *cpu_qstats;
7373

74-
struct Qdisc *next_sched;
75-
struct sk_buff *gso_skb;
7674
/*
7775
* For performance sake on SMP, we put highly modified fields at the end
7876
*/
77+
struct Qdisc *next_sched ____cacheline_aligned_in_smp;
78+
struct sk_buff *gso_skb;
7979
unsigned long state;
8080
struct sk_buff_head q;
8181
struct gnet_stats_basic_packed bstats;

0 commit comments

Comments
 (0)