From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756352AbcBHRUi (ORCPT ); Mon, 8 Feb 2016 12:20:38 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:36841 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756045AbcBHRUc (ORCPT ); Mon, 8 Feb 2016 12:20:32 -0500 Date: Mon, 8 Feb 2016 22:50:28 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Rafael Wysocki , Juri Lelli , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Saravana Kannan , Peter Zijlstra , Michael Turquette , Steve Muckle , Vincent Guittot , Morten Rasmussen , dietmar.eggemann@arm.com, Shilpasri G Bhat , Linux Kernel Mailing List Subject: Re: [PATCH V3 12/13] cpufreq: ondemand: Traverse list of policy_dbs in update_sampling_rate() Message-ID: <20160208172028.GU8294@vireshk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08-02-16, 14:32, Rafael J. Wysocki wrote: > The comment still applies. > > Moreover, please extend it to say that this must be called with > dbs_data->mutex held (or it looks racy otherwise). Modified it as: + * + * Simply updating dbs_tuners_int.sampling_rate might not be appropriate here. + * For example, if the original sampling_rate was 1 second and the requested new + * sampling rate is 10 ms because the user needs immediate reaction from + * ondemand governor, otherwise the governor may change the sampling rate too + * late; up to 1 second later. + * + * Similar logic applies while increasing the sampling rate. And so we need to + * update it with immediate effect. + * + * This must be called with dbs_data->mutex held, otherwise traversing + * policy_dbs_list isn't safe. -- viresh