net/sched: sch_pie: annotate more data-races in pie_dump_stats()
Subsystems (3)
PATCH 1/1 net/sched: sch_pie: annotate more data-races in pie_dump_stats()
My prior patch missed few READ_ONCE()/WRITE_ONCE() annotations.
Fixes 5154561d9b11 ("net/sched: sch_pie: annotate data-races in pie_dump_stats()")
Signed-off-by Eric Dumazet <[email protected]>
--- net/sched/sch_pie.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
net/sched/sch_pie.c +6 -8
@@ -219,16 +219,14 @@ void pie_process_dequeue(struct sk_buff *skb, struct pie_params *params,* packet timestamp. */ if (!params->dq_rate_estimator) { - vars->qdelay = now -pie_get_enqueue_time (skb); +WRITE_ONCE (vars->qdelay, + backlog ? now -pie_get_enqueue_time (skb) :0 );if (vars->dq_tstamp !=DTIME_INVALID ) dtime = now - vars->dq_tstamp; vars->dq_tstamp = now; -if (backlog ==0 ) - vars->qdelay =0 ; -if (dtime ==0 )return ;
@@ -376,7 +374,7 @@ void pie_calculate_probability(struct pie_params *params, struct pie_vars *vars,if (qdelay > (PSCHED_NS2TICKS (250 *NSEC_PER_MSEC ))) delta +=MAX_PROB / (100 /2 ); - vars->prob += delta; +WRITE_ONCE (vars->prob, vars->prob + delta);if (delta >0 ) {/* prevent overflow */
@@ -401,7 +399,7 @@ void pie_calculate_probability(struct pie_params *params, struct pie_vars *vars,if (qdelay ==0 && qdelay_old ==0 && update_prob)/* Reduce drop probability to 98.4% */ - vars->prob -= vars->prob /64 ; +WRITE_ONCE (vars->prob, vars->prob - vars->prob /64 );WRITE_ONCE (vars->qdelay, qdelay); vars->backlog_old = backlog;
@@ -501,7 +499,7 @@ static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) {struct pie_sched_data *q =qdisc_priv (sch);struct tc_pie_xstats st = { - .prob = q->vars.prob <<BITS_PER_BYTE , + .prob =READ_ONCE (q->vars.prob) <<BITS_PER_BYTE , .delay = ((u32 )PSCHED_TICKS2NS (READ_ONCE (q->vars.qdelay))) /NSEC_PER_USEC , .packets_in =READ_ONCE (q->stats.packets_in),
@@ -512,7 +510,7 @@ static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) };/* avg_dq_rate is only valid if dq_rate_estimator is enabled */ - st.dq_rate_estimating = q->params.dq_rate_estimator; + st.dq_rate_estimating =READ_ONCE (q->params.dq_rate_estimator);/* unscale and return dq_rate in bytes per sec */ if (st.dq_rate_estimating)
Signature · 1 line
2.54.0.545.g6539524ca2-goog
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 7 lines · On Thu, 30 Apr 2026 08:00:56 +0000 you wrote:
My prior patch missed few READ_ONCE()/WRITE_ONCE() annotations.
Fixes 5154561d9b11 ("net/sched: sch_pie: annotate data-races in pie_dump_stats()")Signed-off-by Eric Dumazet <[email protected]>--- net/sched/sch_pie.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
Here is the summary with links:
- [net] net/sched: sch_pie: annotate more data-races in pie_dump_stats()
https://git.kernel.org/netdev/net/c/6d4106e8df94
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html