Zqiang
4d58c9fb45
rcu/nocb: Fix WARN_ON_ONCE() in the rcu_nocb_bypass_lock()
...
[ Upstream commit dda98810b552fc6bf650f4270edeebdc2f28bd3f ]
For the kernels built with CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y and
CONFIG_RCU_LAZY=y, the following scenarios will trigger WARN_ON_ONCE()
in the rcu_nocb_bypass_lock() and rcu_nocb_wait_contended() functions:
CPU2 CPU11
kthread
rcu_nocb_cb_kthread ksys_write
rcu_do_batch vfs_write
rcu_torture_timer_cb proc_sys_write
__kmem_cache_free proc_sys_call_handler
kmemleak_free drop_caches_sysctl_handler
delete_object_full drop_slab
__delete_object shrink_slab
put_object lazy_rcu_shrink_scan
call_rcu rcu_nocb_flush_bypass
__call_rcu_commn rcu_nocb_bypass_lock
raw_spin_trylock(&rdp->nocb_bypass_lock) fail
atomic_inc(&rdp->nocb_lock_contended);
rcu_nocb_wait_contended WARN_ON_ONCE(smp_processor_id() != rdp->cpu);
WARN_ON_ONCE(atomic_read(&rdp->nocb_lock_contended)) |
|_ _ _ _ _ _ _ _ _ _same rdp and rdp->cpu != 11_ _ _ _ _ _ _ _ _ __|
Reproduce this bug with "echo 3 > /proc/sys/vm/drop_caches".
This commit therefore uses rcu_nocb_try_flush_bypass() instead of
rcu_nocb_flush_bypass() in lazy_rcu_shrink_scan(). If the nocb_bypass
queue is being flushed, then rcu_nocb_try_flush_bypass will return
directly.
Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:07:34 +02:00
..
2024-04-10 16:36:06 +02:00
2024-04-03 15:28:40 +02:00
2023-09-05 11:01:47 -07:00
2024-01-25 15:36:00 -08:00
2024-04-13 13:07:32 +02:00
2024-04-03 15:28:50 +02:00
2024-02-05 20:14:33 +00:00
2023-11-20 11:58:53 +01:00
2023-08-18 10:18:58 -07:00
2024-01-31 16:19:13 -08:00
2023-06-09 23:29:50 +10:00
2023-11-20 11:59:25 +01:00
2023-12-03 07:33:06 +01:00
2024-03-26 18:19:55 -04:00
2024-04-03 15:28:22 +02:00
2024-04-13 13:07:29 +02:00
2024-04-13 13:07:34 +02:00
2024-04-03 15:28:18 +02:00
2024-03-26 18:19:19 -04:00
2024-04-10 16:36:06 +02:00
2023-08-30 08:17:35 -07:00
2024-01-31 16:18:49 -08:00
2023-11-28 17:19:56 +00:00
2024-02-05 20:14:14 +00:00
2023-07-21 12:17:25 -04:00
2023-08-15 18:16:14 -04:00
2023-10-13 18:34:46 +02:00
2024-04-03 15:28:20 +02:00
2023-08-08 16:48:47 -04:00
2023-03-14 19:32:38 -07:00
2023-06-05 09:57:20 +02:00
2023-01-13 11:48:15 +01:00
2023-12-13 18:44:56 +01:00
2023-09-29 17:20:48 -07:00
2023-12-20 17:01:51 +01:00
2023-04-18 16:39:34 -07:00
2023-12-20 17:01:51 +01:00
2023-02-08 13:36:22 +01:00
2023-12-03 07:33:06 +01:00
2023-05-28 16:20:21 +09:00
2023-04-08 13:45:37 -07:00
2023-08-21 13:37:28 -07:00
2023-03-24 11:01:29 +01:00
2022-12-01 15:53:05 -08:00
2023-08-29 17:32:32 -07:00
2023-08-25 15:00:36 -07:00
2024-01-05 15:19:41 +01:00
2023-06-09 17:44:17 -07:00
2024-01-31 16:18:56 -08:00
2023-08-30 09:16:56 -07:00
2023-11-28 17:19:40 +00:00
2023-03-24 20:10:59 -07:00
2023-12-13 18:45:31 +01:00
2023-06-08 12:27:20 -07:00
2023-08-24 16:25:14 -07:00
2023-08-18 10:18:59 -07:00
2023-06-28 15:51:08 -07:00
2023-04-08 13:45:38 -07:00
2023-08-21 11:29:12 -07:00
2023-11-28 17:19:42 +00:00
2024-04-13 13:07:29 +02:00
2023-07-10 12:47:01 -07:00
2023-08-21 13:37:59 -07:00
2023-08-21 13:37:59 -07:00
2023-09-19 13:21:33 -07:00
2023-04-16 14:23:07 +02:00
2023-11-28 17:20:04 +00:00
2023-08-18 10:18:55 -07:00
2024-01-10 17:16:58 +01:00
2022-12-27 12:52:12 +01:00
2023-07-14 15:02:57 -07:00
2023-08-17 12:32:15 -07:00
2023-08-18 10:18:50 -07:00
2023-11-28 17:19:36 +00:00
2023-05-15 13:45:00 +02:00
2023-07-13 15:21:50 +02:00
2023-04-20 11:36:35 +02:00
2024-01-20 11:51:46 +01:00
2024-04-03 15:28:54 +02:00
2023-06-28 16:05:21 -07:00
2023-09-19 13:21:32 -07:00
2023-11-28 17:20:08 +00:00
2023-02-18 14:34:36 -05:00
2023-08-15 15:26:17 -07:00
2023-06-29 15:19:43 -07:00
2023-02-02 22:50:04 -08:00
2022-11-30 20:16:49 -04:00
2023-04-13 11:49:35 -07:00
2023-06-08 15:43:09 -04:00
2023-11-28 17:19:40 +00:00
2023-06-19 16:25:28 -07:00
2023-06-09 17:44:21 -07:00
2023-11-28 17:19:57 +00:00
2023-08-07 15:57:22 -10:00
2024-04-04 20:23:07 +02:00