All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Liran Alon" <liran.alon@oracle.com>
Subject: Re: [PATCH v3 5/5] KVM: LAPIC: Optimize timer latency further
Date: Mon, 20 May 2019 08:08:29 -0700	[thread overview]
Message-ID: <20190520150829.GB28482@linux.intel.com> (raw)
In-Reply-To: <CANRm+CwfDbVS2tYG0XCD8Gvx6GtszGLphiTvFMBYmwdt13P=1Q@mail.gmail.com>

On Mon, May 20, 2019 at 04:19:47PM +0800, Wanpeng Li wrote:
> On Sat, 18 May 2019 at 03:50, Sean Christopherson
> <sean.j.christopherson@intel.com> wrote:
> >
> > On Thu, May 16, 2019 at 11:06:20AM +0800, Wanpeng Li wrote:
> > > From: Wanpeng Li <wanpengli@tencent.com>
> > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> > > index 6b92eaf..955cfcb 100644
> > > --- a/arch/x86/kvm/svm.c
> > > +++ b/arch/x86/kvm/svm.c
> > > @@ -5638,6 +5638,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
> > >       clgi();
> > >       kvm_load_guest_xcr0(vcpu);
> > >
> > > +     if (lapic_in_kernel(vcpu) &&
> > > +             vcpu->arch.apic->lapic_timer.timer_advance_ns)
> >
> > Nit: align the two lines of the if statement, doing so makes it easier to
> >      differentiate between the condition and execution, e.g.:
> >
> >         if (lapic_in_kernel(vcpu) &&
> >             vcpu->arch.apic->lapic_timer.timer_advance_ns)
> >                 kvm_wait_lapic_expire(vcpu);
> 
> This can result in checkpatch.pl complain:
> 
> WARNING: suspect code indent for conditional statements (8, 24)
> #94: FILE: arch/x86/kvm/vmx/vmx.c:6436:
> +    if (lapic_in_kernel(vcpu) &&
> [...]
> +            kvm_wait_lapic_expire(vcpu);

That warning fires when the last line of the check and the code block of
the if statement are aligned (and the indent isn't a full tab stop, which
is why your original code isn't flagged).  Examples with explicit leading
whitespace:

Good:

\tif (lapic_in_kernel(vcpu) &&
\t\s\s\s\svcpu->arch.apic->lapic_timer.timer_advance_ns)
\t\tkvm_wait_lapic_expire(vcpu);

Bad:

\tif (lapic_in_kernel(vcpu) &&
\t\s\s\s\svcpu->arch.apic->lapic_timer.timer_advance_ns)
\t\s\s\s\skvm_wait_lapic_expire(vcpu);

  reply	other threads:[~2019-05-20 15:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16  3:06 [PATCH v3 0/5] KVM: LAPIC: Optimize timer latency further Wanpeng Li
2019-05-16  3:06 ` [PATCH v3 1/5] KVM: LAPIC: Extract adaptive tune timer advancement logic Wanpeng Li
2019-05-16  3:06 ` [PATCH v3 2/5] KVM: LAPIC: Fix lapic_timer_advance_ns parameter overflow Wanpeng Li
2019-05-16  3:06 ` [PATCH v3 3/5] KVM: LAPIC: Expose per-vCPU timer_advance_ns to userspace Wanpeng Li
2019-05-17 20:05   ` Sean Christopherson
2019-05-20  8:43     ` Wanpeng Li
2019-05-16  3:06 ` [PATCH v3 4/5] KVM: LAPIC: Delay trace advance expire delta Wanpeng Li
2019-05-17 19:44   ` Sean Christopherson
2019-05-20  6:38     ` Wanpeng Li
2019-05-20 14:56       ` Sean Christopherson
2019-05-16  3:06 ` [PATCH v3 5/5] KVM: LAPIC: Optimize timer latency further Wanpeng Li
2019-05-17 19:50   ` Sean Christopherson
2019-05-20  8:19     ` Wanpeng Li
2019-05-20 15:08       ` Sean Christopherson [this message]
2019-06-12  9:35 [PATCH v3 0/5] " Wanpeng Li
2019-06-12  9:36 ` [PATCH v3 5/5] " Wanpeng Li

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=20190520150829.GB28482@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liran.alon@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.