From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753235AbbDBRcw (ORCPT ); Thu, 2 Apr 2015 13:32:52 -0400 Received: from casper.infradead.org ([85.118.1.10]:38233 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbbDBRcu (ORCPT ); Thu, 2 Apr 2015 13:32:50 -0400 Date: Thu, 2 Apr 2015 19:32:38 +0200 From: Peter Zijlstra To: Morten Rasmussen Cc: Vincent Guittot , Ingo Molnar , linux-kernel , Preeti U Murthy , Kamalesh Babulal , Rik van Riel , Mike Galbraith , "nicolas.pitre@linaro.org" , Dietmar Eggemann , Linaro Kernel Mailman List , Paul Turner , Ben Segall Subject: Re: [PATCH v10 04/11] sched: Make sched entity usage tracking scale-invariant Message-ID: <20150402173238.GF23123@twins.programming.kicks-ass.net> References: <1425052454-25797-1-git-send-email-vincent.guittot@linaro.org> <1425052454-25797-5-git-send-email-vincent.guittot@linaro.org> <20150323131905.GF23123@twins.programming.kicks-ass.net> <20150325173309.GS21418@twins.programming.kicks-ass.net> <20150402165309.GA18994@e105550-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150402165309.GA18994@e105550-lin.cambridge.arm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2015 at 05:53:09PM +0100, Morten Rasmussen wrote: > Could you enlighten me a bit about how to define the arch specific > implementation without getting into trouble? I'm failing miserably :( Hmm, this was not supposed to be difficult.. :/ > I thought the arm arch-specific topology.h file was a good place to put > the define as it get included in sched.h, so I did a: > > #define arch_scale_freq_capacity arm_arch_scale_freq_capacity > > However, I have to put a function prototype in the same (or some other > included) header file to avoid doing an implicit function definition. > arch_scale_freq_capacity() takes a struct sched_domain pointer, so I > have to include linux/sched.h which leads to circular dependency between > linux/sched.h and topology.h. Why would you have to include linux/sched.h ? #define arch_scale_freq_capacity arch_scale_freq_capacity struct sched_domain; extern unsigned long arch_scale_freq_capacity(struct sched_domain *, int cpu); Would work from you asm/topology.h, right? > We can drop the sched_domain pointer as we don't use it, but I'm going > to do the same trick for arch_scale_cpu_capacity() as well which does > require the sd pointer. Sure, dropping that pointer is fine. > Finally, is introducing an ARCH_HAS_SCALE_FREQ_CAPACITY or similar a > complete no go? It seems out of style, I'd have to go look for the email thread, but this should more or less be the same no?