Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hfsc: reduce hfsc_sched to 14 cachelines

hfsc_sched is huge (size: 920, cachelines: 15), but we can get it to 14
cachelines by placing level after filter_cnt (covering 4 byte hole) and
reducing period/nactive/flags to u32 (period is just a counter,
incremented when class becomes active -- 2**32 is plenty for this
purpose, also, long is only 32bit wide on 32bit platforms anyway).

cl_vtperiod is exported to userspace via tc_hfsc_stats, but its period
member is already u32, so no precision is lost there either.

Cc: Michal Soltys <soltys@ziu.info>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Florian Westphal and committed by
David S. Miller
bba7eb5d a90a6e55

+5 -5
+5 -5
net/sched/sch_hfsc.c
··· 115 115 struct gnet_stats_basic_packed bstats; 116 116 struct gnet_stats_queue qstats; 117 117 struct gnet_stats_rate_est64 rate_est; 118 - unsigned int level; /* class level in hierarchy */ 119 118 struct tcf_proto __rcu *filter_list; /* filter list */ 120 119 unsigned int filter_cnt; /* filter count */ 120 + unsigned int level; /* class level in hierarchy */ 121 121 122 122 struct hfsc_sched *sched; /* scheduler data */ 123 123 struct hfsc_class *cl_parent; /* parent class */ ··· 165 165 struct runtime_sc cl_virtual; /* virtual curve */ 166 166 struct runtime_sc cl_ulimit; /* upperlimit curve */ 167 167 168 - unsigned long cl_flags; /* which curves are valid */ 169 - unsigned long cl_vtperiod; /* vt period sequence number */ 170 - unsigned long cl_parentperiod;/* parent's vt period sequence number*/ 171 - unsigned long cl_nactive; /* number of active children */ 168 + u8 cl_flags; /* which curves are valid */ 169 + u32 cl_vtperiod; /* vt period sequence number */ 170 + u32 cl_parentperiod;/* parent's vt period sequence number*/ 171 + u32 cl_nactive; /* number of active children */ 172 172 }; 173 173 174 174 struct hfsc_sched {