diff options
author | Eric Dumazet <edumazet@google.com> | 2024-10-29 20:14:25 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-01 03:19:36 +0100 |
commit | a911bad094b010e276f072fe9a599b66e59ed5fe (patch) | |
tree | f051548cb035f254931272820d95f062751c854e /lib/dynamic_queue_limits.c | |
parent | netlink: add NLA_POLICY_MAX_LEN macro (diff) | |
download | linux-a911bad094b010e276f072fe9a599b66e59ed5fe.tar.xz linux-a911bad094b010e276f072fe9a599b66e59ed5fe.zip |
dql: annotate data-races around dql->last_obj_cnt
dql->last_obj_cnt is read/written from different contexts,
without any lock synchronization.
Use READ_ONCE()/WRITE_ONCE() to avoid load/store tearing.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20241029191425.2519085-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'lib/dynamic_queue_limits.c')
-rw-r--r-- | lib/dynamic_queue_limits.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c index e49deddd3de9..c1b7638a594a 100644 --- a/lib/dynamic_queue_limits.c +++ b/lib/dynamic_queue_limits.c @@ -179,7 +179,7 @@ void dql_completed(struct dql *dql, unsigned int count) dql->adj_limit = limit + completed; dql->prev_ovlimit = ovlimit; - dql->prev_last_obj_cnt = dql->last_obj_cnt; + dql->prev_last_obj_cnt = READ_ONCE(dql->last_obj_cnt); dql->num_completed = completed; dql->prev_num_queued = num_queued; |