Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3711322ybv; Mon, 10 Feb 2020 05:08:33 -0800 (PST) X-Google-Smtp-Source: APXvYqz5zkGAS31rIzlOhHO9qUdeaVShbwjtayDvVEjLslGAlRFxNGUHDFKwwEO6/+pHP9Y3ysg8 X-Received: by 2002:a9d:6212:: with SMTP id g18mr1038111otj.187.1581340113193; Mon, 10 Feb 2020 05:08:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581340113; cv=none; d=google.com; s=arc-20160816; b=eXk+N8JSbmdd6US3Ug0Gm1bskmXuwW7EJ90iRvjJGbkYNwIE7PKcky+wRDkB/fLgyw GanPQl5SLkTKLlDpkpSVu4pLsb6d8ueldDy7IbaS6qhqVQ+DCbvvJP6p8XK8sNbSkdYK ag/hCsLYxFfQCDf+NSucJFYRXO94mqAVNgbcHEdc9rr/qNiRa16hVs+ABBmoRb+APDqn V3wSkQZ342YYrAo+TCCjpMB8487dgC+3Fllkh7qAnQ+SNJKw/tXDEcQqqqjXO/nMNMfI 2lKsf8QIAVOh4VfP7fu1NwUB9fjn6dzki8AYg5M5VDE57Mvfrv+NXikFX3r+lXSbAji1 p90w== 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; bh=TdcuDpxLgQJeHBcjjVmCcGsEmDfK4lLRpvk8VBOXZEk=; b=Ydyzt0LH9m2UCSO+64jKmk/QgDx8jc8w6O/vHJdRxlMMxx4l5kHrHmyp16+zzPF4hm 7hUlc5Bm2xWbCvgb0AXvn8+y9FL7MdcSG7Z4oc3+e3toDefiaWque1C9jlx15AZexPVI bh+pQClMBuTvyiq7Bvd4M2uqorB7LGqE2W4+Rqd8YZlczhTIjfHCKYYxWTAWr9d066VA 0VmWSxw3g2muNiu8AOi8eh18LvoZ00CZ3IUMR4HcvjeeEA+LziNZhxD9j7onR862wjCq 7n4zRh0iz0yTyRlk1eCQ/WcvNfpdJpXpnltdiwbRXgz5gQPyyQFTECEcy2f/mChklBG6 jWsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Su/gbaRl"; 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 19si144564oiq.128.2020.02.10.05.08.21; Mon, 10 Feb 2020 05:08:33 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Su/gbaRl"; 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 S1729518AbgBJNIN (ORCPT + 99 others); Mon, 10 Feb 2020 08:08:13 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:41776 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729457AbgBJNIM (ORCPT ); Mon, 10 Feb 2020 08:08:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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; bh=TdcuDpxLgQJeHBcjjVmCcGsEmDfK4lLRpvk8VBOXZEk=; b=Su/gbaRlBpenaffOyzKGTCy2Kv U4VhuSMUBuiH5znbE8cOJQiXc7OAauUE3Rr5zDYruT/2zFwUqWw8u8N06QVtl4w+u1uzvUsPrb83e YoMJyArf4azD3c8CyMwK5/ciw1xcEI1wqrDRRWJ1ghDMGFrXoTFVImPDMhyXO2OMJ93EZ1TtXLuzZ B6zyGC0NSxpn8QH/CrgKfXvO9aihTKBAL5brXqHdW8vzr0HZSFqXZsstmks+fnPKx5s/ZmNoaX0ak 9NxODiMBETNDfExlqYLhuSIDGHbL7fqHP2RoIQL1WoJDdoJkcjziR2P0GIStEQf2EjcTYrJp0bn8j V07W3OhA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j18nE-0005je-1z; Mon, 10 Feb 2020 13:08:04 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0B8B2300446; Mon, 10 Feb 2020 14:06:13 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2B97120148931; Mon, 10 Feb 2020 14:08:02 +0100 (CET) Date: Mon, 10 Feb 2020 14:08:02 +0100 From: Peter Zijlstra To: Douglas RAILLARD Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, qperret@google.com, linux-pm@vger.kernel.org Subject: Re: [RFC PATCH v4 4/6] sched/cpufreq: Introduce sugov_cpu_ramp_boost Message-ID: <20200210130802.GG14879@hirez.programming.kicks-ass.net> References: <20200122173538.1142069-1-douglas.raillard@arm.com> <20200122173538.1142069-5-douglas.raillard@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200122173538.1142069-5-douglas.raillard@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 22, 2020 at 05:35:36PM +0000, Douglas RAILLARD wrote: > +static unsigned long sugov_cpu_ramp_boost_update(struct sugov_cpu *sg_cpu) > +{ > + struct rq *rq = cpu_rq(sg_cpu->cpu); > + unsigned long util_est_enqueued; > + unsigned long util_avg; > + unsigned long boost = 0; > + Should we NO-OP this function when !sched_feat(UTIL_EST) ? > + util_est_enqueued = READ_ONCE(rq->cfs.avg.util_est.enqueued); Otherwise you're reading garbage here, no? > + util_avg = READ_ONCE(rq->cfs.avg.util_avg); > + > + /* > + * Boost when util_avg becomes higher than the previous stable > + * knowledge of the enqueued tasks' set util, which is CPU's > + * util_est_enqueued. > + * > + * We try to spot changes in the workload itself, so we want to > + * avoid the noise of tasks being enqueued/dequeued. To do that, > + * we only trigger boosting when the "amount of work" enqueued > + * is stable. > + */ > + if (util_est_enqueued == sg_cpu->util_est_enqueued && > + util_avg >= sg_cpu->util_avg && > + util_avg > util_est_enqueued) > + boost = util_avg - util_est_enqueued; > + > + sg_cpu->util_est_enqueued = util_est_enqueued; > + sg_cpu->util_avg = util_avg; > + WRITE_ONCE(sg_cpu->ramp_boost, boost); > + return boost; > +}