From: Daniel Lezcano Subject: Re: [PATCH V9] powercap/drivers/idle_injection: Add an idle injection framework Date: Tue, 26 Jun 2018 00:15:01 +0200 Message-ID: References: <1529414627-5638-1-git-send-email-daniel.lezcano@linaro.org> <98f43bb6-9ab5-2f79-05f2-be68a0f7f88e@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Viresh Kumar , Linux Kernel Mailing List , Eduardo Valentin , Javi Merino , Leo Yan , Kevin Wangtao , Vincent Guittot , Rui Zhang , Daniel Thompson , Peter Zijlstra , Andrea Parri , "open list:POWER MANAGEMENT CORE" List-Id: linux-pm@vger.kernel.org On 25/06/2018 23:55, Rafael J. Wysocki wrote: > On Mon, Jun 25, 2018 at 1:52 PM, Daniel Lezcano > wrote: >> On 25/06/2018 10:23, Rafael J. Wysocki wrote: >> >> [ ... ] >> >>>> + * It is up to the user of this framework to provide a lock at an >>>> + * upper level to prevent stupid things to happen, like starting while >>>> + * we are unregistering. >>>> + */ >>> >>> The English above and elsewhere needs some polishing IMO, but I can >>> take care of that. :-) >> >> I can give a try and if you are still unhappy, you change them in a >> better way. > > Well, I could tell you what I would write, but then it'll take less > time and effort if I just write it myself. :-) Ok. >> [ ... ] >> >>>> +static void idle_injection_setup(unsigned int cpu) >>>> +{ >>>> + struct sched_param param = { .sched_priority = MAX_USER_RT_PRIO / 2 }; >>>> + >>>> + set_freezable(); >>> >>> Why do you need set_freezable() here? >> >> We don't want to continue injecting idle cycles when the system is >> suspended. > > And where's the corresponding try_to_freeze() called? Yes, it is missing. I suppose try_to_freeze() should be put at the beginning of the idle_inject_fn() function, right ? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog