Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1411520imp; Fri, 22 Feb 2019 03:02:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IahvjDmfnv44C8Vm7Op73E0Kjoz2fjhU7vPuQGfBXY6lfOXwQsLNriiYbiRqHob97v4ZC/J X-Received: by 2002:a65:6150:: with SMTP id o16mr3438222pgv.434.1550833323744; Fri, 22 Feb 2019 03:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550833323; cv=none; d=google.com; s=arc-20160816; b=V/6P/nKEfabjo6narNibpg7e9aA9rEHVBlGEEbYv22ynuoCMtLDQfNOkl+SyzLJ1b5 5ap99uE0siAKUarVMwr9AhLmZL+tzuwbfVc6tOv6i7XG8uMZF+6RKVbyc/jyx/9i8pVe IfS50dEEfJJamhF18yquklMOR7jZmJv0DcnWNiZMEEZZrSBRAjao6mjPXamEUQOcR6cs BFoM7ELTT21Gudy7u2H81VbuaXvNP0kIQQFzrwVpAH2Wb3t63BVfaXzqeUbWSzw1ly82 IYfmBYaiMFI0tugv3CepiIRddDqnz0F1LKO5MA0mSfVFobP1oXn1P+s+bWqg79QgXZM8 Lw+g== 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=g6gB50xtlcK0p5W9ZxEUggoI0gvlDVcZfpyHvfyzeag=; b=vRSbDBxdiLe+is27GeaLcrsRpcC7npfFKHc+MQ4RmhXs1EbzdpXcH2uDOpNEV1+Ngi cia1N/jyYJNhu+i7cSJ5jzlGY8rB1CvgtyR7iprms5e+0piC/VBALy3+3dut+Fi7u6mw HhHjc8t3dB/fSIJ4GRhSfSHqjZSKCryg+Hij0nOIlyADkvEqfHyQIu8wl5/zlEqMOQvm RjSDvchtmM3yngX7ZU4J8YUBtBTFhn9FyySrxAs/MbqpPkVHE8VpO+6otrpVOsIXoaUk LmG6VFMiGNEKV6iSXK1I+op2BJ7xiFC5BTzho4+2Z2IYwAJwmGfjoQ9RORuHnib+9iXm ngUg== 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 b17si1168559pfc.0.2019.02.22.03.01.47; Fri, 22 Feb 2019 03:02:03 -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 S1726940AbfBVLAG (ORCPT + 99 others); Fri, 22 Feb 2019 06:00:06 -0500 Received: from foss.arm.com ([217.140.101.70]:57738 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbfBVLAF (ORCPT ); Fri, 22 Feb 2019 06:00:05 -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 857DAA78; Fri, 22 Feb 2019 03:00:05 -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 519F63F5C1; Fri, 22 Feb 2019 03:00:04 -0800 (PST) Date: Fri, 22 Feb 2019 10:59:59 +0000 From: Quentin Perret To: Chunyan Zhang Cc: Ingo Molnar , Peter Zijlstra , Vincent Wang , linux-kernel@vger.kernel.org, Chunyan Zhang Subject: Re: [PATCH V4] sched/cpufreq: initialize iowait_boost_max and iowait_boost with cpu capacity Message-ID: <20190222105957.wxhlcmoag5f3i4fi@queper01-lin> References: <1550831866-32749-1-git-send-email-chunyan.zhang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550831866-32749-1-git-send-email-chunyan.zhang@unisoc.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 22 Feb 2019 at 18:37:46 (+0800), Chunyan Zhang wrote: > @@ -823,6 +823,8 @@ static int sugov_start(struct cpufreq_policy *policy) > { > struct sugov_policy *sg_policy = policy->governor_data; > unsigned int cpu; > + unsigned long max_cap = arch_scale_cpu_capacity(NULL, policy->cpu); > + unsigned long min_cap = max_cap * policy->min / policy->cpuinfo.max_freq; > > sg_policy->freq_update_delay_ns = sg_policy->tunables->rate_limit_us * NSEC_PER_USEC; > sg_policy->last_freq_update_time = 0; > @@ -837,7 +839,9 @@ static int sugov_start(struct cpufreq_policy *policy) > memset(sg_cpu, 0, sizeof(*sg_cpu)); > sg_cpu->cpu = cpu; > sg_cpu->sg_policy = sg_policy; > - sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; > + sg_cpu->max = max_cap; > + sg_cpu->min = min_cap; > + sg_cpu->iowait_boost_max = max_cap; Unfortunately, I don't think you can do that only here. The return value of arch_scale_cpu_capacity() can change at run time. And it does on arm64, see drivers/base/arch_topology.c. > } > > for_each_cpu(cpu, policy->cpus) { > -- > 2.17.1 > Thanks, Quentin