Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932381AbcCOVk7 (ORCPT ); Tue, 15 Mar 2016 17:40:59 -0400 Received: from [198.137.202.9] ([198.137.202.9]:44676 "EHLO bombadil.infradead.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752722AbcCOVkz (ORCPT ); Tue, 15 Mar 2016 17:40:55 -0400 Date: Tue, 15 Mar 2016 22:37:44 +0100 From: Peter Zijlstra To: Michael Turquette Cc: rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Juri.Lelli@arm.com, steve.muckle@linaro.org, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, Michael Turquette Subject: Re: [PATCH 8/8] sched: prefer cpufreq_scale_freq_capacity Message-ID: <20160315213744.GJ6344@twins.programming.kicks-ass.net> References: <1457932932-28444-1-git-send-email-mturquette+renesas@baylibre.com> <1457932932-28444-9-git-send-email-mturquette+renesas@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457932932-28444-9-git-send-email-mturquette+renesas@baylibre.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 35 On Sun, Mar 13, 2016 at 10:22:12PM -0700, Michael Turquette wrote: > +++ b/kernel/sched/sched.h > @@ -1368,7 +1368,21 @@ static inline int hrtick_enabled(struct rq *rq) > #ifdef CONFIG_SMP > extern void sched_avg_update(struct rq *rq); > > -#ifndef arch_scale_freq_capacity > +#ifdef CONFIG_CPU_FREQ > +#define arch_scale_freq_capacity cpufreq_scale_freq_capacity > +#elif !defined(arch_scale_freq_capacity) > static __always_inline > unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu) > { This could not allow x86 to use the APERF/MPERF thing, so no, can't be right. Maybe something like #ifndef arch_scale_freq_capacity #ifdef CONFIG_CPU_FREQ #define arch_scale_freq_capacity cpufreq_scale_freq_capacity #else static __always_inline unsigned long arch_scale_freq_capacity(..) { return SCHED_CAPACITY_SCALE; } #endif #endif Which will let the arch override and only falls back to cpufreq if the arch doesn't do anything.