From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934707AbcALJeB (ORCPT ); Tue, 12 Jan 2016 04:34:01 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:36057 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934673AbcALJ14 (ORCPT ); Tue, 12 Jan 2016 04:27:56 -0500 Date: Tue, 12 Jan 2016 14:57:52 +0530 From: Viresh Kumar To: Peter Zijlstra Cc: Juri Lelli , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rjw@rjwysocki.net, mturquette@baylibre.com, steve.muckle@linaro.org, vincent.guittot@linaro.org, morten.rasmussen@arm.com, dietmar.eggemann@arm.com Subject: Re: [RFC PATCH 04/19] cpufreq: bring data structures close to their locks Message-ID: <20160112092752.GV1084@ubuntu> References: <1452533760-13787-1-git-send-email-juri.lelli@arm.com> <1452533760-13787-5-git-send-email-juri.lelli@arm.com> <20160111220708.GK6344@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160111220708.GK6344@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11-01-16, 23:07, Peter Zijlstra wrote: > On Mon, Jan 11, 2016 at 05:35:45PM +0000, Juri Lelli wrote: > > +/** > > + * Iterate over governors > > + * > > + * cpufreq_governor_list is protected by cpufreq_governor_mutex. > > + */ > > +static LIST_HEAD(cpufreq_governor_list); > > +static DEFINE_MUTEX(cpufreq_governor_mutex); > > +#define for_each_governor(__governor) \ > > + list_for_each_entry(__governor, &cpufreq_governor_list, governor_list) > > So you could stuff the lockdep_assert_held() you later add intididually > into the for_each_governor macro, impossible to forget that way. How exactly? I couldn't see how it can be done in a neat and clean way. -- viresh