Skip to content

Commit 2dfb195

Browse files
mohittahilianidavem330
authored andcommitted
pie: rearrange structure members and their initializations
Rearrange the members of the structure such that closely referenced members appear together and/or fit in the same cacheline. Also, change the order of their initializations to match the order in which they appear in the structure. Signed-off-by: Mohit P. Tahiliani <[email protected]> Signed-off-by: Leslie Monis <[email protected]> Signed-off-by: Gautam Ramakrishnan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1dbfc5e commit 2dfb195

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

include/net/pie.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ struct pie_params {
2828

2929
/* variables used */
3030
struct pie_vars {
31-
u64 prob; /* probability but scaled by u64 limit. */
32-
psched_time_t burst_time;
3331
psched_time_t qdelay;
3432
psched_time_t qdelay_old;
35-
u64 dq_count; /* measured in bytes */
33+
psched_time_t burst_time;
3634
psched_time_t dq_tstamp; /* drain rate */
35+
u64 prob; /* probability but scaled by u64 limit. */
3736
u64 accu_prob; /* accumulated drop probability */
37+
u64 dq_count; /* measured in bytes */
3838
u32 avg_dq_rate; /* bytes per pschedtime tick,scaled */
3939
u32 qlen_old; /* in bytes */
4040
u8 accu_prob_overflows; /* overflows of accu_prob */
@@ -45,8 +45,8 @@ struct pie_stats {
4545
u32 packets_in; /* total number of packets enqueued */
4646
u32 dropped; /* packets dropped due to pie_action */
4747
u32 overlimit; /* dropped due to lack of space in queue */
48-
u32 maxq; /* maximum queue size */
4948
u32 ecn_mark; /* packets marked with ECN */
49+
u32 maxq; /* maximum queue size */
5050
};
5151

5252
/* private skb vars */
@@ -56,24 +56,24 @@ struct pie_skb_cb {
5656

5757
static inline void pie_params_init(struct pie_params *params)
5858
{
59-
params->alpha = 2;
60-
params->beta = 20;
59+
params->target = PSCHED_NS2TICKS(15 * NSEC_PER_MSEC); /* 15 ms */
6160
params->tupdate = usecs_to_jiffies(15 * USEC_PER_MSEC); /* 15 ms */
6261
params->limit = 1000; /* default of 1000 packets */
63-
params->target = PSCHED_NS2TICKS(15 * NSEC_PER_MSEC); /* 15 ms */
62+
params->alpha = 2;
63+
params->beta = 20;
6464
params->ecn = false;
6565
params->bytemode = false;
6666
params->dq_rate_estimator = false;
6767
}
6868

6969
static inline void pie_vars_init(struct pie_vars *vars)
7070
{
71-
vars->dq_count = DQCOUNT_INVALID;
71+
/* default of 150 ms in pschedtime */
72+
vars->burst_time = PSCHED_NS2TICKS(150 * NSEC_PER_MSEC);
7273
vars->dq_tstamp = DTIME_INVALID;
7374
vars->accu_prob = 0;
75+
vars->dq_count = DQCOUNT_INVALID;
7476
vars->avg_dq_rate = 0;
75-
/* default of 150 ms in pschedtime */
76-
vars->burst_time = PSCHED_NS2TICKS(150 * NSEC_PER_MSEC);
7777
vars->accu_prob_overflows = 0;
7878
}
7979

net/sched/sch_pie.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
/* private data for the Qdisc */
2525
struct pie_sched_data {
26-
struct pie_params params;
2726
struct pie_vars vars;
27+
struct pie_params params;
2828
struct pie_stats stats;
2929
struct timer_list adapt_timer;
3030
struct Qdisc *sch;

0 commit comments

Comments
 (0)