Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2970664imm; Mon, 13 Aug 2018 03:52:07 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx/rSxxXiXmJpYhW41sZupmawCwEiLEkqIOtC79DfDEkbUMnDPE4KjuI66/q+YkMVkhFjwA X-Received: by 2002:a17:902:1a2:: with SMTP id b31-v6mr15833752plb.279.1534157527047; Mon, 13 Aug 2018 03:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534157527; cv=none; d=google.com; s=arc-20160816; b=KCm/O7Jea1qoTe0zTqbRVgDuPj2W6US9wwetoXFiPvj6l3VU9KowjDb2OKlBFP7Woz 4VBkISdCVVShQnXpsmHZe+3176aEvqo5/NRRvSLcKwkQ4zN0LRTEKU9I/X3GvFLztqL7 FT+vwyw6GvEazDRphgMQ0ogNQthyy0E/UI7uofv2xU9+Ye36jj7GjtZsOfDDfCtxdvgl 4sAbjWImJG+YzgJd8+Lg0LsOxDWe/6XhUAZFH5dnCqk9rgs9f+uYkcNUyxOCxgahFRfC G+yOjKv/xUU3SEPf79S6p9Lf61mhh55Fx5pGuWf2yQlSXOzKdoiYuNR4EhVAEaNXshAU AWEg== 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=NkwmbVxmW5qQWHBsMIOCMC0MbVCk9XiGiMhn1RNYRzg=; b=AiQoxkIQJ5uePwmLbVMWJ0kAxcjXtxb+iXJXbN9zBHNJigrAy0iFB4mymE2P4s9/Oe h0+7PtQXbyC9rEehZRiYQiDDAaqfuP6ArDjvRKBKJMlBrCBJ53lWMiVUUu45pqdJdlqA gpsm8iHHyvD2Em/xQeMC26brexR7HUUD686FA5ySncmN7TAL3tF7Y0im1V9a0pnPLSRm y2ke4BVaiq75zSv/KYhdseirUPKUQfCh4VSZp3CNqxUnFC21ynK2U/AroA4mUO/ZIjtw xIuO5AvVm3VecwKZ8Ns0Chkg6koIl0sHUcT7NzhD9+jRPHz6b2GJ8Wpcdci873r2kxto +AqQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m124-v6si18925577pfm.303.2018.08.13.03.51.52; Mon, 13 Aug 2018 03:52:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729091AbeHMNcY (ORCPT + 99 others); Mon, 13 Aug 2018 09:32:24 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:34778 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728338AbeHMNcY (ORCPT ); Mon, 13 Aug 2018 09:32:24 -0400 Received: by mail-wm0-f54.google.com with SMTP id l2-v6so7319120wme.1 for ; Mon, 13 Aug 2018 03:50:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NkwmbVxmW5qQWHBsMIOCMC0MbVCk9XiGiMhn1RNYRzg=; b=Wb8YvajdH89OUN5BQeY1HwBEtNnnhWlzasIohdBJzsleUKx7Wp53+sRa99x1mIRk8j YkXMOFqflW8m2CEKJ2Za+Zd4ue31B6MyhzWq6MRX2E9qls9qK7G8oAjHVo4DDC9TRmeE mwFska7mkkwy0LyfPrJDA8AwRwZ8cR2YIY+lC7PpnHTnFFEUe6Ai4mVeNl5hwxA/ikR9 WmgOTNMI+nukuT3hub15loq5HZnXRgtXUtv1ta8Tagi2frb5bAIOfEtjFEm1dWkUjow5 23/WUYdQpqjuESbjHRjv+0U8gXsRX8uhxrHT1rNjLBW78zH43kxmT7azxXN7Rxtj/LEt D6ZA== X-Gm-Message-State: AOUpUlGwyIRr5JgxFSpoQUwqyQqDJBcVcgIK35hgAuS0L+ISYHlbRIj7 xMf7xoj6Nw7/P/oHlTsqCrziTw== X-Received: by 2002:a1c:dc41:: with SMTP id t62-v6mr1417946wmg.137.1534157439330; Mon, 13 Aug 2018 03:50:39 -0700 (PDT) Received: from localhost.localdomain (p200300EF2BCE7D88DAEEE59932720558.dip0.t-ipconnect.de. [2003:ef:2bce:7d88:daee:e599:3272:558]) by smtp.gmail.com with ESMTPSA id r12-v6sm6061267wmc.27.2018.08.13.03.50.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Aug 2018 03:50:38 -0700 (PDT) Date: Mon, 13 Aug 2018 12:50:34 +0200 From: Juri Lelli To: Patrick Bellasi Cc: Vincent Guittot , linux-kernel , "open list:THERMAL" , Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J. Wysocki" , viresh kumar , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Todd Kjos , Joel Fernandes , "Cc: Steve Muckle" , surenb@google.com Subject: Re: [PATCH v3 06/14] sched/cpufreq: uclamp: add utilization clamping for RT tasks Message-ID: <20180813105034.GB9851@localhost.localdomain> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-7-patrick.bellasi@arm.com> <20180807132630.GB3062@localhost.localdomain> <20180809153423.nsoepprhut3dv4u2@darkstar> <20180813101221.GA2605@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180813101221.GA2605@e110439-lin> 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 13/08/18 11:12, Patrick Bellasi wrote: > Hi Vincent! > > On 09-Aug 18:03, Vincent Guittot wrote: > > > On 07-Aug 15:26, Juri Lelli wrote: > > [...] > > > > > > + util_cfs = cpu_util_cfs(rq); > > > > > + util_rt = cpu_util_rt(rq); > > > > > + if (sched_feat(UCLAMP_SCHED_CLASS)) { > > > > > + util = 0; > > > > > + if (util_cfs) > > > > > + util += uclamp_util(cpu_of(rq), util_cfs); > > > > > + if (util_rt) > > > > > + util += uclamp_util(cpu_of(rq), util_rt); > > > > > + } else { > > > > > + util = cpu_util_cfs(rq); > > > > > + util += cpu_util_rt(rq); > > > > > + util = uclamp_util(cpu_of(rq), util); > > > > > + } > > > > > > Regarding the two policies, do you have any comment? > > > > Does the policy for (sched_feat(UCLAMP_SCHED_CLASS)== true) really > > make sense as it is ? > > I mean, uclamp_util doesn't make any difference between rt and cfs > > tasks when clamping the utilization so why should be add twice the > > returned value ? > > IMHO, this policy would make sense if there were something like > > uclamp_util_rt() and a uclamp_util_cfs() > > The idea for the UCLAMP_SCHED_CLASS policy is to improve fairness on > low-priority classese, especially when we have high RT utilization. > > Let say we have: > > util_rt = 40%, util_min=0% > util_cfs = 10%, util_min=50% > > the two policies will select: > > UCLAMP_SCHED_CLASS: util = uclamp(40) + uclamp(10) = 50 + 50 = 100% > !UCLAMP_SCHED_CLASS: util = uclamp(40 + 10) = uclmp(50) = 50% > > Which means that, despite the CPU's util_min will be set to 50% when > CFS is running, these tasks will have almost no boost at all, since > their bandwidth margin is eclipsed by RT tasks. Ah, right. But isn't possible to distinguish between classes? I mean, if you would know that only CFS is clamped (boosted) in this case, you could have: util = util_rt + uclamp(util_cfs) = 40 + 50 = 90% Which should do what one expects w/o energy side effects?