Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2802084imm; Thu, 24 May 2018 16:30:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/17rF8MFG/EvPDkUCtSGZ5gahnnMQVCizX4kpbi4zJUxpVLmM5Xr5oUJWvTOyK+bmJqxo X-Received: by 2002:a65:46ce:: with SMTP id n14-v6mr18848pgr.193.1527204651461; Thu, 24 May 2018 16:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527204651; cv=none; d=google.com; s=arc-20160816; b=wY0Hjxk6AEES160YLsygNEPFkpJeb2E1AOcy7UgoQBzLsEsV6ceIR6KFZreB8WMjxB WsTAcDa2bH3Z/Bh5zNmz42ThNy/tGoZC6g5BKysj6CunTBiPeBQfKX7SiGoP8tlnUj98 KVJAWYcT5FEPO384C6gh9sYUytwCemxMwhUIOH+2nU43H+iyCPsh9497UhRUaLg5Rab/ VCcbXNoDeR4SkJwUkoRADAgJeuHYSzxdVdv77VhtFk7euH4hS0ztYDAG7uC8pcDLqhnF foJc3E/3obW0wr0yiesVszgpHbHFZY9hNaywu/J9JN++k0uTgxS2tuZQ2MJTMNr/lKlk aUTg== 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:arc-authentication-results; bh=V9CE+R1wJQHGHV2DCjmMsj7qaOp+5Tk2A0U+PJJf7QY=; b=oJosE6ZYh0UFpgpLTguYd+izQSvbAelDzBu27+aHgkTJFwIsx6i8DI0h+W1zZd8SAC BDS95oRipxLmGnjbJnYbnaofecQPnn+cz+uOESCqAAzI8dDF0/GRuAIWgXzfB25Ye7U2 baXREScAHEnFHVGhuhViXcp6CtLoTkiaoBpIohnNhOn6Ltt8+X+O0D+eFd+lfKS7LIve 5Ckg/+jlFq4LcU/mtFcmZ6CbH8z54mu3NPfIt7PpLssqi1duDWWE3byRsGYMppO4P5S0 YzffMUzXaM2gRhQqD997fK7wZ8UhsuGWXVbyzpWmrXmObzij7iSoefyOMleuwsfYj+yY WSZA== 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 s194-v6si2173008pgc.602.2018.05.24.16.30.36; Thu, 24 May 2018 16:30: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; 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 S969542AbeEXNmp (ORCPT + 99 others); Thu, 24 May 2018 09:42:45 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45060 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966066AbeEXNmm (ORCPT ); Thu, 24 May 2018 09:42: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 F09711596; Thu, 24 May 2018 06:42:41 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5AFA13F24A; Thu, 24 May 2018 06:42:39 -0700 (PDT) Date: Thu, 24 May 2018 14:42:36 +0100 From: Patrick Bellasi To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Joel Fernandes , Todd Kjos , kernel-team@android.com, Steve Muckle Subject: Re: [PATCH 3/3] sched/fair: schedutil: explicit update only when required Message-ID: <20180524134236.GA30654@e110439-lin> References: <20180510150553.28122-1-patrick.bellasi@arm.com> <20180510150553.28122-4-patrick.bellasi@arm.com> <20180513060443.GB64158@joelaf.mtv.corp.google.com> <20180513062538.GA116730@joelaf.mtv.corp.google.com> <20180514163206.GF30654@e110439-lin> <20180517151701.GC162290@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180517151701.GC162290@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joel, sorry for the late reply, this thread is a bit confusing because we keep discussing while there was already a v2 posted on list. However, here are few comments below... [...] > > > > > @@ -5456,10 +5443,12 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) > > > > > update_cfs_group(se); > > > > > } > > > > > > > > > > + /* The task is no more visible from the root cfs_rq */ > > > > > if (!se) > > > > > sub_nr_running(rq, 1); > > > > > > > > > > util_est_dequeue(&rq->cfs, p, task_sleep); > > > > > + cpufreq_update_util(rq, 0); > > > > > > > > One question about this change. In enqueue, throttle and unthrottle - you are > > > > conditionally calling cpufreq_update_util incase the task was > > > > visible/not-visible in the hierarchy. > > > > > > > > But in dequeue you're unconditionally calling it. Seems a bit inconsistent. > > > > Is this because of util_est or something? Could you add a comment here > > > > explaining why this is so? > > > > > > The big question I have is incase se != NULL, then its still visible at the > > > root RQ level. > > > > My understanding it that you get !se at dequeue time when we are > > dequeuing a task from a throttled RQ. Isn't it? > > I don't think so? !se means the RQ is not throttled. Yes, I agree, I "just" forgot a "not" in the sentence above... my bad! However, we are on the same page here. > > Thus, this means you are dequeuing a throttled task, I guess for > > example because of a migration. > > However, the point is that a task dequeue from a throttled RQ _is > > already_ not visible from the root RQ, because of the sub_nr_running() > > done by throttle_cfs_rq(). > > Yes that's what I was wondering, so my point was if its already not visible, > then why call schedutil. I felt call schedutil only if its visible like you > were doing for the other paths. Agree, as discussed in Vincent in v2, we should likely move these schedutil updates at attach/detach time. This is when exectly we know that the utilization has changed for a CPU. ... and that's what I'll propose in the upcoming v3 for this patch. [...] > I agree with your assessments below and about not calling cpufreq > when CPU is about to idle. Cool ;) -- #include Patrick Bellasi