From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Subject: Re: [PATCH v6 1/8] cpufreq: Store cpufreq policies in a list Date: Fri, 26 Jul 2013 16:32:34 +0530 Message-ID: References: <1370502472-7249-1-git-send-email-l.majewski@samsung.com> <1374770011-22171-1-git-send-email-l.majewski@samsung.com> <1374770011-22171-2-git-send-email-l.majewski@samsung.com> <20130726125827.72f9ef18@amdc308.digital.local> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mail-ob0-f173.google.com ([209.85.214.173]:39360 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756861Ab3GZLCf (ORCPT ); Fri, 26 Jul 2013 07:02:35 -0400 Received: by mail-ob0-f173.google.com with SMTP id er7so4004739obc.32 for ; Fri, 26 Jul 2013 04:02:35 -0700 (PDT) In-Reply-To: <20130726125827.72f9ef18@amdc308.digital.local> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Lukasz Majewski Cc: "Rafael J. Wysocki" , Zhang Rui , Eduardo Valentin , "cpufreq@vger.kernel.org" , Linux PM list , Jonghwa Lee , Lukasz Majewski , linux-kernel , Bartlomiej Zolnierkiewicz , Daniel Lezcano , Kukjin Kim , durgadoss.r@intel.com On 26 July 2013 16:28, Lukasz Majewski wrote: > On Fri, 26 Jul 2013 15:44:29 +0530 Viresh Kumar viresh.kumar@linaro.org > wrote, >> On 25 July 2013 22:03, Lukasz Majewski wrote: >> Looks good but would have been better if you could have moved >> existing code to use this infrastructure.. >> >> For example, this code in __cpufreq_add_dev() >> >> #ifdef CONFIG_HOTPLUG_CPU >> /* Check if this cpu was hot-unplugged earlier and has >> siblings */ read_lock_irqsave(&cpufreq_driver_lock, flags); >> for_each_online_cpu(sibling) { >> >> --- >> >> } >> read_unlock_irqrestore(&cpufreq_driver_lock, flags); >> #endif > > Do you mean to write something like: > > #ifdef CONFIG_CPU_FREQ_BOOST_SW > write_lock_irqsave(&cpufreq_driver_lock, flags); > list_add(&policy->policy_list, &cpufreq_policy_list); > write_unlock_irqrestore(&cpufreq_driver_lock, flags); > #endif > > Or Am I missing something? I can't imaging how you though I am saying this :) The code I mentioned actually requires to iterate through the list of available policies but was iterating over all online cpus.. And so your new infrastructure or this list can be used instead of looping for all cpus.