[PATCH] rcu-tasks: Fix possible boot-time tests failed for the call_rcu_tasks()

0 views
Skip to first unread message

Zqiang

unread,
4:51 AM (4 hours ago) 4:51 AM
to syzkall...@googlegroups.com, syzbot+251e9a...@syzkaller.appspotmail.com, Zqiang
Reported-by: syzbot+251e9a...@syzkaller.appspotmail.com
Signed-off-by: Zqiang <qiang...@linux.dev>
---
kernel/rcu/tasks.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 48f0d803c8e2..f4da5fad70f5 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -373,7 +373,8 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func,
// Queuing callbacks before initialization not yet supported.
if (WARN_ON_ONCE(!rcu_segcblist_is_enabled(&rtpcp->cblist)))
rcu_segcblist_init(&rtpcp->cblist);
- needwake = (func == wakeme_after_rcu) ||
+ needwake = (!havekthread && rcu_segcblist_empty(&rtpcp->cblist)) ||
+ (func == wakeme_after_rcu) ||
(rcu_segcblist_n_cbs(&rtpcp->cblist) == rcu_task_lazy_lim);
if (havekthread && !needwake && !timer_pending(&rtpcp->lazy_timer)) {
if (rtp->lazy_jiffies)
--
2.48.1

Reply all
Reply to author
Forward
0 new messages