[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c6ceb0a5-c3fa-790e-d3c7-228c71a477c2@amd.com>
Date: Wed, 6 Apr 2022 11:44:52 +0530
From: Wyes Karny <wyes.karny@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, Lewis.Carroll@....com,
Mario.Limonciello@....com, gautham.shenoy@....com,
Ananth.Narayan@....com, bharata@....com, len.brown@...el.com,
x86@...nel.org, tglx@...utronix.de, mingo@...hat.com,
dave.hansen@...ux.intel.com, hpa@...or.com, peterz@...radead.org,
chang.seok.bae@...el.com, keescook@...omium.org, metze@...ba.org,
zhengqi.arch@...edance.com, mark.rutland@....com
Subject: Re: [PATCH] x86: Prefer MWAIT over HALT on AMD processors
On 4/5/2022 7:35 PM, Borislav Petkov wrote:
> On Tue, Apr 05, 2022 at 06:30:21PM +0530, Wyes Karny wrote:
>> From: Lewis Caroll <lewis.carroll@....com>
>>
>> Currently in the absence of the cpuidle driver (eg: when global
>> C-States are disabled in the BIOS or when cpuidle is driver is not
>> compiled in),
>
> When does that ever happen?
>
> Sounds like a very very niche situation to me...
Certain customers prefer to turn off C-States from the BIOS in
low-latency environments.
>
>> Here we enable MWAIT instruction as the default idle call for AMD
>> Zen processors which support MWAIT. We retain the existing behaviour
>> for older processors which depend on HALT.
>
> Please use passive voice in your commit message: no "we" or "I", etc,
> and describe your changes in imperative mood.
>
> Also, pls read section "2) Describe your changes" in
> Documentation/process/submitting-patches.rst for more details.
>
> Also, see section "Changelog" in
> Documentation/process/maintainer-tip.rst
>
> Bottom line is: personal pronouns are ambiguous in text, especially with
> so many parties/companies/etc developing the kernel so let's avoid them
> please.
Sure. I'll update this. Thanks.
>
>> static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c)
>> {
>> - if (c->x86_vendor != X86_VENDOR_INTEL)
>> + if (!early_mwait_supported(c))
>
> Isn't it enough to simply do here:
>
> if (cpu_has(c, X86_FEATURE_ZEN))
> return 1;
>
> if (c->x86_vendor != X86_VENDOR_INTEL)
> return 0;
>
> ...
>
>
If x86_FEATURE_ZEN is set and X86_FEATURE_MWAIT is not set or has X86_BUG_MONITOR
then it won't return correct value.
--
Thanks,
Wyes
Powered by blists - more mailing lists