mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-28 00:35:01 +00:00
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>
This commit is contained in:
parent
4138e9ec00
commit
a911bad094
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user