Received: by 10.213.65.68 with SMTP id h4csp2530316imn; Mon, 9 Apr 2018 05:08:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+KGwncc25RcecL518pOENSKT50j1iSxwqHn4IDa7r2piOa/3jgEqI4mhG/shJ6KeLL5RCW X-Received: by 2002:a17:902:988d:: with SMTP id s13-v6mr14452752plp.30.1523275731279; Mon, 09 Apr 2018 05:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523275731; cv=none; d=google.com; s=arc-20160816; b=EV0fFKwEU9bv7G1sSQaRFgOjuQ2wM2OdI9EJWbzrj9IYcGeoqjgwmLHeFJz/Y29oEJ nqEiknBBA9pnm/ustUOdLB5owo8aAnKEC9RRoYuN1c59dhXUVL6BZoy9fOEYoyO5MbGS kikQ1xP+euG2Mw9ORw0xISn1m8c/kCBNhWhCoI2bgROZnfmyoe3r+RrK3vGC4vcZCWM0 BaIp41LHIdDzvz7gYHqdQwCH+kbMOCBUo7gWsRB1F9ITjOfMudOpcJY0BBtjOyX4Erv2 dkYkbPCzxt+DY3FIBRvDcvfqCgWhDzS5TJrMW0pL7B5FPYpVyi6ChmH3UbFaXqsbZCmb 3mjA== 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:dkim-signature:arc-authentication-results; bh=bQpYjl+LvjcfXn5dwVONZL7s4H/ozMeawvYNZ3zXFr8=; b=STpCRpd5aI6oYBWbrAc0mU1xyw3DPkt8fOALHlOSH3DQq/0Go0nh8B23+Da2L106cL K+xmxR1RVc1veePZ8qhSfdX7wsYABrVWWWvhtZCxjX6sPQ4bmUXqvcg3U/dYDcaPB9FH hy20AssBAP3S+pFctM0EkzPV+z+TOp2oeeE68+m+kNe5UNFMd/jPINyYyEq+gJloLv+N XHyQ34bKG/hQIe8HqmR06NyDWmCror0DcnMPpYDdTZUKCQhZkHpSzKdIJZvbJiEhNyvX Cu/xwprzftK5uaFzTnf3Gjhv7xY0mh3V+iQnmi4UEnqmJmFbSTSeK+aB9wF0Z+J2Dewk ZcEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HQ2y+/nJ; 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 c11si108320pgw.757.2018.04.09.05.08.14; Mon, 09 Apr 2018 05:08:51 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HQ2y+/nJ; 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 S1752147AbeDIMBR (ORCPT + 99 others); Mon, 9 Apr 2018 08:01:17 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50876 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbeDIMBP (ORCPT ); Mon, 9 Apr 2018 08:01:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bQpYjl+LvjcfXn5dwVONZL7s4H/ozMeawvYNZ3zXFr8=; b=HQ2y+/nJ8BfuWHA+DgU09XZ1V k1g3FMfmvsvXxLaDtz0sFhbQvaIMrlurHWm12uT8RLEntYRe4r+nHhwcaoP53guLMBxjR0N/eucbd 1PD96WPQAHzTNW+xcItRl1pQVKkqCrQTZuV81AD+zfPK0/n8XlLYeo5zZPL4baiSrXtePAhwWr8ZA e73HEMUYTkDTVucHhV2caC/PotDVwI2E+Jry22bEnK3ubFJB/ItZUij2xC3vyKTd4eOEAwa4VtOvc 8ha46TbYDhGANqSvsry6VmEauBr6MhFzzYZAH4V98YpwPPdrydVudQwFNqSmmiqgnsYgpjK3DSkpW Amrk/3aTw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5VU0-00020t-Q1; Mon, 09 Apr 2018 12:01:12 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5320C20298CF9; Mon, 9 Apr 2018 14:01:11 +0200 (CEST) Date: Mon, 9 Apr 2018 14:01:11 +0200 From: Peter Zijlstra To: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, Quentin Perret , Thara Gopinath , linux-pm@vger.kernel.org, Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos , Joel Fernandes Subject: Re: [RFC PATCH 2/6] sched: Introduce energy models of CPUs Message-ID: <20180409120111.GA4043@hirez.programming.kicks-ass.net> References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-3-dietmar.eggemann@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180320094312.24081-3-dietmar.eggemann@arm.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 20, 2018 at 09:43:08AM +0000, Dietmar Eggemann wrote: > From: Quentin Perret > > The energy consumption of each CPU in the system is modeled with a list > of values representing its dissipated power and compute capacity at each > available Operating Performance Point (OPP). These values are derived > from existing information in the kernel (currently used by the thermal > subsystem) and don't require the introduction of new platform-specific > tunables. The energy model is also provided with a simple representation > of all frequency domains as cpumasks, hence enabling the scheduler to be > aware of dependencies between CPUs. The data required to build the energy > model is provided by the OPP library which enables an abstract view of > the platform from the scheduler. The new data structures holding these > models and the routines to populate them are stored in > kernel/sched/energy.c. > > For the sake of simplicity, it is assumed in the energy model that all > CPUs in a frequency domain share the same micro-architecture. As long as > this assumption is correct, the energy models of different CPUs belonging > to the same frequency domain are equal. Hence, this commit builds only one > energy model per frequency domain, and links all relevant CPUs to it in > order to save time and memory. If needed for future hardware platforms, > relaxing this assumption should imply relatively simple modifications in > the code but a significantly higher algorithmic complexity. What this doesn't mention is why this isn't part of the regular topology bits. IIRC this is because the frequency domains don't necessarily need to align with the existing topology, but this completely fails to state any of that. Also, since I'm not at all familiar with DT and the OPP library stuff, this code is completely unreadable to me and there isn't a nice comment to help me along.