Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp285456imm; Thu, 6 Sep 2018 02:23:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbQw7LSu45fRdqKRnFtg2YWETzWR8N4OVuXXKlXqd25tR+5fSV2MFfaU7S/fY0l/1YdZuff X-Received: by 2002:a63:5a13:: with SMTP id o19-v6mr1752912pgb.75.1536225811068; Thu, 06 Sep 2018 02:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536225811; cv=none; d=google.com; s=arc-20160816; b=iPYJK3emzU72rZvFOH0+iFkrg6vXLNyDpHYwwyhv0iNtcVgCzthgTnV7qoc32Ldlfn +6qdkR5oC7Q3fAR69sqcWg207ntK+jOxMaSfL/+ccUuMC3bB63mIMrVe45c1Vu0U5yWo pA/RLqQ8kXOFupRSTj6nT88azZSZWxBmapAGuJC84EusvF6QZGarP8e6Rt1xJeyxFtue ngCv79HAvmMt06dPqUEexbMjAZpqdChQRYo2xzcvx4oZoHOzLAjrL98COrdiHkXWuGpe ypiqFaYfGtZT43DXNZGxvP2BqKmutHD4LwmzxPc+8RdafmXcjYr9JvjQADA0RMUm+KD0 8lLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=/2mJh7f1paRq/mvssm+CXE54aa2kaN5YQO6XRPuc0kw=; b=T+JChRE5+FWMr4fwyLRkYIz0fvNEzDqdgmt28hkUdYHs2QFSo0/RFFd5jxWJM8Yl5G +zOIJicQAmIpRXWuF4+vhycPyYzEsI51pO1sWuJLNEzYs1n/k/xXO/s3eHJn/PEzc0Z7 sn0OHxDBGD7L/b+eHPrbvulweRkNFYAdIyQQtjeKzKzvOF6Q1/g8ukAtfIgg/Nm/Ytsw +/SEnkiNY2SKUHEvvKhl9eP8grY5RBxFjmLqfgpauqgGcouhWaTTBSF1d3ukup4rHoPC TNE8nGJQxVETzdaQSWXi39ktgjj4Mk+VDHeRho9WvDuqWS2vWX04AH/xPBsX56wphHqe ZAuQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h22-v6si4970259pfa.238.2018.09.06.02.23.15; Thu, 06 Sep 2018 02:23:31 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728596AbeIFNxj (ORCPT + 99 others); Thu, 6 Sep 2018 09:53:39 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:44152 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728181AbeIFNxi (ORCPT ); Thu, 6 Sep 2018 09:53:38 -0400 Received: by mail-oi0-f52.google.com with SMTP id l82-v6so19144358oih.11; Thu, 06 Sep 2018 02:19:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/2mJh7f1paRq/mvssm+CXE54aa2kaN5YQO6XRPuc0kw=; b=ZYYYitybn86kySXq0PJCbB3NcJoAMj72bLWKCW7qmiqJjzo9IXpsTc+L/CYECaFGfQ EbWo2UZfyeS6yRcwAnDud9NmYW2434D6Uq0g55BRS40JmEqiOttV9C0qFr5LgRSDzR5+ sugEkGxAQW6mLhbXVUxPMO63v/r+R6uvnqA8bQsXtQnSNxkCFWKjqN3EL6N9J5BVZoQP E3y8RoARv6eVfZGjcGZ7k6aB1Em6gYb33ldm6iJK5OhVLQgcUoquCnuD5k+uaoYsygmf S3Bi+X/Y/x54Ag1WtcXUUayrLJRoAbrSPwesotUTeTOVShfNctbF6nFMS+E1NXw6hUtg UaDQ== X-Gm-Message-State: APzg51CF2Stse/aDRiHwot+teMEyVQ8W941ehGZ2LWCvPI2mBw0btDn5 l7s9mshZOw6lX4Ebwfz23vpTqa+kGwFSIaMYPms= X-Received: by 2002:aca:b844:: with SMTP id i65-v6mr1986469oif.177.1536225546363; Thu, 06 Sep 2018 02:19:06 -0700 (PDT) MIME-Version: 1.0 References: <20180820094420.26590-1-quentin.perret@arm.com> <20180820094420.26590-14-quentin.perret@arm.com> <20180904105906.t5i7twyyt2omc45b@queper01-lin> In-Reply-To: <20180904105906.t5i7twyyt2omc45b@queper01-lin> From: "Rafael J. Wysocki" Date: Thu, 6 Sep 2018 11:18:55 +0200 Message-ID: Subject: Re: [PATCH v6 13/14] sched/topology: Make Energy Aware Scheduling depend on schedutil To: Quentin Perret Cc: Peter Zijlstra , "Rafael J. Wysocki" , Linux Kernel Mailing List , Linux PM , Greg Kroah-Hartman , Ingo Molnar , Dietmar Eggemann , Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , Vincent Guittot , Thara Gopinath , Viresh Kumar , Todd Kjos , Joel Fernandes , Steve Muckle , adharmap@codeaurora.org, Saravana Kannan , Pavan Kondeti , Juri Lelli , Eduardo Valentin , Srinivas Pandruvada , currojerez@riseup.net, Javi Merino Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 4, 2018 at 12:59 PM Quentin Perret wrote: > > On Monday 20 Aug 2018 at 10:44:19 (+0100), Quentin Perret wrote: > > Energy Aware Scheduling (EAS) is designed with the assumption that > > frequencies of CPUs follow their utilization value. When using a CPUFreq > > governor other than schedutil, the chances of this assumption being true > > are small, if any. When schedutil is being used, EAS' predictions are at > > least consistent with the frequency requests. Although those requests > > have no guarantees to be honored by the hardware, they should at least > > guide DVFS in the right direction and provide some hope in regards to the > > EAS model being accurate. > > > > To make sure EAS is only used in a sane configuration, create a strong > > dependency on schedutil being used. Since having sugov compiled-in does > > not provide that guarantee, extend the existing CPUFreq policy notifier > > with a new case on governor changes. That allows the scheduler to > > register a callback on this notifier to rebuild the scheduling domains > > when governors are changed, and enable/disable EAS accordingly. > > > > cc: Ingo Molnar > > cc: Peter Zijlstra > > Signed-off-by: Quentin Perret > > > > --- > > This patch could probably be squashed into another one, but I kept it > > separate to ease the review. Also, it's probably optional as not having > > it will not 'break' things per se. > > > > I went for the smallest possible solution I could find, which has the > > good side of being simple, but it's definitely not the only one. > > > > Another possibility would be to hook things in sugov_start() and > > sugov_stop(), but that requires some more work. In this case, it > > wouldn't be possible to just re-build the sched_domains() from there, > > because when sugov_stop() is called, the 'governor' field of the policy > > hasn't been updated yet, so the condition (if gov == schedutil) in > > build_freq_domains() doesn't work. > > > > To workaround the issue we'll need to find a way to pass a cpumask to > > the topology code to specifically say 'sugov has been stopped on these > > CPUs'. That would mean more code to handle that, but that would also > > mean we don't have to mess around with the CPUFreq notifiers ... > > > > Not sure what's best, so all feedback is more than welcome. > > Hi, > > Does anybody have concerns with this patch ? Is it a reasonable option > to use the CPUFreq notifiers in this case ? If there is anything I can > do to ease the review please let me know. I'm not a particular fan of notifiers to be honest and you don't need to add an extra chain just in order to be able to register a callback from a single user. That can be achieved with a single callback pointer too, but also you could just call a function exported by the scheduler directly from where in the cpufreq code it needs to be called. > Also, is there any hope that the 12 first patches could make it in 4.20 > on their own ? Or is it already too late ? I'm walking through them right now, albeit somewhat slowly due to various distractions, so we'll see. Thanks, Rafael