Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1657187imm; Wed, 16 May 2018 00:48:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoC47sm/JFm82Lf/1Glbzhu/SYZqK7ME1lILCyMzX1WFqFKW2PvuW+utqmfMfJhyiucSqOc X-Received: by 2002:aa7:864d:: with SMTP id a13-v6mr15812627pfo.199.1526456904658; Wed, 16 May 2018 00:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526456904; cv=none; d=google.com; s=arc-20160816; b=oc3Wt/IVhGMd8yfUZiuNj7td/OxuZEvZbRZAtZulWnncMFwbxryio/cOU9B8UYYIhz REuwiPCvd6l6+qMZz+bb0igLS4u7kt5nT7XTX81HzRcTDdOV8XbruFJRSin7FF0jCe/+ 41NKB8iZUZmZcnezulLG0Ynqt9tweOk+bPpvCymNhAKekN4oDd40epSUqqPB7yrHZG+o MEHRf819EeUXbALoiDa0n7lxuJY4HyZIAg/0D9H0CLzqdRfdgPe+/DXjLEI/KoqnQPre maPyqxlkjSMx4n16RUnDryqgk3ifpX6z1kTLfFP9kBcEtB7i1vVhI3YpR6K8tq07DQdo 0L9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=EhdKAO8/UkSq34h8mlkEObbmwGTWjS1oK9Izr6KZeCY=; b=IYbUnd6f0cJ06rEZBbUGcM/JJZa1pnLcc8h6DDegAtCXu6SK+762iXmo78LWQTjVHv j/+8/5ELU8RHjsfwV9HlxrNmV2zQwVBpzkfBg7EYp9RFbxpnG40u0gr4ZHDUvlVhF+KJ /7odKh8xMNd/KrFma2jEdJIpaI8dw1IRsXDHki6dzL+/ZDRJqPZ4x7QNCWXbV5rcd+nA OpAMogFG77LDL06Rj/BiAPbW0pEczCxD9zAp0V6rO9nNpmU9ww9Nvmw8FmHeKDSJi6BD fZx5Kf1B+xGH8zIoRf98T8GP6bqYe3L3hkzy71A77xiG6ayGof03LTbbGznQDm/SW2K1 D1/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tWgelLSo; 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 n3-v6si1628327pgr.342.2018.05.16.00.48.10; Wed, 16 May 2018 00:48:24 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tWgelLSo; 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 S1752547AbeEPHrr (ORCPT + 99 others); Wed, 16 May 2018 03:47:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46128 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbeEPHro (ORCPT ); Wed, 16 May 2018 03:47:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EhdKAO8/UkSq34h8mlkEObbmwGTWjS1oK9Izr6KZeCY=; b=tWgelLSoR9Z8FCcE5pkXzMbkD yfqvIxMu6PF2UV7pUY8atDhpbFsNUbO21eAEDeFjPlDbKaPeqey3cNuyNa4k0KxAuAGMuDXMNk/jp /8KzCcvFaHB/ZsHs6DjVbAo6SNrg9BvOhpaupJJSirfryixett2+DOAs+rrXhS6ngHJI5lmndINjE pr8OR+VxBHx0IcMW+xW+5jjtnNxo57xBOF2dfc+doFyj8u7xxEZsg120M3Tn5KeGNxuUpsgIYjlCy qqxiueGszD7Fdj463vJbgev8xtYv3jmz7W3AiS6c/75ff+8z+LT7CWr7hVL9LEDO9xvr3ZCLPNXQ/ MBTm4ts1w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIr9s-00082S-5i; Wed, 16 May 2018 07:47:36 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 850122029F1C1; Wed, 16 May 2018 09:47:34 +0200 (CEST) Date: Wed, 16 May 2018 09:47:34 +0200 From: Peter Zijlstra To: Srinivas Pandruvada Cc: tglx@linutronix.de, mingo@redhat.com, bp@suse.de, lenb@kernel.org, rjw@rjwysocki.net, mgorman@techsingularity.net, x86@kernel.org, linux-pm@vger.kernel.org, viresh.kumar@linaro.org, juri.lelli@arm.com, linux-kernel@vger.kernel.org Subject: Re: [RFC/RFT] [PATCH 08/10] cpufreq: intel_pstate: Dyanmically update busy pct Message-ID: <20180516074734.GY12217@hirez.programming.kicks-ass.net> References: <20180516044911.28797-1-srinivas.pandruvada@linux.intel.com> <20180516044911.28797-9-srinivas.pandruvada@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180516044911.28797-9-srinivas.pandruvada@linux.intel.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 15, 2018 at 09:49:09PM -0700, Srinivas Pandruvada wrote: > +static inline void intel_pstate_update_busy_threshold(struct cpudata *cpu) > +{ > + if (!hwp_boost_threshold_busy_pct) { > + int min_freq, max_freq; > + > + min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling; > + update_turbo_state(); > + max_freq = global.turbo_disabled || global.no_turbo ? > + cpu->pstate.max_freq : cpu->pstate.turbo_freq; > + > + /* > + * We are guranteed to get atleast min P-state. If we assume > + * P-state is proportional to load (such that 10% load > + * increase will result in 10% P-state increase), we will > + * get at least min P-state till we have atleast > + * (min * 100/max) percent cpu load. turbo makes that story less clear ofcourse. So any load less than > + * than this this we shouldn't do any boost. Then boosting > + * is not free, we will add atleast 20% offset. This I don't get.. so you want to remain at min P longer? > + */ > + hwp_boost_threshold_busy_pct = min_freq * 100 / max_freq; > + hwp_boost_threshold_busy_pct += 20; > + pr_debug("hwp_boost_threshold_busy_pct = %d\n", > + hwp_boost_threshold_busy_pct); > + } > +} And then this part should go in the previous patch.