From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751945AbdATKyg (ORCPT ); Fri, 20 Jan 2017 05:54:36 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34854 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbdATKyf (ORCPT ); Fri, 20 Jan 2017 05:54:35 -0500 Date: Fri, 20 Jan 2017 11:54:28 +0100 From: Daniel Lezcano To: "Rafael J. Wysocki" Cc: Alex Shi , Greg Kroah-Hartman , "Rafael J . Wysocki" , Vincent Guittot , Linux PM , Linux Kernel Mailing List , Ulf Hansson , Rasmus Villemoes , Arjan van de Ven , Rik van Riel Subject: Re: [PATCH 3/3] cpuidle/menu: add per cpu pm_qos_resume_latency consideration Message-ID: <20170120105428.GA1804@mai> References: <1484227624-6740-1-git-send-email-alex.shi@linaro.org> <1484227624-6740-4-git-send-email-alex.shi@linaro.org> <20170117093837.GA2085@mai> <01f9b016-0b7c-44ac-70e5-8cd9b8bd1500@linaro.org> <20170119102158.GA1827@mai> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 19, 2017 at 10:43:23PM +0100, Rafael J. Wysocki wrote: [ ... ] > > This function is called from the notifier callback: > > > > static int cpuidle_latency_notify(struct notifier_block *b, > > unsigned long l, void *v) > > { > > - wake_up_all_idle_cpus(); > > + struct cpuidle_device *dev; > > + struct cpuidle_driver *drv; > > + > > + cpuidle_pause_and_lock(); > > + for_each_possible_cpu(cpu) { > > + dev = &per_cpu(cpuidle_dev, cpu); > > + drv = = cpuidle_get_cpu_driver(dev); > > + cpuidle_set_latency(drv, dev, l) > > + } > > + cpuidle_resume_and_unlock(); > > + > > return NOTIFY_OK; > > } > > The above may be problematic if the constraints change relatively > often. It is global and it will affect all of the CPUs in the system > every time and now think about systems with hundreds of them. Yeah, that could be problematic. The code snippet gives the general idea but it could be changed by for example by a flag telling the cpus when they enter idle to update their state_count. Or something like that. But if you think the patchset is fine, it is ok, we can improve things afterwards. -- Daniel -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog