LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mingwei Zhang <mizhang@google.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Ben Gardon <bgardon@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>, kvm <kvm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	David Matlack <dmatlack@google.com>,
	Jing Zhang <jingzhangos@google.com>, Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH v3 2/2] selftests: KVM: use dirty logging to check if page stats work correctly
Date: Mon, 6 Sep 2021 13:05:21 -0700	[thread overview]
Message-ID: <CAL715WJUmRJmt=u4Gi3ydTpbTGy2M5Wi=CbF9Qs8GNRK8g5FAA@mail.gmail.com> (raw)
In-Reply-To: <YS5fxJtX/nYb43ir@google.com>

On Tue, Aug 31, 2021 at 9:58 AM Sean Christopherson <seanjc@google.com> wrote:
>
> On Mon, Aug 30, 2021, Ben Gardon wrote:
> > On Sun, Aug 29, 2021 at 9:44 PM Mingwei Zhang <mizhang@google.com> wrote:
> > > diff --git a/tools/testing/selftests/kvm/lib/test_util.c b/tools/testing/selftests/kvm/lib/test_util.c
> > > index af1031fed97f..07eb6b5c125e 100644
> > > --- a/tools/testing/selftests/kvm/lib/test_util.c
> > > +++ b/tools/testing/selftests/kvm/lib/test_util.c
> > > @@ -15,6 +15,13 @@
> > >  #include "linux/kernel.h"
> > >
> > >  #include "test_util.h"
> > > +#include "processor.h"
> > > +
> > > +static const char * const pagestat_filepaths[] = {
> > > +       "/sys/kernel/debug/kvm/pages_4k",
> > > +       "/sys/kernel/debug/kvm/pages_2m",
> > > +       "/sys/kernel/debug/kvm/pages_1g",
> > > +};
> >
> > I think these should only be defined for x86_64 too. Is this the right
> > file for these definitions or is there an arch specific file they
> > should go in?
>
> The stats also need to be pulled from the selftest's VM, not from the overall KVM
> stats, otherwise the test will fail if there are any other active VMs on the host,
> e.g. I like to run to selftests and kvm-unit-tests in parallel.

That is correct. But since this selftest is not the 'default' selftest
that people normally run, can we make an assumption on running these
tests at this moment? I am planning to submit this test and improve it
in the next series by using Jing's fd based KVM stats interface to
eliminate the assumption of the existence of a single running VM.
Right now, this interface still needs some work, so I am taking a
shortcut that directly uses the whole-system metricfs based interface.

But I can choose to do that and submit the fd-based API together with
this series. What do you suggest?

  reply	other threads:[~2021-09-06 20:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  4:44 [PATCH v3 0/2] selftests: KVM: verify page stats in kvm x86/mmu Mingwei Zhang
2021-08-30  4:44 ` [PATCH v3 1/2] selftests: KVM: align guest physical memory base address to 1GB Mingwei Zhang
2021-08-30 20:58   ` Ben Gardon
2021-08-30  4:44 ` [PATCH v3 2/2] selftests: KVM: use dirty logging to check if page stats work correctly Mingwei Zhang
2021-08-30 21:10   ` Ben Gardon
2021-08-31 16:58     ` Sean Christopherson
2021-09-06 20:05       ` Mingwei Zhang [this message]
2021-09-08 16:07         ` Mingwei Zhang

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='CAL715WJUmRJmt=u4Gi3ydTpbTGy2M5Wi=CbF9Qs8GNRK8g5FAA@mail.gmail.com' \
    --to=mizhang@google.com \
    --cc=bgardon@google.com \
    --cc=dmatlack@google.com \
    --cc=jingzhangos@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=seanjc@google.com \
    --subject='Re: [PATCH v3 2/2] selftests: KVM: use dirty logging to check if page stats work correctly' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).