Received: by 10.192.165.148 with SMTP id m20csp1388443imm; Thu, 10 May 2018 09:55:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoys4yO43U2k738sZ4vxeXGA+wAwJhNnWyJxYko4WjzrelfCSioxee2JoyM+WmXDkCVZjcn X-Received: by 2002:a63:9612:: with SMTP id c18-v6mr1701296pge.361.1525971302839; Thu, 10 May 2018 09:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525971302; cv=none; d=google.com; s=arc-20160816; b=itxc1I+Rg8tyYgzJI4vzxYjZbJsBbi0a2YtzLihD7AgjKCLxgZakiCXm5qLtLMuMc8 P6fsqoae1Wg0R09JQgCNho3o7lNcK93dx0K68iZRwxp8qg9ytlSoY1AH5lQt+R/qhBzy SWTl1h9BDJIYYpGAVJHQKMB5te/t1wCFNCqtq+Vzgi2wlbicgwT5Pp8sE+/rLF74rk3Z bl/MYLanv4Gb3chwr1nrE345R39y05nur2OOHmLhy0BfsnAdHBtRxnytzEBgGz65SUHY 9uNPikZR9dAbXILeGL256Lqg5+WNpTQEW9axUoJK+3glqlIUjUIl7SN/PXL0sSJwYnuf 9Xug== 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=yRIXeUQ0uEA/voBEW9+E3uEsGKEJusOHKz7k1KgFQgk=; b=0kEHNUiuu187Cx4vVR3z/P/KgKVZGOypfDQKTvli8/lVBRnpViPil/R1emXj9tSQGD oUwA0G8wpaOxxvpCZuSGekgl07oQMqLkt9T3DPQ+fqSeDLlx/NAsZ5KsxtIJ21VYzTjW iLuflZuGlCtf8yALPMyGKaK4kdWLMRss84vTmbGHVkd/ROYM7qMsCjhoE6XqkCWEWOlY gg824kH/cuEMFOpf2DLh8B/SLwk/oZ6P09D/Tcae0XY+5HoGdFWCmQ244x/swM+FB5kw tQNRgQojTt6SSmth/jijygUOuF+YMYDXCCbx6H/A0H9nlJHAZZwQtqvB/BScbLOyUV9d L9Yg== 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 i1-v6si1006533pgt.358.2018.05.10.09.54.48; Thu, 10 May 2018 09:55:02 -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 S966621AbeEJQyV (ORCPT + 99 others); Thu, 10 May 2018 12:54:21 -0400 Received: from foss.arm.com ([217.140.101.70]:58888 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966323AbeEJQyT (ORCPT ); Thu, 10 May 2018 12:54:19 -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 1821D1435; Thu, 10 May 2018 09:54:19 -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 075543F73E; Thu, 10 May 2018 09:54:16 -0700 (PDT) Date: Thu, 10 May 2018 17:54:14 +0100 From: Patrick Bellasi To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Joel Fernandes , Steve Muckle Subject: Re: [PATCH 3/3] sched/fair: schedutil: explicit update only when required Message-ID: <20180510165414.GB30654@e110439-lin> References: <20180510150553.28122-1-patrick.bellasi@arm.com> <20180510150553.28122-4-patrick.bellasi@arm.com> <20180510161515.GH12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180510161515.GH12217@hirez.programming.kicks-ass.net> 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 10-May 18:15, Peter Zijlstra wrote: > On Thu, May 10, 2018 at 04:05:53PM +0100, Patrick Bellasi wrote: > > All the above considered, let's make schedutil updates more explicit in > > fair.c by removing the cfs_rq_util_change() wrapper function in favour > > of the existing cpufreq_update_util() public API. > > This can be done by calling cpufreq_update_util() explicitly in the few > > call sites where it really makes sense and when all the (potentially) > > required cfs_rq's information have been updated. > > Aside from having to redraw my ever stale diagrams _again_ I don't think > I object too much here. As you write tracking the exact point where we > did do the update was fairly tedious. Maybe we can simplify even better these diagrams if we get to the point where schedutil updates are tirggered just from core.c... This patch could be a first step on this directions, not entirely sure we can get there... but, having some well defined callbacks maybe it can make it easier to factorize up the updates in the core scheduler. > > @@ -5397,9 +5366,27 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags) > > update_cfs_group(se); > > } > > > > + /* The task is visible from the root cfs_rq */ > > + if (!se) { > > + unsigned int flags = 0; > > That one shadows the @flags argument. Some checker is bound to complain > about it. Ohps... right... I'll s/flags/sc_flags/ "sc_" standing for SCHED_CPUFREQ_. > > + > > add_nr_running(rq, 1); > > > > + if (p->in_iowait) > > + flags |= SCHED_CPUFREQ_IOWAIT; > > + > > + /* > > + * !last_update_time means we've passed through > > + * migrate_task_rq_fair() indicating we migrated. > > + * > > + * IOW we're enqueueing a task on a new CPU. > > + */ > > + if (!p->se.avg.last_update_time) > > + flags |= SCHED_CPUFREQ_MIGRATION; > > + > > + cpufreq_update_util(rq, flags); > > + } > > + > > hrtick_update(rq); > > } -- #include Patrick Bellasi