Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760244AbcCDVWP (ORCPT ); Fri, 4 Mar 2016 16:22:15 -0500 Received: from mail-qk0-f174.google.com ([209.85.220.174]:36065 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759044AbcCDVWK (ORCPT ); Fri, 4 Mar 2016 16:22:10 -0500 Subject: Re: [PATCH v3 9/10] cpufreq: sched: Re-introduce cpufreq_update_util() To: "Rafael J. Wysocki" , Linux PM list References: <2495375.dFbdlAZmA6@vostro.rjw.lan> <2409306.qzzMXcm4dm@vostro.rjw.lan> <3276406.TfbasUEj6b@vostro.rjw.lan> <2165535.KMoOuEkF5Y@vostro.rjw.lan> Cc: Juri Lelli , ACPI Devel Maling List , Linux Kernel Mailing List , Peter Zijlstra , Srinivas Pandruvada , Viresh Kumar , Vincent Guittot , Michael Turquette , Ingo Molnar From: Steve Muckle Message-ID: <56D9FC66.9050201@linaro.org> Date: Fri, 4 Mar 2016 13:21:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <2165535.KMoOuEkF5Y@vostro.rjw.lan> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 654 Lines: 22 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?