[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANRm+CwRPDpvN_gcO=VbuukjEL2=OPYnxtqoJO6vTk4Z3nudvQ@mail.gmail.com>
Date: Fri, 6 Mar 2020 10:27:26 +0800
From: Wanpeng Li <kernellwp@...il.com>
To: linmiaohe <linmiaohe@...wei.com>
Cc: "hpa@...or.com" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"jmattson@...gle.com" <jmattson@...gle.com>,
"joro@...tes.org" <joro@...tes.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>
Subject: Re: [PATCH] KVM: x86: small optimization for is_mtrr_mask calculation
On Fri, 6 Mar 2020 at 10:23, linmiaohe <linmiaohe@...wei.com> wrote:
>
> hpa@...or.com wrote:
> >>On March 5, 2020 6:05:40 PM PST, linmiaohe <linmiaohe@...wei.com> wrote:
> >>Hi,
> >>Paolo Bonzini <pbonzini@...hat.com> wrote:
> >>Many thanks for suggestion. What do you mean is like this ?
> >>
> >> index = (msr - 0x200) >> 1;
> >> is_mtrr_mask = msr & 1;
> >>
> >>Thanks again.
> >
> >You realize that the compiler will probably produce exactly the same code, right? As such, it is about making the code easy for the human reader.
> >
> >Even if it didn't, this code is as far from performance critical as one can possibly get.
>
> Yep, it looks gain little. Thanks.
Please post the performance number when you mention optimize XXX later.
Wanpeng
Powered by blists - more mailing lists