Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp137905imm; Wed, 5 Sep 2018 23:10:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYL+NXRlPCrb/qpoK132K46o85+oS961Qk2svh3j5h+YVAOqMhF25Irj4vUXrG1j23P7d2a X-Received: by 2002:a17:902:7488:: with SMTP id h8-v6mr1242439pll.16.1536214258826; Wed, 05 Sep 2018 23:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536214258; cv=none; d=google.com; s=arc-20160816; b=SCWx18Qm9kflWJuuKqqoPkZM6zOlPuFeyLxr2Vwm3VxBzmR/jaPHLFf0cgBIwY44bP UMRVPFfkSbd9dfDua7HYt93PDBqCoouItl1zd3+/XbAW/VkI/1IlipGL373I3YaR196l CkKBsaQWKa6r1jqZao5CJejdWHyQ4tMfchKkIO0Puqjt+rLvcpT8PoR3e9IzhIPTGaBI 8KIfqGtuIbcnBkc5h6+JKixoUQxlJCqCfAumRK2o2GWtScUsgwdoS9pmzyYiYgpCPIn+ yzt0MXcWIn8Nmez/phlKTTOzU6LY9vXvkQLeeN9lzEwSJtynnMmIiQin2zWt+CXTAJ+m UefQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=vYob0TqVmWVNsjtYCew/dp+db59FHhVj6t7juftN8fE=; b=YSL5PezPdfc1LdSSgj+Q9APFjqIj3sII9KKVAIYLAdnDvkoitFdlVGMsyVBIYhWgjA y0ZLIEoVweN3rbUTEZ8AzcTU4Ov2b4bXzI5p2oJnRveRzkKroooHLzE0bNbvpEuOqXHj HpAjFy5dMpMLGpzAV+pBIUhfpVXdTZEgxPVetQbdHEF3ZO2/g3nCUePbf3Lee4kE7VuJ fjNtwIgTZfcJ4FxK6XFAUhqIDgWIfSlNoqKhr2jJ9f5QN9zWxPZ8v9oy9A4OadXESVUZ T4hg8TqnZ2EtxQjUZFBDXwAzegiQrfdQzTeCQ/uzHM6BPS/iEcZPVSzC7fM5NvJTUn5S rPZg== 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 t79-v6si4294755pfa.170.2018.09.05.23.10.12; Wed, 05 Sep 2018 23:10:58 -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 S1726425AbeIFKkm (ORCPT + 99 others); Thu, 6 Sep 2018 06:40:42 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39046 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbeIFKkm (ORCPT ); Thu, 6 Sep 2018 06:40:42 -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 EF2C17A9; Wed, 5 Sep 2018 23:06:52 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.Emea.Arm.com [10.4.12.239]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1C0643F557; Wed, 5 Sep 2018 23:06:42 -0700 (PDT) Subject: Re: [PATCH v6 07/14] sched/topology: Introduce sched_energy_present static key To: Quentin Perret , peterz@infradead.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: gregkh@linuxfoundation.org, mingo@redhat.com, morten.rasmussen@arm.com, chris.redpath@arm.com, patrick.bellasi@arm.com, valentin.schneider@arm.com, vincent.guittot@linaro.org, thara.gopinath@linaro.org, viresh.kumar@linaro.org, tkjos@google.com, joel@joelfernandes.org, smuckle@google.com, adharmap@codeaurora.org, skannan@codeaurora.org, pkondeti@codeaurora.org, juri.lelli@redhat.com, edubezval@gmail.com, srinivas.pandruvada@linux.intel.com, currojerez@riseup.net, javi.merino@kernel.org References: <20180820094420.26590-1-quentin.perret@arm.com> <20180820094420.26590-8-quentin.perret@arm.com> From: Dietmar Eggemann Message-ID: Date: Wed, 5 Sep 2018 23:06:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180820094420.26590-8-quentin.perret@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/20/2018 02:44 AM, Quentin Perret wrote: > In order to ensure a minimal performance impact on non-energy-aware > systems, introduce a static_key guarding the access to Energy-Aware > Scheduling (EAS) code. > > The static key is set iff all the following conditions are met for at > least one root domain: > 1. all online CPUs of the root domain are covered by the Energy > Model (EM); > 2. the complexity of the root domain's EM is low enough to keep > scheduling overheads low; > 3. the root domain has an asymmetric CPU capacity topology (detected > by looking for the SD_ASYM_CPUCAPACITY flag in the sched_domain > hierarchy). This is pretty much the list (+ is schedutil running) of conditions to set rd->pd != NULL in build_perf_domains(). So when testing 'static_branch_unlikely(&sched_energy_present) && rcu_dereference(rd->pd)' don't you test two times the same thing? Also, if let's say somebody wants to run another EM user (e.g. a thermal governor, like IPA) but not EAS on a asymmetric CPU capacity system. This can't be achieved with the current static branch approach So what about using a (disabled by default ?) sched_feature + rd->pd != NULL instead? [...]