Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1531728ybz; Thu, 16 Apr 2020 10:48:51 -0700 (PDT) X-Google-Smtp-Source: APiQypKwnY9+t2GaiEhTXfhMNoTjKVa7Ze7N+pyT2ksVIqeWZr8/n+QT0b/dU4Mnkj/4wXyvq4kQ X-Received: by 2002:a05:6402:1215:: with SMTP id c21mr10105426edw.128.1587059331022; Thu, 16 Apr 2020 10:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587059331; cv=none; d=google.com; s=arc-20160816; b=f5BmgaJ7q4OkriIq1O6r/YM4wppf/zk+aPI7hUHGXs6TEJhk6/Qhz5/eyCXVfVJcn4 TP3ly9i9rQTImOh+dv3lAlneEQFNha9W/WCY2atKWpXwGe0R6+Ij5e7RV9XSN9J/2vv7 nZPYK4OEvRNu9sz+UnGoEhLusJ/Ril2JVgFNgc5GsPdZiPrMR4ZGqb1v0oYJ8ByOHSMH OI2aqFhpNAMQc89HJmE7EAzfda1cpZMrNWJGOxUKNbkuuoudlzcTzRcBkxEtXnoaCjxb FcHws/xfrvqcq5QYjTGUT/kmT/dt7xju4uP6DCx1o2n9jdaFSr9xemM75qVqLO1ww6n+ Z3mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=OZKb8E+rtVIaA9FeIgxP8gSh1sNSjkiAH1vBdSPu9SY=; b=mFQ2ErJgPtB06axuM1GgigkLhYF4pQ3WshJa1gVbg0GrE2iyP4Zt81rTHHDxTUQ3lx uS9nIfXPswT/1Y4mVd+OuhpgUxr2dZTurezFXUh3ODYeYqLQLwel2OTaV0LiIkv/k/2W 5M4Y8ezHloehSQKUAqtTFSgC9kRnTZkjqDll/jU4Ws+KRFRiIX3qj7H4t3t6PPxV0OSb 8bS0kosk70EfQ7osthVtYiJSHMCzCnE1AbNgp48ELyuA+eeH/HmVUYDI7eZYDc0gYrU4 coWNAEvkdnGgR8chmcUxKJHURalHXis8DzjCHal0h/6dCvl4V5+jgSiRKDLlM/qMkwaO U6Aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gr24si12464902ejb.162.2020.04.16.10.48.27; Thu, 16 Apr 2020 10:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2894450AbgDPMyX (ORCPT + 99 others); Thu, 16 Apr 2020 08:54:23 -0400 Received: from mga07.intel.com ([134.134.136.100]:56523 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2894377AbgDPMyU (ORCPT ); Thu, 16 Apr 2020 08:54:20 -0400 IronPort-SDR: FojiQLcyoHzbKNpbMoGB+kduzJnxfbIk+mw2YWYxSoFaEse2ZJf30vOr/bj/XJIFYQtFrJvHW7 /3nUaOxKhthw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2020 05:54:17 -0700 IronPort-SDR: 2TWSUvSo2BpQ7WsbpwBWIS7QOg1aMl494NOtDrQ0w9oEj0roNF0ut0BpZBlr0jyuB+BJyENMYL TB/ez5YBnYOA== X-IronPort-AV: E=Sophos;i="5.72,391,1580803200"; d="scan'208";a="400659843" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.249.170.42]) ([10.249.170.42]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2020 05:54:15 -0700 Subject: Re: [PATCH] x86, smpboot: Disable frequency invariance when it's unsupported To: Giovanni Gherdovich Cc: Peter Zijlstra , Ingo Molnar , Doug Smythies , "Rafael J . Wysocki" , LKML References: <20200416020700.167294-1-like.xu@linux.intel.com> <1587017284.32139.20.camel@suse.cz> <1587026430.32139.29.camel@suse.cz> From: Like Xu Organization: Intel OTC Message-ID: Date: Thu, 16 Apr 2020 20:54:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1587026430.32139.29.camel@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/16 16:40, Giovanni Gherdovich wrote: > On Thu, 2020-04-16 at 15:01 +0800, Like Xu wrote: >> On 2020/4/16 14:08, Giovanni Gherdovich wrote: >>> [...] >>> 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. > > Right, your C6562 has 24 cores, (I think) it doesn't support turbo at all, > declares 1C turbo equal to the base frequency and all other turbo ratios (2C, > 4C etc) as zero. > > The commit message of the fix I sent doesn't describe exactly your situation > but the patch addresses your case nonetheless. Some more comments below. > > On Thu, 2020-04-16 at 15:01 +0800, Like Xu wrote: >> On 2020/4/16 14:08, Giovanni Gherdovich wrote: >>> [...] >>> 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). > > That's an interesting CPU; let me indulge in a couple of comments/questions > for my own curiosity. >>From the document you link, the product name in the Intel catalogue seems to > be Atom P5962B. Apparently it belongs to the "P Series" just launched: > https://ark.intel.com/content/www/us/en/ark/products/series/202693/intel-atom-processor-p-series.html > and your product brief suggests it's meant for installation in 5G base stations. > > 1) Can you share the output of "turbostat --interval 1 sleep 0"? I'm > interested in the headers of the output, where all the various pm-related > MSRs are decoded. > I couldn't disclose more information about this. > 2) Despite not being in the Intel SDM, I was under the assumption that all > Intel CPUs declare the "all-cores turbo" frequency, but it's not the case > for this one. Eg: if you have 24 cores, somewhere in your MSRs I'd expect > to find "24C turbo" (or even "30C turbo", anything greater or equal than 24). > My understanding from > https://ark.intel.com/content/www/us/en/ark/products/202682/intel-atom-processor-p5962b-27m-cache-2-20-ghz.html > is that this CPU doesn't support turbo boost at all; in other CPUs without > turbo I've seen MSRs saying the all-cores turbo freq is equal to the base > freq (for compatibility I suppose). Here MSR_TURBO_RATIO_LIMIT says that 1C > turbo is the same as base frequency (2.2GHz), but turbo for larger sets of > cores is declared as zero, which I find a little odd. That's odd and we could only rely on the Intel specification about the assumption "Intel CPUs declare the all-cores turbo frequency" and I may report this issue if something does mismatch. > > 3) The parsing of MSRs in the frequency invariance code is modeled after > turbostat, and classifies CPUs in 5 groups: Atom up to Goldmont, Atom from > Goldmont onwards, Xeon Phi, Xeon Scalable Processors onwards and "generic > Core". As you've already found out from where your panic happens, your Atom > falls into the "generic Core" category (function core_set_max_freq_ratio()), > but given that it's an Atom and it's been released this very quarter I'd > have guessed it to behave like a Goldmont. Something for me to keep in mind. It's INTEL_FAM6_ATOM_TREMONT or INTEL_FAM6_ATOM_TREMONT_D. Thanks, Like Xu > > > Thanks, > Giovanni Gherdovich >