[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190520150829.GB28482@linux.intel.com>
Date: Mon, 20 May 2019 08:08:29 -0700
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: Wanpeng Li <kernellwp@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kvm <kvm@...r.kernel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Liran Alon <liran.alon@...cle.com>
Subject: Re: [PATCH v3 5/5] KVM: LAPIC: Optimize timer latency further
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@...el.com> wrote:
> >
> > On Thu, May 16, 2019 at 11:06:20AM +0800, Wanpeng Li wrote:
> > > From: Wanpeng Li <wanpengli@...cent.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);
Powered by blists - more mailing lists