Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2629305imb; Mon, 4 Mar 2019 09:52:28 -0800 (PST) X-Google-Smtp-Source: APXvYqy34O8lqnAiJlbU1dfjATzojJf0XYFL+JBO70A9wzZ3Aos+PA+1B28LRjv+sSDkVIBIezCO X-Received: by 2002:a63:2b03:: with SMTP id r3mr18857627pgr.1.1551721948144; Mon, 04 Mar 2019 09:52:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551721948; cv=none; d=google.com; s=arc-20160816; b=xO9hUu6NfTn4Vq0NThggcvDssDxN0EnvZ5WDnw5gZ1SD5rWbQVPRHBvz7WqHTrqloJ nDudkcIBWCHIc4ym0hMczQqyK+Lcq3H2npSfA/wU0TqsKqEIPfe7WUDAAAoHUnnFPKgd wqQFqly3X7qcpI3QWXwyZ9N1+Gv/V7bwcK1L8XqYikzJOsUhXlPlq2uu6fxitx++VzH2 znsdIsCrszF3ZlBaU+AGpP+woTTBFidTmQ3qsrYe1kx7AwY/rDBObaFA2mpPEFBi9Wnx 7IUelYsLqtQ5UEcTRuQqDMTOeD9WleHXbAvJhh+oPtK/n5F53k/MwSRbTqZkghkOqzn9 eXlg== 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; bh=ScrZxa6wWK7jxkUhcYysL9f6+ZYVYPZTP9qykP9IFy0=; b=t0s8TuP3l9qdURKTfFVG0GfiIaXFbkoZru5qf3e/evNbVf5TK/uWKigS4i1VD3bC9d MejUibnf91UU1enOUmLiOzQbpmx3YrGcjdnw/2NdFiOr99SATWMy7T9+4OrV3MaZhSWd tuyUlD39s4FnojdQ9/vzFPUumt9pvzMxQDxP+eL12WvFYzKd5RLRvwdXfeUuH6L1oPuD WGMieR/+3qTjk6x4OKqemONWSf/Vo7tUF3+kywIM3tQsSmnaGjoc8n0K7905O3eRfwex o9u8fjSQPs8+2gzTojDzFiuweEp49HWoe02gDuhSaIL8wHgddt9FDQF/jtZ2/Qjiiq7c /mgg== 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 y126si1493074pgy.97.2019.03.04.09.52.12; Mon, 04 Mar 2019 09:52:28 -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 S1727491AbfCDRuj (ORCPT + 99 others); Mon, 4 Mar 2019 12:50:39 -0500 Received: from foss.arm.com ([217.140.101.70]:36794 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbfCDRuj (ORCPT ); Mon, 4 Mar 2019 12:50:39 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9DB37A78; Mon, 4 Mar 2019 09:50:38 -0800 (PST) Received: from queper01-lin (queper01-lin.cambridge.arm.com [10.1.195.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 45CD43F703; Mon, 4 Mar 2019 09:50:37 -0800 (PST) Date: Mon, 4 Mar 2019 17:50:32 +0000 From: Quentin Perret To: Peter Zijlstra Cc: =?utf-8?B?V2FuZywgVmluY2VudCAo546L5LqJKQ==?= , =?utf-8?B?WmhhbmcsIENodW55YW4gKOW8oOaYpeiJsyk=?= , Ingo Molnar , "linux-kernel@vger.kernel.org" , Chunyan Zhang , "Rafael J. Wysocki" Subject: Re: =?utf-8?B?562U5aSNOiBbUEFUQ0ggVjRdIHNj?= =?utf-8?Q?hed=2Fcpufreq=3A_initializ?= =?utf-8?Q?e?= iowait_boost_max and iowait_boost with cpu capacity Message-ID: <20190304175030.4slf247y2eftkmu4@queper01-lin> References: <1550831866-32749-1-git-send-email-chunyan.zhang@unisoc.com> <20190222105957.wxhlcmoag5f3i4fi@queper01-lin> <9099990618e242e1bab77ce3f9d9b1e3@BJMBX02.spreadtrum.com> <20190304135810.rq2ojnbn5vezrab3@queper01-lin> <20190304152616.GM32494@hirez.programming.kicks-ass.net> <20190304164816.4fnxxesjwzdoqria@queper01-lin> <20190304174028.GO32494@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190304174028.GO32494@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 04 Mar 2019 at 18:40:28 (+0100), Peter Zijlstra wrote: > > Perhaps you could keep the 'util' and 'max' pointers in > > sugov_iowait_apply() and overwrite them like before, but in the > > SCHED_CAPACITY_SCALE scale as you suggest ? > > Urgh; but then we're back to having that boostrap problem. Hmm, I don't understand :/ > Now; at this time; @max is in fact scale_cpu_capacity, so can't we > change this: > > - /* > - * Apply the current boost value: a CPU is boosted only if its current > - * utilization is smaller then the current IO boost level. > - */ > - boost_util = sg_cpu->iowait_boost; > - boost_max = sg_cpu->iowait_boost_max; I was basically suggesting to do 'boost_max = 1024;' here and you should be good with you way of computing 'min' no ? > - if (*util * boost_max < *max * boost_util) { > - *util = boost_util; > - *max = boost_max; > - } > + sg_cpu->iowait_boost_pending = false; > + > + return min(max(util, sg_cpu->iowait_boost), max); > } > > to something like: > > /* > * @util is already in capacity scale, convert iowait_boost > * into the same scale so we can compare. > */ > boost = (sg_cpu->iowait_boost * max) >> SCHED_CAPACITY_SHIFT; > util = max(boost, util); > return min(util, max); > But this should work too, I think. Thanks, Quentin