Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760258AbcCDV1v (ORCPT ); Fri, 4 Mar 2016 16:27:51 -0500 Received: from mail-lb0-f194.google.com ([209.85.217.194]:33916 "EHLO mail-lb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757489AbcCDV1t (ORCPT ); Fri, 4 Mar 2016 16:27:49 -0500 MIME-Version: 1.0 In-Reply-To: <56D9FC66.9050201@linaro.org> 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:27:46 +0100 X-Google-Sender-Auth: -zp1zfDJoQ6AI6h1wC7kaRhGaPY 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: 1092 Lines: 34 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. Thanks, Rafael