Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1992380imm; Sun, 9 Sep 2018 13:15:28 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb2G905Ge/BsQyOhQabU/Y3i/oEZPSgcjE1+/VUat8JLBRKxy7NQivKgnHBc6jZjNsQTF7u X-Received: by 2002:a63:6a89:: with SMTP id f131-v6mr19481944pgc.165.1536524128513; Sun, 09 Sep 2018 13:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536524128; cv=none; d=google.com; s=arc-20160816; b=cCmfXAotw04TqFtzE0Za44NeTzorPILROo8qvuiXtVbxLJZ5zFUFS5Z5rcR0rY7egR pqx/cmhCulpcru6mdzRZBa+jeYUXgr/fRnU2uccjp4dp2KcdmHyVdyVYQkLUeb5RaClo A1PHMCGVCFhM4ts1zeaqIb/6ZFSXwNQUYuEnsCzekfa/zqITmsjaY/YTXd4VEAyH3Ees 1GRnsgZ4X0ovTncrwhnhP42bpa7iAFLVHAbom/SKSHFBP7tCWMLNT3vYdgIJJj1gBcPJ lOCt7XxskaC0f+vMV9/v4CRq77K5gIokqgtZ8mdvcKrnZX2/6v+V+OaJ+0KHMdyC5TNU yIGg== 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=ia86bkJ9m8uGLpDk5aTIYJRevY0u6R3hEBOP9EZsM6k=; b=E9HrWIMsawlButlBMZi7IqPR+pMA8CoRrnLWj6oApYYRXV5UAaNzr6e6a5Uhz4w0qk O6iDNUEbjhCnrBnG1vVLEeQ/OrEp8xgYqIT6VjRuuc0RbTTWCR98Vvxx893B7XiZ3eON uRazYPOeEd27uajXbfFjl4lRCTQ/eGIi4Zm4TM24KLViwO7ndgIcn/0zvV58CiTV9GAd MC75qGCrGy3lnUhz1i2EDuHr34INI1RQbCImVZ2s4W43eZf7Svs8vR2Ifyi4bEI5b0NO yDg6jc27krbrE8jnVhuWeOOYKzO2sjDWoI2jQtib4PVGUoSNU+Maj/TK7yaNOeUru8/P 5o4w== 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 b31-v6si15173953pgl.437.2018.09.09.13.15.11; Sun, 09 Sep 2018 13:15:28 -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 S1726713AbeIJBEx (ORCPT + 99 others); Sun, 9 Sep 2018 21:04:53 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:33072 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbeIJBEx (ORCPT ); Sun, 9 Sep 2018 21:04:53 -0400 Received: by mail-oi0-f66.google.com with SMTP id 8-v6so36423886oip.0; Sun, 09 Sep 2018 13:14:04 -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=ia86bkJ9m8uGLpDk5aTIYJRevY0u6R3hEBOP9EZsM6k=; b=tdEdvnJ88GSd+cKNaAADdgfDdT/QEToBowQUWaZdk6+Bt6E0ff4HuU6rDQFXzE+CTD xGdmZlunYe8bGx9GTvVAgtUo0m9zx+KHjy32o2LbePpIb8n3cSb1kovt5UuDZTlaVEPs pW3nNiEbVRcDiFdqFLenOLOkzAklnA5fTv1MI08cfPz0ry9oHZaH5FSaezr8lIuhApZp bA0tCA6imV+kCz2sRR4tc31t/sexxce6DjwBYALsRSpFXMitkTkne1K53rGJ7vhLZu+b EJVWER5vr3H1Tt7j2Dmm8MIMW2nH/z9zOngzHd17MCO4pq34rOBbO5BJug8xSBjlbldg CXbA== X-Gm-Message-State: APzg51BdRY2/J89iQka4yuSJtNlsWuXw5teuU9SLu/L5rLJk9n42GP1X dBcQ3+9APRSRpApswb0JppVkS52C2FBKkP3WMIw= X-Received: by 2002:aca:aa06:: with SMTP id t6-v6mr19399448oie.152.1536524043596; Sun, 09 Sep 2018 13:14:03 -0700 (PDT) MIME-Version: 1.0 References: <20180820094420.26590-1-quentin.perret@arm.com> <20180906143842.xlxcg5notwdaflww@queper01-lin> <1545744.fI5ZvP8FO0@aspire.rjw.lan> <20180907152923.oxsmcqciez4yhmkk@queper01-lin> In-Reply-To: <20180907152923.oxsmcqciez4yhmkk@queper01-lin> From: "Rafael J. Wysocki" Date: Sun, 9 Sep 2018 22:13:52 +0200 Message-ID: Subject: Re: [PATCH v6 13/14] sched/topology: Make Energy Aware Scheduling depend on schedutil To: Quentin Perret Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Peter Zijlstra , 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 Fri, Sep 7, 2018 at 5:29 PM Quentin Perret wrote: > > On Friday 07 Sep 2018 at 10:52:01 (+0200), Rafael J. Wysocki wrote: > > On Thursday, September 6, 2018 4:38:44 PM CEST Quentin Perret wrote: > > > Hi Rafael, > > > > > > On Thursday 06 Sep 2018 at 11:18:55 (+0200), Rafael J. Wysocki wrote: > > > > 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. > > > > > > Right. I agree there are alternatives to using notifiers. I used them > > > because they're existing infrastructure, and because they let me do what > > > I want without too much troubles, which are two important points. > > > > > > > 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. > > > > > > Are you thinking about something comparable to what is done in > > > cpufreq_add_update_util_hook() (kernel/sched/cpufreq.c) for example ? > > > That would probably have the same drawback as my current implementation, > > > that is that the scheduler is notified of _all_ governor changes, not > > > only changes to/from sugov although this is the only thing we care about > > > for EAS. > > > > Well, why don't you implement it as something like "if the governor changes > > from sugov to something else (or the other way around), call this function > > from the scheduler"? > > I just gave it a try and ended up with the diff below. It's basically > the exact same patch with a direct function call instead of a notifier. > (I also tried the sugov_start/stop thing I keep mentioning but it is > more complex, so let's see if the simplest solution could work first). > > What do you think ? This generally works for me from the cpufreq perspective, but I would add "cpufreq" to the name of the new function, that is call it something like sched_cpufreq_governor_change(). Also do you really need the extra work item? Governor changes are carried out in process context anyway. Thanks, Rafael