The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: tanze <tanze@kylinos.cn>, anna-maria@linutronix.de, frederic@kernel.org
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH v1] timers: Feed soft lockup watchdog in expire_timers()
Date: Sun, 05 Jul 2026 12:13:28 +0200	[thread overview]
Message-ID: <87zf05kalz.ffs@fw13> (raw)
In-Reply-To: <20260703083624.80072-1-tanze@kylinos.cn>

On Fri, Jul 03 2026 at 16:36, tanze@kylinos.cn wrote:

Thanks for your patch.

First of all, you have to provide your real name for signing off on a
patch. Your nickname does not cut it. See Documentation/process.

> expire_timers() iterates over all expired timers and invokes their
> callbacks one by one in softirq context.  Each individual callback may
> complete quickly, but when a very large number of timers expire at the
> same tick, the aggregate time spent in this loop can exceed the soft
> lockup watchdog threshold, causing a false positive:

No. It's not a false positive.

> This is reproducible by issuing many perf_event_open() syscalls with
> PERF_COUNT_SW_CPU_CLOCK and a very small sample_period, which creates
> a large number of software timers that expire simultaneously.  The CPU
> is making forward progress -- executing timer callbacks one after
> another -- but the watchdog is never reset during the batch.  Found by
> running syzkaller on a local QEMU instance.

The watchdog validates that the CPU is making forward progress for
tasks. Spending 26 seconds in soft interrupt handling does therefore not
qualify.

> Add touch_softlockup_watchdog() after each call_timer_fn() invocation
> in expire_timers().  This resets the watchdog timestamp after every
> successfully completed callback.

Which papers over the underlying problem.

> @@ -1792,11 +1793,13 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head)
>  		if (timer->flags & TIMER_IRQSAFE) {
>  			raw_spin_unlock(&base->lock);
>  			call_timer_fn(timer, fn, baseclk);
> +			touch_softlockup_watchdog();
>  			raw_spin_lock(&base->lock);
>  			base->running_timer = NULL;
>  		} else {
>  			raw_spin_unlock_irq(&base->lock);
>  			call_timer_fn(timer, fn, baseclk);
> +			touch_softlockup_watchdog();
>  			raw_spin_lock_irq(&base->lock);
>  			base->running_timer = NULL;
>  			timer_sync_wait_running(base);

PERF_COUNT_SW_CPU_CLOCK does not even use timer list timers, so how is
expire_timers() even involved?

Thanks,

        tglx



      reply	other threads:[~2026-07-05 10:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03  8:36 [PATCH v1] timers: Feed soft lockup watchdog in expire_timers() tanze
2026-07-05 10:13 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zf05kalz.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tanze@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox