Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933731AbbHLRXa (ORCPT ); Wed, 12 Aug 2015 13:23:30 -0400 Received: from casper.infradead.org ([85.118.1.10]:52059 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932279AbbHLRX1 (ORCPT ); Wed, 12 Aug 2015 13:23:27 -0400 Date: Wed, 12 Aug 2015 19:23:18 +0200 From: Peter Zijlstra To: Dietmar Eggemann Cc: Morten Rasmussen , "mingo@redhat.com" , "vincent.guittot@linaro.org" , "daniel.lezcano@linaro.org" , "yuyang.du@intel.com" , "mturquette@baylibre.com" , "rjw@rjwysocki.net" , Juri Lelli , "sgurrappadi@nvidia.com" , "pang.xunlei@zte.com.cn" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" Subject: Re: [RFCv5 PATCH 16/46] sched: Allocate and initialize energy data structures Message-ID: <20150812172318.GX16853@twins.programming.kicks-ass.net> References: <1436293469-25707-1-git-send-email-morten.rasmussen@arm.com> <1436293469-25707-17-git-send-email-morten.rasmussen@arm.com> <20150812101721.GV19282@twins.programming.kicks-ass.net> <55CB7DE7.9060403@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55CB7DE7.9060403@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 Content-Length: 1075 Lines: 22 On Wed, Aug 12, 2015 at 06:09:59PM +0100, Dietmar Eggemann wrote: > > One more question, if fn() returns a full structure, why are we > > allocating and copying the thing? Its all const read only data, right? > > > > Yeah, that's not strictly necessary. I could get rid of all the > allocation/copying/ and freeing code and just simply set sd->groups->sge > = fn(cpu) in init_sched_energy(). Plus delete the atomic_t ref in struct > sched_group_energy. > > In this case, should I still keep the check_sched_energy_data() function > to verify that the scheduler got valid data via the struct > sched_domain_topology_level table from the arch, i.e. to make sure that > the per-cpu provided sd energy data is consistent for all cpus within > the sched group cpumask? Oh yes very much. We want sanity checking of the data handed. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/