From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756332AbcBCGdr (ORCPT ); Wed, 3 Feb 2016 01:33:47 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33586 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755951AbcBCGdp (ORCPT ); Wed, 3 Feb 2016 01:33:45 -0500 Date: Wed, 3 Feb 2016 12:03:42 +0530 From: Viresh Kumar To: Juri Lelli Cc: "Rafael J. Wysocki" , Rafael Wysocki , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Saravana Kannan , Peter Zijlstra , Michael Turquette , Steve Muckle , Vincent Guittot , Morten Rasmussen , dietmar.eggemann@arm.com, Linux Kernel Mailing List Subject: Re: [PATCH 2/5] cpufreq: governor: Create separate sysfs-ops Message-ID: <20160203063342.GT31828@vireshk> References: <5a012e56b8404e2d07e172b6699ce02f5c5b5f26.1454410226.git.viresh.kumar@linaro.org> <20160202154717.GI3947@e106622-lin> <20160202170144.GL3947@e106622-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202170144.GL3947@e106622-lin> 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 02-02-16, 17:01, Juri Lelli wrote: > Hi Rafael, > > On 02/02/16 17:35, Rafael J. Wysocki wrote: > > On Tue, Feb 2, 2016 at 4:47 PM, Juri Lelli wrote: > > > This patch cleans things up a lot, that's good. > > > > > > One thing I'm still concerned about, though: don't we need some locking > > > in place for some of the store operations on governors attributes? Are > > > store_{ignore_nice_load, sampling_down_fact, etc} safe without locking? > > > > That would require some investigation I suppose. Yeah, that protection is required. Sorry about that. > > > It seems that we can call them from different cpus concurrently. > > > > Yes, we can. > > > > One quick-and-dirty way of dealing with that might be to introduce a > > "sysfs lock" into struct dbs_data and hold that around the invocation > > of gattr->store() in the sysfs_ops's ->store callback. s/dirty/sane ? :) > Can't we actually try to use the policy->rwsem (or one of the core > locks) + wait_for_completion approach as we do in cpufreq core? policy->rwsem will defeat the purpose of this change as it will reintroduce the ABBA issue. -- viresh