From: Yan Zhao <yan.y.zhao@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<pbonzini@redhat.com>
Subject: Re: [PATCH v3] KVM: VMX: fix lockdep warning on posted intr wakeup
Date: Wed, 29 Mar 2023 09:53:33 +0800 [thread overview]
Message-ID: <ZCOaHWE6aS0vjvya@yzhao56-desk.sh.intel.com> (raw)
In-Reply-To: <ZB4uoe9WBzhG9ddU@google.com>
On Fri, Mar 24, 2023 at 04:13:37PM -0700, Sean Christopherson wrote:
> On Mon, Mar 13, 2023, Yan Zhao wrote:
> > The lock ordering after this patch are:
> > - &p->pi_lock --> &rq->__lock -->
> > &per_cpu(wakeup_vcpus_on_cpu_lock_out, cpu)
> > - &per_cpu(wakeup_vcpus_on_cpu_lock_in, cpu) -->
> > &per_cpu(wakeup_vcpus_on_cpu_lock_out, cpu)
> > - &per_cpu(wakeup_vcpus_on_cpu_lock_in, cpu) --> &p->pi_lock
> >
> > Currently, &rq->__lock is not held in "path sched_in".
> > However, if in future "path sched_in" takes &p->pi_lock or &rq->__lock,
> > lockdep is able to detect and warn in that case.
> >
> > Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
> > [sean: path sched_out and path irq does not race, path sched_in does not
> > take &rq->__lock]
>
> But there's no actual deadlock, right? I have zero interest in fixing a lockdep
> false positive by making functional changes to KVM. I am definitely open to making
> changes to somehow let lockdep know what's going on, but complicating KVM's actual
> functionality is too much.
Yes, there's no actual deadlock currently.
But without fixing this issue, debug_locks will be set to false along
with below messages printed. Then lockdep will be turned off and any
other lock detections like lockdep_assert_held()... will not print
warning even when it's obviously violated.
[ 118.873499] ======================================================
[ 118.880413] WARNING: possible circular locking dependency detected
[ 118.887325] 6.2.0-rc5+ #600 Not tainted
[ 118.891613] ------------------------------------------------------
[ 118.898519] swapper/5/0 is trying to acquire lock:
[ 118.903869] ffff88810f5cac90 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xbb/0x510
[ 118.912624]
[ 118.912624] but task is already holding lock:
[ 118.919138] ffff88885f7fdab8 (&per_cpu(wakeup_vcpus_on_cpu_lock, cpu)){-...}-{2:2}, at: pi_wakeup_handler+0x36/0x80 [kvm_intel]
[ 118.931962]
[ 118.931962] which lock already depends on the new lock.
Any suggestion?
next prev parent reply other threads:[~2023-03-29 2:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 11:10 Yan Zhao
2023-03-24 23:13 ` Sean Christopherson
2023-03-29 1:53 ` Yan Zhao [this message]
2023-03-29 11:51 ` Paolo Bonzini
2023-03-30 9:56 ` Yan Zhao
2023-03-30 18:14 ` Sean Christopherson
2023-03-31 0:06 ` Yan Zhao
2023-04-10 17:30 ` Sean Christopherson
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=ZCOaHWE6aS0vjvya@yzhao56-desk.sh.intel.com \
--to=yan.y.zhao@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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®