From: Sonam Sanju <sonam.sanju@intel.com>
To: tj@kernel.org
Cc: dmaluka@chromium.org, kunwu.chan@linux.dev, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, paulmck@kernel.org,
pbonzini@redhat.com, rcu@vger.kernel.org, seanjc@google.com,
sonam.sanju@intel.com, stable@vger.kernel.org,
vineeth@bitbyteword.org
Subject: Re: [PATCH v2] KVM: irqfd: fix deadlock by moving synchronize_srcu out of resampler_lock
Date: Thu, 23 Apr 2026 14:31:00 +0530 [thread overview]
Message-ID: <20260423090100.3231633-1-sonam.sanju@intel.com> (raw)
In-Reply-To: <aefAWGcAQHeRYbs8@slm.duckdns.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]
Hello Tejun,
Thank you for the detailed analysis.
On Wed, Apr 23, 2026, Tejun Heo wrote:
> The problem with this theory is that this kworker, while preempted, is still
> runnable and should be dispatched to its CPU once it becomes available
> again. Workqueue doesn't care whether the task gets preempted or when it
> gets the CPU back. It only cares about whether the task enters blocking
> state (!runnable). A task which is preempted, even on the way to blocking,
> still is runnable and should get put back on the CPU by the scheduler.
>
> If you can take a crashdump of the deadlocked state, can you see whether the
> task is still on the scheduler's runqueue?
I instrumented show_one_worker_pool() to dump scheduler state for each busy worker
when the pool has been hung for >30 seconds.
All workers show on_rq=0.
== Pool state ==
pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=47s
workers=13 nr_running=1 nr_idle=7
== Per-worker scheduler state (first dump at t=62.5s) ==
PID | state | on_rq | se.on_rq | sched_delayed | sleeping | blocked_on
-----|-------|-------|----------|---------------|----------|-------------------
4819 | 0x2 | 0 | 0 | 0 | 1 | ffff953608205210 type=1
4823 | 0x2 | 0 | 0 | 0 | 1 | ffff953608205210 type=1
4818 | 0x2 | 0 | 0 | 0 | 0 | ffff953608205210 type=1
11 | 0x2 | 0 | 0 | 0 | 1 | ffff953608205210 type=1
9 | 0x2 | 0 | 0 | 0 | 1 | ffff953608205210 type=1
4814 | 0x2 | 0 | 0 | 0 | 1 | (mutex holder)
All 6 workers are in kvm-irqfd-cleanup, calling irqfd_shutdown →
irqfd_resampler_shutdown. They contend on the same resampler->lock
mutex (ffff953608205210).
Full logs: https://gist.github.com/sonam-sanju/08042878542b7a58d2818e6076554211
Thanks,
Sonam
next prev parent reply other threads:[~2026-04-23 9:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260323053353.805336-1-sonam.sanju@intel.com>
2026-03-23 6:42 ` [PATCH v2] KVM: irqfd: fix deadlock by moving synchronize_srcu out of resampler_lock Sonam Sanju
2026-03-31 18:17 ` Sean Christopherson
2026-03-31 20:51 ` Paul E. McKenney
2026-04-01 9:47 ` Sonam Sanju
2026-04-06 23:09 ` Paul E. McKenney
2026-04-01 9:34 ` Kunwu Chan
2026-04-01 14:24 ` Sonam Sanju
2026-04-06 14:20 ` Kunwu Chan
2026-04-17 1:18 ` Vineeth Pillai
2026-04-19 3:03 ` Vineeth Remanan Pillai
2026-04-21 16:54 ` [PATCH v2] KVM: eventfd: Use WQ_UNBOUND workqueue for irqfd cleanup - New logs confirm preemption race Sonam Sanju
2026-04-21 18:22 ` Tejun Heo
2026-04-23 9:01 ` Sonam Sanju [this message]
2026-04-23 13:25 ` [PATCH v2] KVM: irqfd: fix deadlock by moving synchronize_srcu out of resampler_lock Vineeth Remanan Pillai
2026-04-21 5:12 ` Sonam Sanju
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=20260423090100.3231633-1-sonam.sanju@intel.com \
--to=sonam.sanju@intel.com \
--cc=dmaluka@chromium.org \
--cc=kunwu.chan@linux.dev \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=rcu@vger.kernel.org \
--cc=seanjc@google.com \
--cc=stable@vger.kernel.org \
--cc=tj@kernel.org \
--cc=vineeth@bitbyteword.org \
/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