Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp449490ybl; Wed, 29 Jan 2020 03:35:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzkdRtdl/M6P0e2r1cUgIf6P0/WtlHhCvRV9QWTwclcSP/dubXRbxHkBK52tyT0HkLuGsb2 X-Received: by 2002:aca:ebc2:: with SMTP id j185mr248436oih.71.1580297713087; Wed, 29 Jan 2020 03:35:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580297713; cv=none; d=google.com; s=arc-20160816; b=Y3vdU7XbwMM3rhWVxBHvIEAdgQM3xP7JVRfUS/o+f4enpfpc5naCV4JkPDcVn8wqke Syx8T/5sW88HWnVVz+9akdhuwmFbIqHgCJ1IXgF89ub3jn0yPAOdhgkUQwnE1v+jkpDd 1ZXjs52IUPxphpvDKPND9BPIvks6WjhPzrunW9yxFjcqZP0Z+TFPuWkb49gudZF6lw26 ROWxo7JBKAj45C6WpSDgT/AWaQX0mBu2CmKlZS6P0L4vgK4C4t0TzZwwS1l1+qYKZnk6 nG1tgFNkVmDzI0ZQ6m5FxX8PE2aQfH5GKI6uDxDfe0DLHlQnoim9o8aYd0UMeGOn/8Yp 3bGw== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=Vx8Nl8U4dpVZNjt1myOcipTZT+xTc6HMj11WblfBFbI=; b=ROgX93oqdo7zRcVPeKUIEGifGVtZW11xtdF8bQJk2gzixivaeSvcVtBikiruXk02Mk 61Gqm4toy6EOKXQmiDSn2OtJGZ+u1ihbZ1+ocatsmtHdpUmbWTgUzlAfmVkR7rAkjORr qYFbA+SmJbWI+fam5g1hRSPR0SqsPDnPGdiQvOQkfavfMWH3kYZPivyEO5PWHla5TXsv zNcRZoPRnHvLhRneANvzZyQlxGKj37vUFlDmAM8ets+0Gb1a1d3T4ixFciIGl4G27AF3 TtWsy5EbvmVfFMApkF3ZLqmIEphG+Dtk5bVFXG6StnrqqvBiYQlloy4heQcD44m7lLzG cWFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si1071546otd.143.2020.01.29.03.35.00; Wed, 29 Jan 2020 03:35:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726772AbgA2LdN (ORCPT + 99 others); Wed, 29 Jan 2020 06:33:13 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:51092 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbgA2LdK (ORCPT ); Wed, 29 Jan 2020 06:33:10 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iwlac-0007lh-7b; Wed, 29 Jan 2020 12:32:58 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id D462A1C1C18; Wed, 29 Jan 2020 12:32:57 +0100 (CET) Date: Wed, 29 Jan 2020 11:32:57 -0000 From: "tip-bot2 for Giovanni Gherdovich" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] x86, sched: Add support for frequency invariance on ATOM_GOLDMONT* Cc: Giovanni Gherdovich , "Peter Zijlstra (Intel)" , Ingo Molnar , "Rafael J. Wysocki" , x86 , LKML In-Reply-To: <20200122151617.531-5-ggherdovich@suse.cz> References: <20200122151617.531-5-ggherdovich@suse.cz> MIME-Version: 1.0 Message-ID: <158029757767.396.11378452463371953828.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: 1.5 X-Linutronix-Spam-Level: + X-Linutronix-Spam-Status: No , 1.5 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_DBL_ABUSE_MALW=2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: eacf0474aec8bdccdc7f19386319127c67be3588 Gitweb: https://git.kernel.org/tip/eacf0474aec8bdccdc7f19386319127c67be3588 Author: Giovanni Gherdovich AuthorDate: Wed, 22 Jan 2020 16:16:15 +01:00 Committer: Ingo Molnar CommitterDate: Tue, 28 Jan 2020 21:37:04 +01:00 x86, sched: Add support for frequency invariance on ATOM_GOLDMONT* The scheduler needs the ratio freq_curr/freq_max for frequency-invariant accounting. On GOLDMONT (aka Apollo Lake), GOLDMONT_D (aka Denverton) and GOLDMONT_PLUS CPUs (aka Gemini Lake) set freq_max to the highest frequency reported by the CPU. The encoding of turbo ratios for GOLDMONT* is identical to the one for SKYLAKE_X, but we treat the Atom case apart because we want to set freq_max to a higher value, thus the ratio freq_curr/freq_max to be lower, leading to more conservative frequency selections (favoring power efficiency). Signed-off-by: Giovanni Gherdovich Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Rafael J. Wysocki Link: https://lkml.kernel.org/r/20200122151617.531-5-ggherdovich@suse.cz --- arch/x86/kernel/smpboot.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 8cb3113..3e32d62 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1795,6 +1795,10 @@ void native_play_dead(void) * which would ignore the entire turbo range (a conspicuous part, making * freq_curr/freq_max always maxed out). * + * An exception to the heuristic above is the Atom uarch, where we choose the + * highest turbo level for freq_max since Atom's are generally oriented towards + * power efficiency. + * * Setting freq_max to anything less than the 1C turbo ratio makes the ratio * freq_curr / freq_max to eventually grow >1, in which case we clip it to 1. */ @@ -1937,18 +1941,18 @@ static bool intel_set_max_freq_ratio(void) /* * TODO: add support for: * - * - Atom Goldmont * - Atom Silvermont */ u64 base_freq = 1, turbo_freq = 1; - if (x86_match_cpu(has_glm_turbo_ratio_limits)) - return false; - if (turbo_disabled()) goto out; + if (x86_match_cpu(has_glm_turbo_ratio_limits) && + skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1)) + goto out; + if (knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1)) goto out;