Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760291AbcCDVgQ (ORCPT ); Fri, 4 Mar 2016 16:36:16 -0500 Received: from mail-lb0-f196.google.com ([209.85.217.196]:36386 "EHLO mail-lb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758765AbcCDVgM (ORCPT ); Fri, 4 Mar 2016 16:36:12 -0500 MIME-Version: 1.0 In-Reply-To: References: <2495375.dFbdlAZmA6@vostro.rjw.lan> <2409306.qzzMXcm4dm@vostro.rjw.lan> <3276406.TfbasUEj6b@vostro.rjw.lan> <2165535.KMoOuEkF5Y@vostro.rjw.lan> <56D9FC66.9050201@linaro.org> Date: Fri, 4 Mar 2016 22:36:10 +0100 X-Google-Sender-Auth: 6K72R7J0d_25ooBd_4jLMvIRYOU Message-ID: Subject: Re: [PATCH v3 9/10] cpufreq: sched: Re-introduce cpufreq_update_util() From: "Rafael J. Wysocki" To: Steve Muckle Cc: "Rafael J. Wysocki" , Linux PM list , Juri Lelli , ACPI Devel Maling List , Linux Kernel Mailing List , Peter Zijlstra , Srinivas Pandruvada , Viresh Kumar , Vincent Guittot , Michael Turquette , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 40 On Fri, Mar 4, 2016 at 10:27 PM, Rafael J. Wysocki wrote: > On Fri, Mar 4, 2016 at 10:21 PM, Steve Muckle wrote: >> On 03/04/2016 05:30 AM, Rafael J. Wysocki wrote: >>> +void cpufreq_update_util(u64 time, unsigned long util, unsigned long max) >>> +{ >>> + struct freq_update_hook *hook; >>> + >>> +#ifdef CONFIG_LOCKDEP >>> + WARN_ON(debug_locks && !rcu_read_lock_sched_held()); >>> +#endif >>> + >>> + hook = rcu_dereference_sched(*this_cpu_ptr(&cpufreq_freq_update_hook)); >>> + /* >>> + * If this isn't inside of an RCU-sched read-side critical section, hook >>> + * may become NULL after the check below. >>> + */ >>> + if (hook) { >>> + if (hook->update_util) >>> + hook->update_util(hook, time, util, max); >>> + else >>> + hook->func(hook, time); >>> + } >> >> Is it worth having two hook types? > > Well, that's why I said "maybe over the top" in the changelog comments. :-) > > If we want to isolate the "old" governors from util/max entirely, then yes. > > If we don't care that much, then no. > > I'm open to both possibilities. But in the latter case I don't see a particular reason to put the new governor under kernel/sched/ too and as I wrote in the changelog comments to patch [10/10], I personally think that it would be cleaner to keep it under drivers/cpufreq/. Thanks, Rafael