Skip to contentSkip to conversation

INFO: task hung in synchronize_rcu (4)

syzbot Tetsuo Handa 2 participants 4 messages May 4, 2023 – May 5, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 10 lines · Hillf Danton
Quoted 9 lines

4 locks held by syz-executor.2/5077:
#0: ffff8880b993c2d8 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2f/0x120 kernel/sched/core.c:539 #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: mm_cid_get kernel/sched/sched.h:3280 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: switch_mm_cid kernel/sched/sched.h:3302 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: prepare_task_switch kernel/sched/core.c:5117 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: context_switch kernel/sched/core.c:5258 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: __schedule+0x2802/0x5770 kernel/sched/core.c:6625 #2: ffff8880b9929698 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x5a/0x1f0 kernel/time/timer.c:999 #3: ffffffff91fb4ac8 (&obj_hash[i].lock){-.-.}-{2:2}, at: debug_object_activate+0x134/0x3f0 lib/debugobjects.c:690

Quoted 2 lines

What is hard to understand in this report is, how could acquire the timer base lock with the mm cid lock held [1]?

Please be aware that lockdep_print_held_locks() is not an atomic action. Since synchronous printk() is slow, it can sometimes happen that task_is_running(p) becomes true after passing the

	if (p != current && task_is_running(p))
		return;

check. I think that this trace is an example where print_lock() by chance hit hlock_class(p->held_locks + 2) != NULL. If sched_show_task() were also available, we can know it via mismatch between sched_show_task() and lockdep_print_held_locks().

Linus, I think that "[PATCH v3 (repost)] locking/lockdep: add debug_show_all_lock_holders()" helps here, but I can't wake up locking people. What can we do?

Quoted 14 lines

static inline int mm_cid_get(struct mm_struct *mm)

{
	int ret;

	lockdep_assert_irqs_disabled();
	raw_spin_lock(&mm->cid_lock);
	ret = __mm_cid_get(mm);
	raw_spin_unlock(&mm->cid_lock);
	return ret;
}

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/tree/kernel/sched/sched.h?id=6686317855c6#n3280

#2 lore raw
Quoted 21 lines · Tetsuo Handa
Quoted 10 lines · Hillf Danton
Quoted 9 lines

4 locks held by syz-executor.2/5077:
#0: ffff8880b993c2d8 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2f/0x120 kernel/sched/core.c:539 #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: mm_cid_get kernel/sched/sched.h:3280 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: switch_mm_cid kernel/sched/sched.h:3302 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: prepare_task_switch kernel/sched/core.c:5117 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: context_switch kernel/sched/core.c:5258 [inline] #1: ffff88802296aef0 (&mm->cid_lock#2){....}-{2:2}, at: __schedule+0x2802/0x5770 kernel/sched/core.c:6625 #2: ffff8880b9929698 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x5a/0x1f0 kernel/time/timer.c:999 #3: ffffffff91fb4ac8 (&obj_hash[i].lock){-.-.}-{2:2}, at: debug_object_activate+0x134/0x3f0 lib/debugobjects.c:690

Quoted 2 lines

What is hard to understand in this report is, how could acquire the timer base lock with the mm cid lock held [1]?

Please be aware that lockdep_print_held_locks() is not an atomic action. Since synchronous printk() is slow, it can sometimes happen that task_is_running(p) becomes true after passing the

	if (p != current && task_is_running(p))
		return;
Quoted 6 lines

check. I think that this trace is an example where print_lock() by chance hit hlock_class(p->held_locks + 2) != NULL. If sched_show_task() were also available, we can know it via mismatch between sched_show_task() and lockdep_print_held_locks().

Linus, I think that "[PATCH v3 (repost)] locking/lockdep: add debug_show_all_lock_holders()" helps here, but I can't wake up locking people. What can we do?

How is that not also racy ?

I think I've seen that patch, and it had a some 'blurb' Changelog that leaves me wondering wtf the actual problem is and how it attempts to solve it and I went on with looking at regressions because more important than random weird patch.

#3 lore raw
Quoted 4 lines · Peter Zijlstra
Quoted 2 lines

Linus, I think that "[PATCH v3 (repost)] locking/lockdep: add debug_show_all_lock_holders()" helps here, but I can't wake up locking people. What can we do?

How is that not also racy ?

Nobody can make this code racy.

Quoted 5 lines

I think I've seen that patch, and it had a some 'blurb' Changelog that leaves me wondering wtf the actual problem is and how it attempts to solve it and I went on with looking at regressions because more important than random weird patch.

Please respond to
https://lkml.kernel.org/[email protected] .

#4 lore raw
Quoted 7 lines · Tetsuo Handa
Quoted 4 lines · Peter Zijlstra
Quoted 2 lines

Linus, I think that "[PATCH v3 (repost)] locking/lockdep: add debug_show_all_lock_holders()" helps here, but I can't wake up locking people. What can we do?

How is that not also racy ?

Nobody can make this code racy.

Oops, nobody can make this code race-free.

Capturing vmcore is not an option.

Quoted 10 lines
Quoted 6 lines

I think I've seen that patch, and it had a some 'blurb' Changelog that leaves me wondering wtf the actual problem is and how it attempts to solve it and I went on with looking at regressions because more important than random weird patch.

Please respond to
https://lkml.kernel.org/[email protected] .

I am waiting for your response.
But since you don't respond, I have to repeat re-posting.