From: Qais Yousef <qyousef@layalina.io>
To: John Stultz <jstultz@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Valentin Schneider <vschneid@redhat.com>,
Joel Fernandes <joel@joelfernandes.org>,
kernel-team@android.com
Subject: Re: [PATCH] RFC: sched: Rework task_sched_runtime to avoid calling update_rq_clock
Date: Tue, 18 Jun 2024 16:04:17 +0100 [thread overview]
Message-ID: <20240618150417.kuoft7jqqg6pcjrf@airbuntu> (raw)
In-Reply-To: <CANDhNCrShc0ak2BZN91fR9uj0MM6R20oskoDD-f7++SgPao6vA@mail.gmail.com>
On 06/17/24 21:45, John Stultz wrote:
> On Mon, Jun 17, 2024 at 5:42 PM John Stultz <jstultz@google.com> wrote:
> >
> > Also, separately, while I didn't see this earlier testing on physical
> > devices, when running virtualized, I can pretty easily trip over the
> > following:
> >
> > [ 65.207340] watchdog: BUG: soft lockup - CPU#0 stuck for 26s!
> > [kworker/0:3:374]
> > [ 65.211107] irq event stamp: 118664
> > [ 65.212786] hardirqs last enabled at (118663):
> > [<ffffffff97a00e46>] asm_sysvec_apic_timer_interrupt+0x16/0x20
> > [ 65.218440] hardirqs last disabled at (118664):
> > [<ffffffff977fdeca>] sysvec_apic_timer_interrupt+0xa/0xc0
> > [ 65.223074] softirqs last enabled at (118546):
> > [<ffffffff9676db78>] __irq_exit_rcu+0x88/0xe0
> > [ 65.227118] softirqs last disabled at (118541):
> > [<ffffffff9676db78>] __irq_exit_rcu+0x88/0xe0
> > [ 65.231137] CPU: 0 PID: 374 Comm: kworker/0:3 Not tainted
> > 6.10.0-rc4-dirty #4393
> > [ 65.234625] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
> > BIOS 1.16.3-debian-1.16.3-2 04/01/2014
> > [ 65.239089] Workqueue: events psi_avgs_work
> > [ 65.241122] RIP: 0010:collect_percpu_times+0xff/0x310
> ...
> > [ 65.288730] Call Trace:
> > [ 65.289958] <IRQ>
> > [ 65.290965] ? watchdog_timer_fn+0x275/0x310
> > [ 65.293185] ? __pfx_watchdog_timer_fn+0x10/0x10
> > [ 65.295379] ? __hrtimer_run_queues+0x190/0x3b0
> > [ 65.297795] ? hrtimer_interrupt+0xf9/0x230
> > [ 65.299782] ? __sysvec_apic_timer_interrupt+0x82/0x210
> > [ 65.302243] ? sysvec_apic_timer_interrupt+0x98/0xc0
> > [ 65.304590] </IRQ>
> > [ 65.305658] <TASK>
> > [ 65.306708] ? asm_sysvec_apic_timer_interrupt+0x16/0x20
> > [ 65.309206] ? psi_avgs_work+0x3c/0xb0
> > [ 65.311001] ? collect_percpu_times+0xff/0x310
> > [ 65.313153] psi_avgs_work+0x3c/0xb0
> > [ 65.314864] process_one_work+0x1fe/0x700
> > [ 65.316782] ? lock_is_held_type+0xcd/0x120
> > [ 65.318782] worker_thread+0x1c7/0x3b0
> > [ 65.320571] ? __pfx_worker_thread+0x10/0x10
> > [ 65.322626] kthread+0xe0/0x110
> > [ 65.324103] ? __pfx_kthread+0x10/0x10
> > [ 65.325853] ret_from_fork+0x28/0x40
> > [ 65.327512] ? __pfx_kthread+0x10/0x10
> > [ 65.329255] ret_from_fork_asm+0x1a/0x30
> > [ 65.331073] </TASK>
> > [ 65.332119] Kernel panic - not syncing: softlockup: hung tasks
>
> As I've been digging on this some more, I'm still a bit baffled. The
> kworker seems to get stuck once the irq lands and we don't seem to go
> back to the workqueue work that was in progress. That cpu ends up not
> doing anything but occasionally handling ticks until we crash from the
> softlockup watchdog.
>
> Interestingly, if I move the psi_account_irqtime() call to be under
> the rq_lock in sched_tick(), as I suggested earlier, I have yet to
> reproduce the problem.
> But I'm still trying to piece together exactly why.
A bit of a guess, but should irq_time_read() be done with interrupts disabled?
next prev parent reply other threads:[~2024-06-18 15:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 1:58 John Stultz
2024-06-13 3:54 ` John Stultz
2024-06-13 10:04 ` Peter Zijlstra
2024-06-13 11:51 ` Qais Yousef
2024-06-14 9:48 ` Peter Zijlstra
2024-06-15 4:30 ` John Stultz
2024-06-16 22:36 ` Qais Yousef
2024-06-18 7:04 ` Peter Zijlstra
2024-06-18 15:24 ` Qais Yousef
2024-06-18 0:42 ` John Stultz
2024-06-18 4:45 ` John Stultz
2024-06-18 15:04 ` Qais Yousef [this message]
2024-06-18 8:12 ` Peter Zijlstra
2024-06-18 17:59 ` Johannes Weiner
2024-06-18 19:02 ` John Stultz
2024-06-13 18:59 ` John Stultz
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=20240618150417.kuoft7jqqg6pcjrf@airbuntu \
--to=qyousef@layalina.io \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=frederic@kernel.org \
--cc=joel@joelfernandes.org \
--cc=jstultz@google.com \
--cc=juri.lelli@redhat.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/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
all inboxes | Powered by JetHome®