public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>
Cc: borntraeger@linux.ibm.com, frankja@linux.ibm.com,
	david@redhat.com, kvm@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH v1 2/3] KVM: s390: add stat counter for shadow gmap events
Date: Tue, 9 May 2023 17:17:29 +0200	[thread overview]
Message-ID: <20230509171729.1a69f89b@p-imbrenda> (raw)
In-Reply-To: <168364399371.331309.5908202452338432368@t14-nrb>

On Tue, 09 May 2023 16:53:13 +0200
Nico Boehr <nrb@linux.ibm.com> wrote:

> Quoting Claudio Imbrenda (2023-05-09 13:43:51)
> [...]
> > > diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
> > > index 3eb85f254881..8348a0095f3a 100644
> > > --- a/arch/s390/kvm/gaccess.c
> > > +++ b/arch/s390/kvm/gaccess.c
> > > @@ -1382,6 +1382,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
> > >                                 unsigned long *pgt, int *dat_protection,
> > >                                 int *fake)
> > >  {
> > > +     struct kvm *kvm;
> > >       struct gmap *parent;
> > >       union asce asce;
> > >       union vaddress vaddr;
> > > @@ -1390,6 +1391,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
> > >  
> > >       *fake = 0;
> > >       *dat_protection = 0;
> > > +     kvm = sg->private;
> > >       parent = sg->parent;
> > >       vaddr.addr = saddr;
> > >       asce.val = sg->orig_asce;
> > > @@ -1450,6 +1452,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
> > >               rc = gmap_shadow_r2t(sg, saddr, rfte.val, *fake);
> > >               if (rc)
> > >                       return rc;
> > > +             kvm->stat.gmap_shadow_r2++;
> > >       }
> > >               fallthrough;
> > >       case ASCE_TYPE_REGION2: {
> > > @@ -1478,6 +1481,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
> > >               rc = gmap_shadow_r3t(sg, saddr, rste.val, *fake);
> > >               if (rc)
> > >                       return rc;
> > > +             kvm->stat.gmap_shadow_r3++;
> > >       }
> > >               fallthrough;
> > >       case ASCE_TYPE_REGION3: {
> > > @@ -1515,6 +1519,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
> > >               rc = gmap_shadow_sgt(sg, saddr, rtte.val, *fake);
> > >               if (rc)
> > >                       return rc;
> > > +             kvm->stat.gmap_shadow_segment++;
> > >       }
> > >               fallthrough;
> > >       case ASCE_TYPE_SEGMENT: {
> > > @@ -1548,6 +1553,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
> > >               rc = gmap_shadow_pgt(sg, saddr, ste.val, *fake);
> > >               if (rc)
> > >                       return rc;
> > > +             kvm->stat.gmap_shadow_page++;  
> > 
> > do I understand correctly that, if several levels need to be shadowed
> > at the same time, you will increment every affected counter, and not
> > just the highest or lowest level?
> > 
> > if so, please add a brief explanation to the patch description  
> 
> Yes, that seemed like the simplest thing to do.
> 
> Will add a explanation.
> 
> Or should I add a flag and only increment the top level?

that's up to you, see what makes more sense

  reply	other threads:[~2023-05-09 15:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 11:11 [PATCH v1 0/3] KVM: s390: add counters for vsie performance Nico Boehr
2023-05-09 11:12 ` [PATCH v1 1/3] KVM: s390: fix space before open parenthesis Nico Boehr
2023-05-09 11:19   ` Claudio Imbrenda
2023-05-09 11:12 ` [PATCH v1 2/3] KVM: s390: add stat counter for shadow gmap events Nico Boehr
2023-05-09 11:43   ` Claudio Imbrenda
2023-05-09 14:53     ` Nico Boehr
2023-05-09 15:17       ` Claudio Imbrenda [this message]
2023-05-09 11:59   ` Janosch Frank
2023-05-09 14:54     ` Nico Boehr
2023-05-09 15:14       ` Claudio Imbrenda
2023-05-10  6:45         ` Janosch Frank
2023-05-09 11:12 ` [PATCH v1 3/3] KVM: s390: add tracepoint in gmap notifier Nico Boehr
2023-05-09 11:48   ` Claudio Imbrenda
2023-05-09 14:54     ` Nico Boehr

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=20230509171729.1a69f89b@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.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