Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1737656imm; Sun, 15 Jul 2018 15:47:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcE4sVJ5KMeOVYsW23Cjy2l0LzovIv2n9HgBXtyylIMtA3oK8K3NY2QJUai4jBFawwlQnFN X-Received: by 2002:a65:560a:: with SMTP id l10-v6mr13780010pgs.130.1531694866216; Sun, 15 Jul 2018 15:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531694866; cv=none; d=google.com; s=arc-20160816; b=a19FzuZhJN7qprw8xRKtCDbwK98KBY6JHLdbUuT/2chvWqbQt/YkJQZ3FqWiigXqtU OU0ShTAuru62mKWKo60hsnhe6OpxicbbP3bax8QlnkQosPMBwKh04vNSYRifmTlRo8t2 KOHEnoHtT3fWGScqinNq5gJzocpqkauaATwyM0X2E33E4MZrHL+qJwSWrvTiR61jptuf Yl+xGEUHqgnaTitiqByIN1cwCyLflrvFawfHE7X43peeythdCBfysVTinWLxEhBDPmOr FaBxmhfh7E/C9TJWH1szSne5z7XgCFm3DczyPYCW/l53F/wZBza4EvvuGGkH4BgLzKiT KAuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=4vvGIP5wL7M+RiMdp+dSyygSEtseFRI2rQGFLq9m2SM=; b=J5jy2l4UCm3oGVXnl56Qorn3QDxvhmGp0PMkAYbcG4RrvqAcmRQSza88h4evkESrpc Ri5BqSEBK/eByZV5HyDLGPZcB6FAQOfNJ3X0rszlfu8swUz1YhIphvRSUc1HneOl7X+J rBx8vcwH1jYxnI9iPkL/GZ5nX7/LbHhpxI8rQEX02Dn/9iChPUWAAw8SSWiZF23050i8 351CzaXWZokwA+FdiD/G+SxuAkmQJy0a2bchz0IgqfuvihdMfj1BSMfRJDJKRZ7uxTd8 aRC1XfAuOTH3IDYnXXQ0czZDfmUdOBXShvWLDnk2c41l5A+Zj/rOnTQ9d50soRUgo1Fs jxzg== 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 68-v6si8432818pga.113.2018.07.15.15.47.29; Sun, 15 Jul 2018 15:47:46 -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 S1727193AbeGOXLX (ORCPT + 99 others); Sun, 15 Jul 2018 19:11:23 -0400 Received: from smtprelay0040.hostedemail.com ([216.40.44.40]:41051 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727046AbeGOXLX (ORCPT ); Sun, 15 Jul 2018 19:11:23 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id D00981801EDC9; Sun, 15 Jul 2018 22:46:54 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:2904:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:3872:3874:4250:4321:4385:4470:5007:6119:6742:7808:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12295:12296:12438:12740:12760:12895:13069:13311:13357:13439:14040:14181:14659:14721:14819:21080:21450:21451:21627:30054:30070:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: able94_7635239b43705 X-Filterd-Recvd-Size: 3072 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA; Sun, 15 Jul 2018 22:46:52 +0000 (UTC) Message-ID: <1db704b2e118b91c05ff37cd74c9adb818a4d033.camel@perches.com> Subject: Re: [PATCH 09/11] sched: use pelt for scale_rt_capacity() From: Joe Perches To: Ingo Molnar , Vincent Guittot Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, rjw@rjwysocki.net, juri.lelli@redhat.com, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com, patrick.bellasi@arm.com, joel@joelfernandes.org, daniel.lezcano@linaro.org, quentin.perret@arm.com, luca.abeni@santannapisa.it, claudio@evidence.eu.com, Ingo Molnar Date: Sun, 15 Jul 2018 15:46:49 -0700 In-Reply-To: <20180715221538.GA23280@gmail.com> References: <1530200714-4504-1-git-send-email-vincent.guittot@linaro.org> <1530200714-4504-10-git-send-email-vincent.guittot@linaro.org> <20180715221538.GA23280@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-07-16 at 00:15 +0200, Ingo Molnar wrote: > * Vincent Guittot wrote: > > > The utilization of the CPU by rt, dl and interrupts are now tracked with > > PELT so we can use these metrics instead of rt_avg to evaluate the remaining > > capacity available for cfs class. > > > > scale_rt_capacity() behavior has been changed and now returns the remaining > > capacity available for cfs instead of a scaling factor because rt, dl and > > interrupt provide now absolute utilization value. > > > > The same formula as schedutil is used: > > irq util_avg + (1 - irq util_avg / max capacity ) * /Sum rq util_avg > > but the implementation is different because it doesn't return the same value > > and doesn't benefit of the same optimization [] > I have applied the delta fix below for simplicity, but what we really want is a > cleanup of that function to eliminate the #ifdefs. One solution would be to factor > out the 'irq' utilization value into a helper inline, and double check that if the > configs are off the compiler does the right thing and eliminates this identity > transformation for the irq==0 case: [] > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c [] > @@ -7550,7 +7550,10 @@ static unsigned long scale_rt_capacity(int cpu) > { > struct rq *rq = cpu_rq(cpu); > unsigned long max = arch_scale_cpu_capacity(NULL, cpu); > - unsigned long used, irq, free; > + unsigned long used, free; > +#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) > + unsigned long irq; > +#endif > > #if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) Perhaps combine these two #if defined blocks into a single block > irq = READ_ONCE(rq->avg_irq.util_avg);