diff options
author | Eric Dumazet <edumazet@google.com> | 2024-10-29 19:14:25 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-10-31 19:19:36 -0700 |
commit | a911bad094b010e276f072fe9a599b66e59ed5fe (patch) | |
tree | f051548cb035f254931272820d95f062751c854e /include/linux/dynamic_queue_limits.h | |
parent | 4138e9ec00936c9fe7d0fe961e32f381b1e36926 (diff) |
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 'include/linux/dynamic_queue_limits.h')
-rw-r--r-- | include/linux/dynamic_queue_limits.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dynamic_queue_limits.h b/include/linux/dynamic_queue_limits.h index 281298e77a15..808b1a5102e7 100644 --- a/include/linux/dynamic_queue_limits.h +++ b/include/linux/dynamic_queue_limits.h @@ -127,7 +127,7 @@ static inline void dql_queued(struct dql *dql, unsigned int count) if (WARN_ON_ONCE(count > DQL_MAX_OBJECT)) return; - dql->last_obj_cnt = count; + WRITE_ONCE(dql->last_obj_cnt, count); /* We want to force a write first, so that cpu do not attempt * to get cache line containing last_obj_cnt, num_queued, adj_limit |