mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
net: add data-race annotations in softnet_seq_show()
softnet_seq_show() reads several fields that might be updated concurrently. Add READ_ONCE() and WRITE_ONCE() annotations. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20250407163602.170356-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
7b6f0a852d
commit
22d046a778
@@ -4953,7 +4953,8 @@ static void rps_trigger_softirq(void *data)
|
||||
struct softnet_data *sd = data;
|
||||
|
||||
____napi_schedule(sd, &sd->backlog);
|
||||
sd->received_rps++;
|
||||
/* Pairs with READ_ONCE() in softnet_seq_show() */
|
||||
WRITE_ONCE(sd->received_rps, sd->received_rps + 1);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_RPS */
|
||||
@@ -7523,7 +7524,8 @@ start:
|
||||
*/
|
||||
if (unlikely(budget <= 0 ||
|
||||
time_after_eq(jiffies, time_limit))) {
|
||||
sd->time_squeeze++;
|
||||
/* Pairs with READ_ONCE() in softnet_seq_show() */
|
||||
WRITE_ONCE(sd->time_squeeze, sd->time_squeeze + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user