Received: by 10.192.165.148 with SMTP id m20csp1346829imm; Thu, 10 May 2018 09:16:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpxfba4rRiRC4Wm3h5Gq2VNTm62kYvc8CwUnWaxw+wH5RGDWXH0pYyMkrNqDzbEBrDKzuBW X-Received: by 2002:a65:4601:: with SMTP id v1-v6mr1614794pgq.237.1525969014393; Thu, 10 May 2018 09:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525969014; cv=none; d=google.com; s=arc-20160816; b=DYkUP6k4m3O9GXcfKxkUfiJAgYP3A6NT9zk4G7U45RKJevNneQUInFbMmyhs1iJK2W V0uJBUbp3vAqzZUB9iWh3WItkWRQZsDxMrM//mg3CBhZRpBTheA3Wc+Aj0/9sbDfwsY/ KxCL9hmtMHm+pDEkSEuJFefoaakBcmqENpAlvltXea01WB0K1USHuQtuHwyhu15VHjRk ZD8ZcGTMjO14W2mMHNRmr/ZddCpgxCaUVSiy9TUwvjyYfF/YnFqewM2dWORd0uFAp7yy udfuA4aeyctc9YL+7iPljEAHbKAQpRYNRp5p8Xix5/CMgyFx0uVeTzuDWezH6tbgAkg7 VNOg== 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:dkim-signature:arc-authentication-results; bh=Al5UqrEUnU9fw//IPQcEoLthhkUQILPkHGLexG0fDkY=; b=bgV8SI+1rpONeJHysfJBNp5DMX/zx5zcgR62iUEHPkLAN7bPcPuxgKNezRfWFQA1n2 bLyoSb8gNd6HL7+6FgWbvj0oEGBiiqj37D/KJM7JDZ/V+uvS9hb9kiPPK4W7LMsWTtM4 qH3cZK1OuDG6YZdmbTo53/ON0Of8MwH+M4drTWgmQ0b9dFnCsM0XDx0k3CpKlxL+SAE5 TuomTcETGrvhvzQwLq9fI+i40ipxPacFTOVAnihIaIKAz8+oGDAtrAeO3YSIaDwOcW8J vi4xp2UU1vkV8vM80qWCkXdHgzJ37Yh2HqwFjJj4cpdce4hOjwTs311ZeBZEw5ZafU/t 2Zvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bmE2oQZe; 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 30-v6si1158099plf.104.2018.05.10.09.16.39; Thu, 10 May 2018 09:16:54 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bmE2oQZe; 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 S966594AbeEJQPb (ORCPT + 99 others); Thu, 10 May 2018 12:15:31 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45292 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964881AbeEJQPa (ORCPT ); Thu, 10 May 2018 12:15:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Al5UqrEUnU9fw//IPQcEoLthhkUQILPkHGLexG0fDkY=; b=bmE2oQZeL5pWD/4sKYf5lujX5 2a+CW8BaFEs443ymqa7wIaKuU+F9ImYfvHPbpW/yy9XHlW07VOvK0I3R9EsRsJWSnUJCTiiNkPqwO dipKlI99y5PL6dsd8/XjAqtnLK/3oAQRZTh6z+y4JF0ylmsDF2R+B8SAtXNhi7wYCFAoOtk9r3WaA JhcWXWUGwZnhEBT4FSV3iXLoDvzWnL9RA+XKA2GjNb1yikkec5gWFui1+yi0s7Wflt4zZhaxO4sLi MOI6bmoS/dmULCjhtM9McGk6PUrpm4TWzg9YS0BFbysQk42uXkLoQvEIBzQKQAWtppGiYMj9loN9x kYdepiwHQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGoDu-0001PZ-Us; Thu, 10 May 2018 16:15:19 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DE5F72029FA13; Thu, 10 May 2018 18:15:15 +0200 (CEST) Date: Thu, 10 May 2018 18:15:15 +0200 From: Peter Zijlstra To: Patrick Bellasi 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: <20180510161515.GH12217@hirez.programming.kicks-ass.net> References: <20180510150553.28122-1-patrick.bellasi@arm.com> <20180510150553.28122-4-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180510150553.28122-4-patrick.bellasi@arm.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > @@ -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. > + > 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); > }