mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().
[ Upstream commit 31e03207119a535d0b0e3b3a7f91983aeb2cb14d ]
gc_in_progress is changed under spin_lock(&unix_gc_lock),
but wait_for_unix_gc() reads it locklessly.
Let's use READ_ONCE().
Fixes: 5f23b73496
("net: Fix soft lockups/OOM issues w/ unix garbage collector")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20240123170856.41348-2-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a9800dc6cf
commit
debbb99874
1 changed files with 1 additions and 1 deletions
|
@ -198,7 +198,7 @@ void wait_for_unix_gc(void)
|
||||||
if (READ_ONCE(unix_tot_inflight) > UNIX_INFLIGHT_TRIGGER_GC &&
|
if (READ_ONCE(unix_tot_inflight) > UNIX_INFLIGHT_TRIGGER_GC &&
|
||||||
!READ_ONCE(gc_in_progress))
|
!READ_ONCE(gc_in_progress))
|
||||||
unix_gc();
|
unix_gc();
|
||||||
wait_event(unix_gc_wait, gc_in_progress == false);
|
wait_event(unix_gc_wait, !READ_ONCE(gc_in_progress));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The external entry point: unix_gc() */
|
/* The external entry point: unix_gc() */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue