Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756591AbdCUGkw (ORCPT ); Tue, 21 Mar 2017 02:40:52 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:35241 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756360AbdCUGkt (ORCPT ); Tue, 21 Mar 2017 02:40:49 -0400 Date: Tue, 21 Mar 2017 12:10:44 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM , LKML , Peter Zijlstra , Srinivas Pandruvada , Juri Lelli , Vincent Guittot , Patrick Bellasi , Joel Fernandes , Morten Rasmussen , Ingo Molnar Subject: Re: [RFC][PATCH v2 2/2] cpufreq: schedutil: Avoid decreasing frequency of busy CPUs Message-ID: <20170321064044.GO25659@vireshk-i7> References: <4366682.tsferJN35u@aspire.rjw.lan> <2185243.flNrap3qq1@aspire.rjw.lan> <3300960.HE4b3sK4dn@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3300960.HE4b3sK4dn@aspire.rjw.lan> 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 Content-Length: 1087 Lines: 30 On 20-03-17, 22:46, Rafael J. Wysocki wrote: > Index: linux-pm/kernel/sched/cpufreq_schedutil.c > +static void sugov_update_commit(struct sugov_cpu *sg_cpu, > + struct sugov_policy *sg_policy, > + u64 time, unsigned int next_freq) > { > struct cpufreq_policy *policy = sg_policy->policy; > > + if (sugov_cpu_is_busy(sg_cpu) && next_freq < sg_policy->next_freq) > + next_freq = sg_policy->next_freq; > + In the earlier version you said that we want to be opportunistic and don't want to do heavy computation and so check only for current CPU. But in this version, all those computations are already done by now. Why shouldn't we check all CPUs in the policy now? I am asking as we will still have the same problem, we are trying to work-around if the current CPU isn't busy but others sharing the policy are. Also, why not return directly from within the if block? To run trace_cpu_frequency()? I don't remember exactly, but why don't we run that for !fast-switch case? We can simplify the code a bit if we check for no freq change at the top of the routine. -- viresh