File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ void __io_napi_add(struct io_ring_ctx *ctx, struct socket *sock)
60
60
rcu_read_lock ();
61
61
e = io_napi_hash_find (hash_list , napi_id );
62
62
if (e ) {
63
- e -> timeout = jiffies + NAPI_TIMEOUT ;
63
+ WRITE_ONCE ( e -> timeout , jiffies + NAPI_TIMEOUT ) ;
64
64
rcu_read_unlock ();
65
65
return ;
66
66
}
@@ -92,7 +92,7 @@ static void __io_napi_remove_stale(struct io_ring_ctx *ctx)
92
92
93
93
spin_lock (& ctx -> napi_lock );
94
94
hash_for_each (ctx -> napi_ht , i , e , node ) {
95
- if (time_after (jiffies , e -> timeout )) {
95
+ if (time_after (jiffies , READ_ONCE ( e -> timeout ) )) {
96
96
list_del (& e -> list );
97
97
hash_del_rcu (& e -> node );
98
98
kfree_rcu (e , rcu );
@@ -150,7 +150,7 @@ static bool __io_napi_do_busy_loop(struct io_ring_ctx *ctx,
150
150
napi_busy_loop_rcu (e -> napi_id , loop_end , loop_end_arg ,
151
151
ctx -> napi_prefer_busy_poll , BUSY_POLL_BUDGET );
152
152
153
- if (time_after (jiffies , e -> timeout ))
153
+ if (time_after (jiffies , READ_ONCE ( e -> timeout ) ))
154
154
is_stale = true;
155
155
}
156
156
You can’t perform that action at this time.
0 commit comments