Re: [syzbot] INFO: rcu detected stall in gc_worker (2)

From: syzbot
Date: Tue Aug 02 2022 - 06:43:36 EST


> On Thu, 09 Dec 2021 00:56:26 -0800
>> syzbot found the following issue on:
>>
>> HEAD commit: 2a987e65025e Merge tag 'perf-tools-fixes-for-v5.16-2021-12..
>> git tree: upstream
>> console output: https://syzkaller.appspot.com/x/log.txt?x=114fe575b00000
>> kernel config: https://syzkaller.appspot.com/x/.config?x=7d5e878e3399b6cc
>> dashboard link: https://syzkaller.appspot.com/bug?extid=70c4a3a8fe7f7e1af947
>> compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2
>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=128048b9b00000
>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10ceddadb00000
>
> Print the hrtimer hog.
>
> #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

This bug is already marked as invalid. No point in testing.

>
> diff -pur a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
> --- a/kernel/time/hrtimer.c 2022-08-02 18:24:33.200242000 +0800
> +++ b/kernel/time/hrtimer.c 2022-08-02 18:40:52.895892600 +0800
> @@ -1647,6 +1647,7 @@ static void __run_hrtimer(struct hrtimer
> enum hrtimer_restart (*fn)(struct hrtimer *);
> bool expires_in_hardirq;
> int restart;
> + unsigned long ts;
>
> lockdep_assert_held(&cpu_base->lock);
>
> @@ -1682,8 +1683,13 @@ static void __run_hrtimer(struct hrtimer
> trace_hrtimer_expire_entry(timer, now);
> expires_in_hardirq = lockdep_hrtimer_enter(timer);
>
> + ts = jiffies + 500;
> +
> restart = fn(timer);
>
> + WARN_ONCE(time_after(jiffies, ts),
> + "CPU%u hrtimer %ps took more than 500 ticks\n", cpu_base->cpu, fn);
> +
> lockdep_hrtimer_exit(expires_in_hardirq);
> trace_hrtimer_expire_exit(timer);
> raw_spin_lock_irq(&cpu_base->lock);
> --