kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Michael Tokarev <mjt@tls.msk.ru>
Subject: Re: [PATCH v2 1/3] context_tracking: Split guest_enter/exit_irqoff
Date: Tue, 13 Apr 2021 15:52:35 +0800	[thread overview]
Message-ID: <CANRm+Cw=7kKztPFHaXrK926ve7pY3NN4O22t_QaevHnCXqX5tg@mail.gmail.com> (raw)
In-Reply-To: <4551632e-5584-29f6-68dd-d85fa968858b@de.ibm.com>

On Tue, 13 Apr 2021 at 15:48, Christian Borntraeger
<borntraeger@de.ibm.com> wrote:
>
>
>
> On 13.04.21 09:38, Wanpeng Li wrote:
> > On Tue, 13 Apr 2021 at 15:35, Christian Borntraeger
> > <borntraeger@de.ibm.com> wrote:
> >>
> >>
> >>
> >> On 13.04.21 09:16, Wanpeng Li wrote:
> >> [...]
> >>
> >>> @@ -145,6 +155,13 @@ static __always_inline void guest_exit_irqoff(void)
> >>>    }
> >>>
> >>>    #else
> THis is the else part
>
>
> >>> +static __always_inline void context_guest_enter_irqoff(void)
> >>> +{
> >>> +     instrumentation_begin();
>
> 2nd on
> >>> +     rcu_virt_note_context_switch(smp_processor_id());
> >>> +     instrumentation_end();
> 2nd off
> >>> +}
> >>> +
> >>>    static __always_inline void guest_enter_irqoff(void)
> >>>    {
> >>>        /*
> >>> @@ -155,10 +172,13 @@ static __always_inline void guest_enter_irqoff(void)
> >>>        instrumentation_begin();
>
> first on
> >>>        vtime_account_kernel(current);
> >>>        current->flags |= PF_VCPU;
> >>> -     rcu_virt_note_context_switch(smp_processor_id());
> >>>        instrumentation_end();
>
> first off
> >>> +
> >>> +     context_guest_enter_irqoff();
> here we call the 2nd on and off.
> >>
> >> So we now do instrumentation_begin 2 times?
> >
> > Similar to context_guest_enter_irqoff() ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN.
>
> For the
> ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN part
> context_guest_enter_irqoff()
> does not have instrumentation_begin/end.
>
> Or did I miss anything.

I mean the if (!context_tracking_enabled_this_cpu()) part in the
function context_guest_enter_irqoff() ifdef
CONFIG_VIRT_CPU_ACCOUNTING_GEN. :)

    Wanpeng

  reply	other threads:[~2021-04-13  7:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13  7:16 [PATCH v2 0/3] KVM: Properly account for guest CPU time Wanpeng Li
2021-04-13  7:16 ` [PATCH v2 1/3] context_tracking: Split guest_enter/exit_irqoff Wanpeng Li
2021-04-13  7:35   ` Christian Borntraeger
2021-04-13  7:38     ` Wanpeng Li
2021-04-13  7:48       ` Christian Borntraeger
2021-04-13  7:52         ` Wanpeng Li [this message]
2021-04-13  8:07           ` Christian Borntraeger
2021-04-13  7:16 ` [PATCH v2 2/3] context_tracking: Provide separate vtime accounting functions Wanpeng Li
2021-04-13  7:16 ` [PATCH v2 3/3] x86/kvm: Fix vtime accounting Wanpeng Li
2021-04-13  8:32 ` [PATCH v2 0/3] KVM: Properly account for guest CPU time Christian Borntraeger
2021-04-13 17:25 ` Sean Christopherson
2021-04-14  9:36   ` Wanpeng Li
2021-04-15  0:49     ` Sean Christopherson
2021-04-15  1:23       ` Wanpeng Li
2021-04-15 19:02         ` 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='CANRm+Cw=7kKztPFHaXrK926ve7pY3NN4O22t_QaevHnCXqX5tg@mail.gmail.com' \
    --to=kernellwp@gmail.com \
    --cc=borntraeger@de.ibm.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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;
as well as URLs for NNTP newsgroup(s).