From: Like Xu <like.xu@linux.intel.com>
To: Giovanni Gherdovich <ggherdovich@suse.cz>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Doug Smythies <dsmythies@telus.net>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86, smpboot: Disable frequency invariance when it's unsupported
Date: Thu, 16 Apr 2020 15:01:49 +0800 [thread overview]
Message-ID: <bf43772d-48e5-01d4-dd03-330110e487fa@linux.intel.com> (raw)
In-Reply-To: <1587017284.32139.20.camel@suse.cz>
On 2020/4/16 14:08, Giovanni Gherdovich wrote:
> On Thu, 2020-04-16 at 10:12 +0800, Like Xu wrote:
>> On the Intel SNR processors such as "Intel Atom(R) C6562", the
>> turbo_freq for 4C turbo may be zero which causes a divide by zero
>> exception and blocks the boot process when arch_scale_freq_tick().
>>
>> When one of the preset base_freq or turbo_freq is meaningless,
>> we may disable frequency invariance.
>>
>> Fixes: 1567c3e3467c ("x86, sched: Add support for frequency invariance")
>> Signed-off-by: Like Xu <like.xu@linux.intel.com>
>> ---
>> arch/x86/kernel/smpboot.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
>> index fe3ab9632f3b..741367ce4d14 100644
>> --- a/arch/x86/kernel/smpboot.c
>> +++ b/arch/x86/kernel/smpboot.c
>> @@ -1958,6 +1958,9 @@ static bool core_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq)
>> *base_freq = (*base_freq >> 8) & 0xFF; /* max P state */
>> *turbo_freq = (*turbo_freq >> 24) & 0xFF; /* 4C turbo */
>>
>> + if (*turbo_freq == 0 || *base_freq == 0)
>> + return false;
>> +
>> return true;
>> }
>>
>
> Hello Like Xu,
>
> thanks for reporting this and for the patch. My preferred solution for when
> the 4 cores turbo freq is detected as zero would be to look for the 1 core turbo
> frequency, as we're likely on a machine with less than 4 cores. Is that the
> case on your Atom C6562? I couldn't find it on ark.intel.com.
The Atom C6562 is "24 cores" based on
https://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/atom-p5900-product-brief.pdf
#define MSR_PLATFORM_INFO 0x000000ce
the value for this msr is 80820f9801600
#define MSR_TURBO_RATIO_LIMIT 0x000001ad
the value for this msr is 16
I know you didn't test your feature on this platform,
but combinations of other various values are also possible
(unless it's made clear in the specification).
>
> As per why I'd like to go with 1 core turbo instead of bailing out of freq
> invariance entirely, I've left a comment in the openSUSE bugzilla with some
> details: https://bugzilla.opensuse.org/show_bug.cgi?id=1166664#c35
> The relevant part is:
>
> :: The fix in this case is to take the 1 core turbo as normalizing factor. The
> :: other choice would be to use the base frequency (no turbo at all), but using
> :: base freq for normalization means that the ratio becomes current_freq / base_freq
> :: which is an over-estimation, which leads the frequency governor to think the
> :: CPU is more loaded than it really is and raise the frequency a bit too
> :: aggressively. This is tolerable in performance-oriented servers but
> :: inappropriate on small machines with 2 cores."
>
> Regarding base_freq being reported as zero, you're right, that can happen too
> and we've seen it in hypervisors.
>
> I've just sent fixes for these two problems here:
> https://lore.kernel.org/lkml/20200416054745.740-1-ggherdovich@suse.cz/
Hence the "less than 4 cores" comment is weird for C6562
but the use of "1C turbo" looks good to me.
Thanks,
Like Xu
>
>
> Thanks,
> Giovanni Gherdovich
>
next parent reply other threads:[~2020-04-16 7:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200416020700.167294-1-like.xu@linux.intel.com>
[not found] ` <1587017284.32139.20.camel@suse.cz>
2020-04-16 7:01 ` Like Xu [this message]
2020-04-16 8:40 ` Giovanni Gherdovich
2020-04-16 12:54 ` Like Xu
2020-04-16 18:09 ` Giovanni Gherdovich
2020-04-16 2:12 Like Xu
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=bf43772d-48e5-01d4-dd03-330110e487fa@linux.intel.com \
--to=like.xu@linux.intel.com \
--cc=dsmythies@telus.net \
--cc=ggherdovich@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.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
Powered by JetHome