Received: by 10.223.164.202 with SMTP id h10csp112685wrb; Thu, 30 Nov 2017 07:41:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMYNAr5UV/biur02jFQaA7TiDX8BBVfIBXKe0c+ChHYtULmieC0c2JvliO5afYVoArTLERb9 X-Received: by 10.99.95.12 with SMTP id t12mr2896137pgb.40.1512056519161; Thu, 30 Nov 2017 07:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512056519; cv=none; d=google.com; s=arc-20160816; b=d1eQrspZN1/R0/0bKY++rjb0Z7rQ6oKaa4uel8krltKnR3iaBOWQGlMPidLBVvPfRq iFJdF0BBCAXu3cmE4qY9u0buo/eKMxDUOJs9qnh96iC9TCpmHbLbikOt8X8HuE7T1siQ 5av2UaLxbgndnsnADIaGpiq6u3h37OvLi81eCtUkXunBgiCpN6belja+UL1PdZ0oDpyJ avoTKl19wTJLX+7IeepAPk2xWqFcgVTNe1eQIqTp9V34DMK2QBDBH02x1dmKFeK8eLy+ dhZy4ODL9/M8krIGl6Vwwcc5dFQ7XiuC/Q6Y/BL3Hca1jTBMzbpp+oR5esfzQz8KqPPj erZA== 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=SlMd2gjOVz/JNxyw9Q4ph1dPSldqPmdXfQdFpg3NvZ4=; b=a2hKb0u8ByBHPcGpNGqcpcyJb2ozwXFsOu5w3iCypUBk5+ZJinEt6CsT/aDGuqL8yn KYroD+Gq0VzKbWUQHfri9fuDvArRZpikYNHNBqcxrgMq6psrEPmdFS/NpIVHYelvwJLM PlICjLoi+NT3eyb/5WwPQ9BXzam9ndq8bBLSubB+FbTYepnlMF3FsnhvoZuPrZPBF6CP f4U5kRyHezGdPpwaAvMg1hH0qj3/rFxkW25IQcNt4mmw/NuAFBEMheKljXNIwpgbT4mD Z+zmuhnLZPPPOkfUR3QH7Zp4RaVj/7MxZRbou2ldX/qtxcypuVeqegcumfgIDQWpyWhW GAdg== 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 z88si3356299plh.687.2017.11.30.07.41.46; Thu, 30 Nov 2017 07:41:59 -0800 (PST) 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 S1752821AbdK3PlU (ORCPT + 99 others); Thu, 30 Nov 2017 10:41:20 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56326 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752722AbdK3PlQ (ORCPT ); Thu, 30 Nov 2017 10:41:16 -0500 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 6FDB315A2; Thu, 30 Nov 2017 07:41:16 -0800 (PST) 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 5C6653F318; Thu, 30 Nov 2017 07:41:14 -0800 (PST) Date: Thu, 30 Nov 2017 15:41:11 +0000 From: Patrick Bellasi To: Juri Lelli 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 , Todd Kjos , Joel Fernandes Subject: Re: [PATCH v3 1/6] cpufreq: schedutil: reset sg_cpus's flags at IDLE enter Message-ID: <20171130154111.GC31247@e110439-lin> References: <20171130114723.29210-1-patrick.bellasi@arm.com> <20171130114723.29210-2-patrick.bellasi@arm.com> <20171130131222.GA9903@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171130131222.GA9903@localhost.localdomain> 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 On 30-Nov 14:12, Juri Lelli wrote: > Hi, > > On 30/11/17 11:47, Patrick Bellasi wrote: > > [...] > > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > > index 2f52ec0f1539..67339ccb5595 100644 > > --- a/kernel/sched/cpufreq_schedutil.c > > +++ b/kernel/sched/cpufreq_schedutil.c > > @@ -347,6 +347,12 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > > > > sg_cpu->util = util; > > sg_cpu->max = max; > > + > > + /* CPU is entering IDLE, reset flags without triggering an update */ > > + if (unlikely(flags & SCHED_CPUFREQ_IDLE)) { > > + sg_cpu->flags = 0; > > + goto done; > > + } > > Looks good for now. I'm just thinking that we will happen for DL, as a > CPU that still "has" a sleeping task is not going to be really idle > until the 0-lag time. AFAIU, for the time being, DL already cannot really rely on this flag for its behaviors to be correct. Indeed, flags are reset as soon as a FAIR task wakes up and it's enqueued. Only once your DL integration patches are in, we do not depends on flags anymore since DL will report a ceratain utilization up to the 0-lag time, isn't it? If that's the case, I would say that the flags will be used only to jump to the max OPP for RT tasks. Thus, this patch should still be valid. > I guess we could move this at that point in time? Not sure what you mean here. Right now the new SCHED_CPUFREQ_IDLE flag is notified only by idle tasks. That's the only code path where we are sure the CPU is entering IDLE. > > sg_cpu->flags = flags; > > > > sugov_set_iowait_boost(sg_cpu, time, flags); > > @@ -361,6 +367,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > > sugov_update_commit(sg_policy, time, next_f); > > } > > > > +done: > > raw_spin_unlock(&sg_policy->update_lock); > > } > > > > diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c > > index d518664cce4f..6e8ae2aa7a13 100644 > > --- a/kernel/sched/idle_task.c > > +++ b/kernel/sched/idle_task.c > > @@ -30,6 +30,10 @@ pick_next_task_idle(struct rq *rq, struct task_struct *prev, struct rq_flags *rf > > put_prev_task(rq, prev); > > update_idle_core(rq); > > schedstat_inc(rq->sched_goidle); > > + > > + /* kick cpufreq (see the comment in kernel/sched/sched.h). */ > > + cpufreq_update_util(rq, SCHED_CPUFREQ_IDLE); > > Don't know if it make things any cleaner, but you could add to the > comment that we don't actually trigger a frequency update with this > call. Right, will add on next posting. > Best, > > Juri Cheers Patrick -- #include Patrick Bellasi From 1585496879689969354@xxx Thu Nov 30 13:14:12 +0000 2017 X-GM-THRID: 1585491492414219974 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread