Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2488996ybe; Sat, 14 Sep 2019 16:26:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmAa7tBRn8NnrhxSOqDkIa4L5FUQnpgSP19GHS3VUtrt0rqrO41/UwBMvkafhy0DK98eev X-Received: by 2002:a05:6402:b29:: with SMTP id bo9mr12736737edb.10.1568503616983; Sat, 14 Sep 2019 16:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568503616; cv=none; d=google.com; s=arc-20160816; b=utvsbwl5YHpPDTp28935QL+kaBbUS1adHFAmipoK2E0TqGtbrmbemFDU5FN39l+1yi /hFm3UX/8CPIfuObO2PPx9tAE/v8Zn5GJwRg+qr83fbVsarempc0TCXA696isn50z2w8 9T1mGAk/eh0Rs28LcFoCkLvHnn+m1/Xq6wxOlJ3b35w6qMThvka5TPOEYTTEQsVV0cqn MkLl5xrIxUJfP8gD7K11yazPp1VtkJFesuhT677cqUlc1wE8v6UQfQXLQVQXaVTd5M4e NJRmaoSSrbYfG/u4FSgLc/rvD9c2AlD0P9Pe7zgK1hJyh4Ry2JHBWNMeSk1SHyu91ife xOYA== 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=5aR+F9LYQtC1f54xHLnbB/n90F6jSNNuEGWceQ9LJJA=; b=UyHliX4Cz38OYo9iJEctaOINtACQRtygiMT8UYyVnaE4Nizawf3FkH6DNCh7I3TRYz HC7Z2fyo9pVmC6SxpKFlfgasLw7fkVNJ4l7hwvGLZcpPz4ipnKpTFcTfxlM+lRjHkbuL edRCEB8sTcIDe+ZMa6Qy/cq7lXP+sCbWN9UDMmZ3EHwJXGqqpjdJ2YGEWPkCL8HUlWXO 2W6p0aWELfr6pTLp6NjkEPBuUJRvi7XY9BEEOuS8Ept/DyIditkhq0s+J1yDFi21H7Vb GAhrw67IcFoTantoIGDVKLBXqRjcgNCM6/QeSrzkn8fI3G8M4kQai+/8780+RE8LHAsO ErtA== 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 f57si20214973ede.78.2019.09.14.16.25.58; Sat, 14 Sep 2019 16:26:56 -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; 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 S1727855AbfINQzS (ORCPT + 99 others); Sat, 14 Sep 2019 12:55:18 -0400 Received: from 8.mo4.mail-out.ovh.net ([188.165.33.112]:36566 "EHLO 8.mo4.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727737AbfINQzS (ORCPT ); Sat, 14 Sep 2019 12:55:18 -0400 X-Greylist: delayed 21461 seconds by postgrey-1.27 at vger.kernel.org; Sat, 14 Sep 2019 12:55:17 EDT Received: from player762.ha.ovh.net (unknown [10.109.159.222]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id 948C5205ECF for ; Sat, 14 Sep 2019 12:57:34 +0200 (CEST) Received: from qperret.net (115.ip-51-255-42.eu [51.255.42.115]) (Authenticated sender: qperret@qperret.net) by player762.ha.ovh.net (Postfix) with ESMTPSA id 8F3539D07C50; Sat, 14 Sep 2019 10:57:14 +0000 (UTC) Date: Sat, 14 Sep 2019 12:57:08 +0200 From: Quentin Perret To: Giovanni Gherdovich Cc: srinivas.pandruvada@linux.intel.com, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, bp@suse.de, lenb@kernel.org, rjw@rjwysocki.net, x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, mgorman@techsingularity.net, matt@codeblueprint.co.uk, viresh.kumar@linaro.org, juri.lelli@redhat.com, pjt@google.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com Subject: Re: [PATCH 1/2] x86,sched: Add support for frequency invariance Message-ID: <20190914105708.GA12877@qperret.net> References: <20190909024216.5942-1-ggherdovich@suse.cz> <20190909024216.5942-2-ggherdovich@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190909024216.5942-2-ggherdovich@suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) X-Ovh-Tracer-Id: 14383934262635617173 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrtdelgdefhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Giovanni On Monday 09 Sep 2019 at 04:42:15 (+0200), Giovanni Gherdovich wrote: > +static inline long arch_scale_freq_capacity(int cpu) > +{ > + if (static_cpu_has(X86_FEATURE_APERFMPERF)) > + return per_cpu(arch_cpu_freq, cpu); So, if this is conditional, perhaps you could also add this check in an x86-specific implementation of arch_scale_freq_invariant() ? That would guide sugov in the right path (see get_next_freq()) if APERF/MPERF are unavailable. > + return 1024 /* SCHED_CAPACITY_SCALE */; > +} Thanks, Quentin