Received: by 10.213.65.68 with SMTP id h4csp1316962imn; Wed, 21 Mar 2018 07:52:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELtKPfThvHOhEnXq8dNNKL/GqOX/sEc5GQPApvfuB2CL2RnCow/uuhSixrgJSVAwA+JbYgml X-Received: by 10.99.119.129 with SMTP id s123mr1811772pgc.137.1521643943323; Wed, 21 Mar 2018 07:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521643943; cv=none; d=google.com; s=arc-20160816; b=qwL3yM8Rk/9hGBbrDiIkLSSb9v3lkatFxFzZJ0D3vSoiYlcY7hykqK9fIJNoZtEX+g /ZkVW8A0y4lBsW8CBqAR23wewC4sWKPOTKb80gqNALl1Dciaj76qt2jQlCebuB3cOgTZ dsgMh6YCSmNSW7AbEFaWl2IPS2YMFrQvDnZWjsUG6hAbRXhBs8FcNxgDl4K5I6j9nTxa xPU9LzaG7icBlL+ufWQlsD4TqMt3VvzpzsA/cCiAC7VAi5EOwwqpz4XWP92JUuqynP6b qmpTlVBxJOfRo+wAqMsN5q2Pfz7U0mGEubj1SyEPab822ejxD8NlvYgxjg3fNQ9bThoa zu/g== 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=etje9eadyyy74nXkJrX8TSw7z/q4cgxTbu5bEnXop8E=; b=buZYJvOp4CaX6MfkChSffDEr2hSKGW90zJiS9pDUnNZcLE9slo2qlm3KK/8TdO/TaQ I2/o8u8H29OrTBxgMVC1l4BB19m7bEhvpB+kbKT+JfvPfUrW8LPhVPJu/mect28ov/hH au7nHGF7WrUqNkgJkAc9XzC4BBK1I86t/0ytgiHd7BNwcDrX2EVepDqZj1k2y81uqL6M vU4eGWYDI6sS4g+Yh8wqKWT9B9gE0uJSmU6F9RRIZmWelX8RKNzJ4DTH9VwC8UiUkkiS rW9Fzf1/Gqplpi2vXmxk1iz+t+V/a71TsRWrsy8kWl4fO6GPMPNEuK0cABxm055whPW4 h2lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QK/ZDczI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a60-v6si3984100pli.13.2018.03.21.07.52.08; Wed, 21 Mar 2018 07:52:23 -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=pass header.i=@gmail.com header.s=20161025 header.b=QK/ZDczI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752327AbeCUOuk (ORCPT + 99 others); Wed, 21 Mar 2018 10:50:40 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:44950 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752285AbeCUOuh (ORCPT ); Wed, 21 Mar 2018 10:50:37 -0400 Received: by mail-wr0-f196.google.com with SMTP id u46so5467365wrc.11; Wed, 21 Mar 2018 07:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=etje9eadyyy74nXkJrX8TSw7z/q4cgxTbu5bEnXop8E=; b=QK/ZDczIYEy3ayUIYdK8w8E4T7/JzOJl8Vz35UOsJ/+K8grfGc/nY62CjzA+6qkImN hUDoUba7vS6rMLI+Wumae3QlH1M6qJQRbMvK25onQQd3h7gj3S6u9P/J96fOyO3HVTML QiYb3g39XZqXOsQC2Kq6UeJdi/v/Fy+h3HFXpNzYZ27+H0SKIbK3WiYA5RTKZqTZQXW+ VPMbrjcyS+sX1Uu7V4wcNpo96A16Jf62M4ZW0+kFrsoADTSicbE55nDftMgnthkdquHT S1ljSuxgRWYRTo4SEOyfNPzULTk5JZCeWhAq6geuZMEDX46ZyqVR3Nx5kxFTv3bJkyjl UIhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=etje9eadyyy74nXkJrX8TSw7z/q4cgxTbu5bEnXop8E=; b=X0lKqQJWFlu9Rz1GKmvti1O0bIUHYrdtCvv3uu7yWbj+zhVgXFXjD+6MqbWTs3u+Rv rUh3bHPVaWCClnD/biAFoKiAJBmNDUzBjkVmSx5g2V0wQ3K7PyRv2N9nTVCt+5VXaseF WfJ+YWlgdjX2hJxzxWRaToxDnqmD4L5phblkTFsu2ZDxmWqXuY/6F0HV6WqxpsUXtG/O a9Wde2zZoeYPYfzlRDFbcXZkVpmG1nqbl4BieWQ2Ttct7306UoOXNwmQ5EH1W/b5xM7x UzRgEF2+vHOG7P9L5hx1oVFlsFAAE3xVneMvOBPTZRQvu1/BKv+NMT4zWmglBkXkaQMq ZGGw== X-Gm-Message-State: AElRT7EiGeKHqu+ZG7Ahco8gbNwumpNh4zTqP/2eAkHPBQl3bTSpJREu I5SJ/2BHTTCWeNkh1qIAgAg= X-Received: by 10.223.155.2 with SMTP id b2mr15685168wrc.185.1521643836181; Wed, 21 Mar 2018 07:50:36 -0700 (PDT) Received: from localhost.localdomain ([151.15.242.31]) by smtp.gmail.com with ESMTPSA id k17sm3654324wrh.18.2018.03.21.07.50.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 07:50:34 -0700 (PDT) Date: Wed, 21 Mar 2018 15:50:32 +0100 From: Juri Lelli To: Quentin Perret Cc: Patrick Bellasi , Dietmar Eggemann , linux-kernel@vger.kernel.org, Peter Zijlstra , Thara Gopinath , linux-pm@vger.kernel.org, Morten Rasmussen , Chris Redpath , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos , Joel Fernandes Subject: Re: [RFC PATCH 4/6] sched/fair: Introduce an energy estimation helper function Message-ID: <20180321145032.GD15165@localhost.localdomain> References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-5-dietmar.eggemann@arm.com> <20180321123921.GB13951@e110439-lin> <20180321142630.GB2168@queper01-VirtualBox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180321142630.GB2168@queper01-VirtualBox> 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 21/03/18 14:26, Quentin Perret wrote: > On Wednesday 21 Mar 2018 at 12:39:21 (+0000), Patrick Bellasi wrote: > > On 20-Mar 09:43, Dietmar Eggemann wrote: [...] > > > > If that's the case then, in the previous function, you can certainly > > avoid the initialization of *cs and maybe also add an explicit: > > > > BUG_ON(em->nb_cap_states == 0); > > > > which helps even just as "in code documentation". > > > > But, I'm not sure if maintainers like BUG_ON in scheduler code :) > > Yes, I'm not sure about the BUG_ON either :). I agree that it would be > nice to document somewhere that compute_energy() is unsafe to call > without sched_energy_present. I can simply add a proper doc comment to > this function actually. Would that work ? If it is something that must not happen and it is also non recoverable at runtime, then... $ git grep BUG_ON -- kernel/sched/ | wc -l 50 :)