From: Sean Christopherson <seanjc@google.com>
To: Suleiman Souhlal <suleiman@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Chao Gao <chao.gao@intel.com>,
David Woodhouse <dwmw2@infradead.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
ssouhlal@freebsd.org
Subject: Re: [PATCH v3 2/3] KVM: x86: Include host suspended time in steal time.
Date: Wed, 8 Jan 2025 07:17:58 -0800 [thread overview]
Message-ID: <Z36XJl1OAahVkxhl@google.com> (raw)
In-Reply-To: <CABCjUKB-pzcY-XFzpBQ6mRi-LiPJ7exAwr+RQXR-pD+P0cxrYA@mail.gmail.com>
On Wed, Jan 08, 2025, Suleiman Souhlal wrote:
> On Wed, Jan 8, 2025 at 12:37 AM Sean Christopherson <seanjc@google.com> wrote:
> > On Tue, Jan 07, 2025, Suleiman Souhlal wrote:
> > > Note that the case of a suspend happening during a VM migration
> > > might not be accounted.
> >
> > And this isn't considered a bug because? I asked for documentation, not a
> > statement of fact.
>
> I guess I don't really understand what the difference between documentation
> and statements of fact is.
It's the difference between "X may be buggy" and "X has this exact caveat because
KVM doesn't support saving/restoring associated metadata". For this case, I'm
pretty sure it's possible to document exactly when suspended time will be lost,
what may happen if that accounted time is lost, what userspace could do to avoid
dropping suspend time, and finally for the changelog only, specifically why KVM
support for accounting suspended time is *intentionally* not providing APIs to
save/restore pending suspended time.
> It's not completely clear to me what the desired behavior would be when
> suspending during a VM migration.
That's fine, it's not your (or KVM's) responsibility to know the desired
behavior for every possible/theoretical use case. But as above, it *is* KVM's
responsibility to properly document any caveats with functionality.
> If we wanted to inject the suspend duration that happened after the migration
> started, but before it ended, I suppose we would need to add a way for the
> new VM instance to add to steal time, possibly through a new uAPI.
It's not just migration, and it's not just the case where the host is suspended
*after* vCPU state is saved. Pending suspended time will also be lost if vCPU
state is saved after suspend+resume without entering the guest (because the
accounting is done late in KVM_RUN).
> It is also not clear to me why we would want that.
Which is fine as well. If some crazy use case cares about accounting suspended
time across save+restore, then the onus is on that use case to implement and
justify appropriate support.
next prev parent reply other threads:[~2025-01-08 15:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 4:21 [PATCH v3 0/3] KVM: x86: Include host suspended time in steal time Suleiman Souhlal
2025-01-07 4:21 ` [PATCH v3 1/3] kvm: Introduce kvm_total_suspend_ns() Suleiman Souhlal
2025-01-07 15:27 ` Sean Christopherson
2025-01-07 16:43 ` Suleiman Souhlal
2025-01-08 7:15 ` kernel test robot
2025-01-08 8:36 ` kernel test robot
2025-01-15 21:49 ` Sean Christopherson
2025-01-17 6:35 ` Suleiman Souhlal
2025-01-17 16:52 ` Sean Christopherson
2025-01-21 5:37 ` Suleiman Souhlal
2025-01-21 20:22 ` Sean Christopherson
2025-02-04 7:58 ` Suleiman Souhlal
2025-02-05 5:55 ` Suleiman Souhlal
2025-02-06 1:29 ` Sean Christopherson
2025-02-13 3:56 ` Suleiman Souhlal
2025-01-07 4:22 ` [PATCH v3 2/3] KVM: x86: Include host suspended time in steal time Suleiman Souhlal
2025-01-07 15:37 ` Sean Christopherson
2025-01-08 4:05 ` Suleiman Souhlal
2025-01-08 15:17 ` Sean Christopherson [this message]
2025-01-07 4:22 ` [PATCH v3 3/3] KVM: x86: Document host suspend being included " Suleiman Souhlal
2025-01-07 15:37 ` 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=Z36XJl1OAahVkxhl@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=chao.gao@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=ssouhlal@freebsd.org \
--cc=suleiman@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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