Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754629AbdC1JaF (ORCPT ); Tue, 28 Mar 2017 05:30:05 -0400 Received: from mail-ot0-f171.google.com ([74.125.82.171]:33877 "EHLO mail-ot0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754108AbdC1JaD (ORCPT ); Tue, 28 Mar 2017 05:30:03 -0400 MIME-Version: 1.0 In-Reply-To: <20170327165011.dpip23cyolnleas6@hirez.programming.kicks-ass.net> References: <20170324140900.7334-1-juri.lelli@arm.com> <20170324140900.7334-4-juri.lelli@arm.com> <20170327165011.dpip23cyolnleas6@hirez.programming.kicks-ass.net> From: Vincent Guittot Date: Tue, 28 Mar 2017 11:29:31 +0200 Message-ID: Subject: Re: [RFD PATCH 3/5] sched/cpufreq_schedutil: make worker kthread be SCHED_DEADLINE To: Peter Zijlstra Cc: Juri Lelli , "mingo@redhat.com" , "rjw@rjwysocki.net" , viresh kumar , linux-kernel , "linux-pm@vger.kernel.org" , Thomas Gleixner , Steven Rostedt , luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, Mathieu Poirier , Todd Kjos , Joel Fernandes , Andres Oportus , Morten Rasmussen , Dietmar Eggemann , Patrick Bellasi , Ingo Molnar , "Rafael J . Wysocki" , Mark Brown Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1438 Lines: 46 On 27 March 2017 at 18:50, Peter Zijlstra wrote: > On Fri, Mar 24, 2017 at 02:08:58PM +0000, Juri Lelli wrote: >> Worker kthread needs to be able to change frequency for all other >> threads. >> >> Make it special, just under STOP class. > > *yuck* ;-) > > So imagine our I2C/SPI bus is 'busy' and its mutex taken, then this > 'soecial' task will need to boost it. Now add BWI to your thinking and > shudder. > > > On IRC broonie mentioned that: > > - most PMIC operations are fire and forget (no need to wait for a > response). > - PMIC 'packets' are 'small'. > - SPI has the possibility to push stuff on the queue. > > Taken together this seems to suggest we can rework cpufreq drivers to > function in-context, either directly push the packet on the bus if > available, or queue it and let whoever owns it sort it without blocking. > > It might be possible to rework/augment I2C to also support pushing stuff > on a queue. But sending new voltage value to PMIC is only part of the sequence. When cpufreq set a new opp, it does -set new voltage -wait for the voltage to settle down. -set the new clock frequency you can even have to switch to an intermediate clock source. When such sequence is managed by the kernel, we can't easily git ride of a kthread > > > So if we can make all that work, we can do away with this horrible > horrible kthread. Which is, IMO, a much better solution. > > Thoughts?