From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933348AbcBCGvt (ORCPT ); Wed, 3 Feb 2016 01:51:49 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36001 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933263AbcBCGvr (ORCPT ); Wed, 3 Feb 2016 01:51:47 -0500 Date: Wed, 3 Feb 2016 12:21:43 +0530 From: Viresh Kumar To: Saravana Kannan Cc: "Rafael J. Wysocki" , Juri Lelli , Rafael Wysocki , Lists linaro-kernel , "linux-pm@vger.kernel.org" , 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: <20160203065143.GU31828@vireshk> References: <5a012e56b8404e2d07e172b6699ce02f5c5b5f26.1454410226.git.viresh.kumar@linaro.org> <20160202154717.GI3947@e106622-lin> <20160202170144.GL3947@e106622-lin> <56B12BEC.9070603@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B12BEC.9070603@codeaurora.org> 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, 14:21, Saravana Kannan wrote: > I also don't like this patch because it forces governors to either implement > their own macros and management of their attributes or force them to use the > governor structs that come with cpufreq_governor.h. cpufreq_governor.h IMHO > is very ondemand and conservative governor specific and is very irrelevant > for sched-dvfs or any other governors (hint hint). But who is stopping us from breaking that file and moving some of it into include/linux/cpufreq.h ? We can do that today as well, but it would be fine to do that, when we add more governors to the core. Though, it would only take a simple patch if people want me to do it now. > The only time this ABBA locking is an issue is when governor are changing > and trying to add/remove attributes. That can easily be checked in > store_governor store_scaling_governor ?? > and dealt with without holding the policy rwsem if the Are you saying that we could have taken the rwsem from the generic cpufreq.c:store() and dropped it from store_scaling_governor() ? That would have been something similar to what I tried earlier, which I never posted (I gave the link to that few days back). > governors can provide their per sys and per policy attribute arrays as part > of registering themselves. These per-sys and per-policy attributes really suck. There is nothing really different in the implementation, just that the show/store callbacks have different prototype. One accept 'kboj' as the parameter, other accept 'policy'. I would call that a HACK as well (I only implemented it though). That should just die. A single list of attributes is what we should have had initially as well. -- viresh