Received: by 10.213.65.68 with SMTP id h4csp553676imn; Sun, 25 Mar 2018 06:49:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELuDal7teno6ltalTb4zyax59qjiYhS2t2oMKwnW4fImDpyfFsm/SAuyDQA4bs7WwCEDQhQX X-Received: by 2002:a17:902:51c3:: with SMTP id y61-v6mr11448504plh.355.1521985786467; Sun, 25 Mar 2018 06:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521985786; cv=none; d=google.com; s=arc-20160816; b=F38n7qiHI1ojKgbRoP1U+FnTT07O40a1qvVeRpXy3Y8vyLJdEaY69AKJ0+QM1nnYlH JrktoVSHo7d4QByjkpeeWNtEIm+xhPYZsJimuiyJnMY4bN9phZWN+zdmVdaksWDP8jEk WVt02/fWl+VmD0kbBDcyE8MXJLMmyOmXfBvoed64Yfl1v0tF7FNscD7XnQLDjFQzdWOU JQwB1Ct5dPmC1hThFGcQvcdf4ABJZOAxYNoPxqr79ktVliPGDciOuEiDyMwc458ZaIs1 wAfUXDsbfMtR2IDgc0pNHNtL/QdDisAZbD13mx3qxMJ8r47uJNrRsok3Q7v0jH3zqqBH ZEiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Re7WM/PjBlBwBzpH88zCY89S1XAMZOVlp2AWierHPgg=; b=NDFFI8rRwzch9N9DU++9l1vxvJBp+gxRLQuFRZ0+IpFy8jRjfs0wMTTl4Gtaj7IqfP jK6+1TShMvJdxhGaMDMxylOxqAOG7FSEfFmtaVuUoz6BTs3PRzogOYdAn+LDMDsvmLow RnEndXlYLaz0BHbPlu2TszFk1RNufyoIdqXyJgZE+yt+BTTa95fjj/DWsNtMpHUhYg+E k5LgO1lYGyhwEGatyPb6EGn/7C/nxKhwSboHbyOPWWm+PE182PTL+rbNZQXakFanCteV tBqHQiQyJrRy+SeTFYTTwcRIkyqPWx+3X/+IcFbweZ+qshbxIBRXGI+3GvpqGkxaC6SC vfLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m75si10059481pfg.64.2018.03.25.06.49.32; Sun, 25 Mar 2018 06:49:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753368AbeCYNs1 (ORCPT + 99 others); Sun, 25 Mar 2018 09:48:27 -0400 Received: from foss.arm.com ([217.140.101.70]:33672 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752213AbeCYNsZ (ORCPT ); Sun, 25 Mar 2018 09:48:25 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 273741529; Sun, 25 Mar 2018 06:48:25 -0700 (PDT) Received: from queper01-VirtualBox (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A588C3F557; Sun, 25 Mar 2018 06:48:19 -0700 (PDT) Date: Sun, 25 Mar 2018 14:48:10 +0100 From: Quentin Perret To: Greg Kroah-Hartman Cc: Dietmar Eggemann , linux-kernel@vger.kernel.org, Peter Zijlstra , Thara Gopinath , linux-pm@vger.kernel.org, Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Todd Kjos , Joel Fernandes Subject: Re: [RFC PATCH 2/6] sched: Introduce energy models of CPUs Message-ID: <20180325134548.GA1344@queper01-VirtualBox> References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-3-dietmar.eggemann@arm.com> <20180320095215.GB23359@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180320095215.GB23359@kroah.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 20 Mar 2018 at 10:52:15 (+0100), Greg Kroah-Hartman wrote: > On Tue, Mar 20, 2018 at 09:43:08AM +0000, Dietmar Eggemann wrote: > > From: Quentin Perret [...] > > +#ifdef CONFIG_PM_OPP > > #ifdefs go in .h files, not .c files, right? > So, after looking into this, my suggestion would be to: 1) remove the #ifdef CONFIG_PM_OPP from energy.c entirely; 2) make sure init_sched_energy() is stubbed properly for !CONFIG_SMP and !CONFIG_PM_OPP in include/linux/sched/energy.h; 3) relocate the global variables (energy_model, freq_domains, ...) to fair.c; and 4) modify kernel/sched/Makefile with something like: ifeq ($(CONFIG_PM_OPP),y) obj-$(CONFIG_SMP) += energy.o endif That way, energy.c is not compiled if not needed by the arch, and the ifdef are kept within header files and Makefiles. Would that work ? Thanks, Quentin