Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751210AbdGZINJ (ORCPT ); Wed, 26 Jul 2017 04:13:09 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:50411 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbdGZINI (ORCPT ); Wed, 26 Jul 2017 04:13:08 -0400 Date: Wed, 26 Jul 2017 10:12:59 +0200 From: Peter Zijlstra To: Viresh Kumar Cc: Rafael Wysocki , Srinivas Pandruvada , Len Brown , Ingo Molnar , linux-pm@vger.kernel.org, Vincent Guittot , smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 1/3] sched: cpufreq: Allow remote cpufreq callbacks Message-ID: <20170726081259.fzymne5arv4vsje3@hirez.programming.kicks-ass.net> References: <0f950529a63fb95e87944644c4854be4fcfaea38.1499927699.git.viresh.kumar@linaro.org> <20170721130349.mv7soic62jdnirq5@hirez.programming.kicks-ass.net> <20170724110122.GX352@vireshk-i7> <20170724134752.sejehwa5mjqqc2mq@hirez.programming.kicks-ass.net> <20170726062912.GA352@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170726062912.GA352@vireshk-i7> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1574 Lines: 41 On Wed, Jul 26, 2017 at 11:59:12AM +0530, Viresh Kumar wrote: > On 24-07-17, 15:47, Peter Zijlstra wrote: > > I said nothing about the shared locking. That is indeed required. All I > > said is that those two tests you add could be left out. > > I was right, I didn't understood your comment at all :( > > > > > That would then continue to process the iowait and other accounting > > > > stuff, but stall the moment we call into the actual driver, which will > > > > then drop the request on the floor as per the first few hunks. > > > > > > I am not sure I understood your comment completely though. > > > > Since we call cpufreq_update_util(@rq, ...) with @rq->lock held, all > > such calls are in fact serialized for that cpu. > > Yes, they are serialized but .. > > > Therefore the cpu != > > current_cpu test you add are pointless. > > .. I didn't understand why you said so. This check isn't there to take > care of serialization but remote callbacks. > > > Only once we get to the actual cpufreq driver (intel_pstate and others) > > do we run into the fact that we might not be able to service the request > > remotely. > > We never check for remote callbacks in drivers. > > > But since you also add a test there, that is sufficient. > > No. > > The diff for intel-pstate that you saw in this patch was for the case > where intel-pstate works directly with the scheduler (i.e. no > schedutil governor). The routine that gets called with schedutil is > intel_cpufreq_target(), which doesn't check for remoteness at all. Argh, what a horrible mess.. :-(