Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp2472176ooa; Thu, 16 Aug 2018 12:19:05 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw8txc2ZLpBdwrZSr88DVJKu+yhSYmXV2BKI225pj245z15sNXgkKLHF+xiPAohujzf3N6d X-Received: by 2002:a63:77ce:: with SMTP id s197-v6mr2439860pgc.172.1534447145564; Thu, 16 Aug 2018 12:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534447145; cv=none; d=google.com; s=arc-20160816; b=oT1sa1yC41ZKSFeoj3FCoVYZxUIHB9ds/fZRc052dm1XmGKxnau9COLFqDp5cLjBMs pH03+/2LYYSb+dnJCfTFi9LKbHD1yk3w3+4HfQATG75jBt1l1qIWgSWJt5RWN+Fb21Wy hUO6ErFCvqqVj1hpx4YPJmiQ8tZQ8VbjV+bFb+byIzFA5bYh/uQGsptOmppxHfh8oBmV 0ZFkthUhIIRdy8X+FZoNzGE1B9edYXrjLjTe90JW1jKU5BbIKNs95QJVX2buK4s6BWdx M1NVDCFrHDjelIiNm8vWyWWkBb/lMgB98fnXCNbSYJtSqZdi1vwINhkAqYetRb7/LucL mfZw== 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=txdWq78QN7npguFMtK1fcipQFTmEodQxCxK4BmZkKIE=; b=NjTnzamhqg70c3VYpR5clt05cOlDWpTxSwMGbeZmxsMyZ49VupDylK9Q40EsBJvSiT 46pkDJfJwxseSSzh59JFmZBLXkCex6cyDlhxfY68VEz+8NlfiaZLmTs7DHGTxY5yd4WT 7iSGMB1cXZL0xSbwCRrBY3ul4njfmNXXoOyH38xCqTjzyC/JzQRL4wyVkb1Lj4aksUh0 f/dIfRGkvrX6GTylMrePq1xBb3GL183fwLaYzuu48Cz6cZTi0ibp4n8cVUURZs+AmBzV S5P6TiZleX0LfgirimEopPNt/pekHgKgBFVnJOa5dGZpGi0yBBG/jVcG8UoCNxk1vo4d TdrQ== 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 h3-v6si113858pgc.122.2018.08.16.12.18.50; Thu, 16 Aug 2018 12:19:05 -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 S2403909AbeHPQjd (ORCPT + 99 others); Thu, 16 Aug 2018 12:39:33 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36910 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729292AbeHPQjc (ORCPT ); Thu, 16 Aug 2018 12:39:32 -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 72A6E80D; Thu, 16 Aug 2018 06:40:51 -0700 (PDT) Received: from e110439-lin (e110439-lin.Emea.Arm.com [10.4.12.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C7B593F5BC; Thu, 16 Aug 2018 06:40:48 -0700 (PDT) Date: Thu, 16 Aug 2018 14:40:46 +0100 From: Patrick Bellasi To: Dietmar Eggemann Cc: Vincent Guittot , Juri Lelli , linux-kernel , linux-pm , Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J. Wysocki" , Viresh Kumar , Paul Turner , Morten Rasmussen , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v3 06/14] sched/cpufreq: uclamp: add utilization clamping for RT tasks Message-ID: <20180816134046.GB2960@e110439-lin> References: <20180806163946.28380-7-patrick.bellasi@arm.com> <20180807132630.GB3062@localhost.localdomain> <20180809153423.nsoepprhut3dv4u2@darkstar> <20180813101221.GA2605@e110439-lin> <20180813124911.GD2605@e110439-lin> <20180813150112.GE2605@e110439-lin> <1b72b94c-5411-4b95-01a6-49ac978acbd5@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1b72b94c-5411-4b95-01a6-49ac978acbd5@arm.com> 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 16-Aug 12:34, Dietmar Eggemann wrote: > On 08/13/2018 05:01 PM, Patrick Bellasi wrote: > >On 13-Aug 16:06, Vincent Guittot wrote: > >>On Mon, 13 Aug 2018 at 14:49, Patrick Bellasi wrote: > >>>On 13-Aug 14:07, Vincent Guittot wrote: > >>>>On Mon, 13 Aug 2018 at 12:12, Patrick Bellasi wrote: > > > >[...] > > > >>>Yes I agree that the current behavior is not completely clean... still > >>>the question is: do you reckon the problem I depicted above, i.e. RT > >>>workloads eclipsing the min_util required by lower priority classes? > >> > >>As said above, I don't think that there is a problem that is specific > >>to cross class scheduling that can't also happen in the same class. > >> > >>Regarding your example: > >>task TA util=40% with uclamp_min 50% > >>task TB util=10% with uclamp_min 0% > >> > >>If TA and TB are cfs, util=50% and it doesn't seem to be a problem > >>whereas TB will steal some bandwidth to TA and delay it (and i even > >>don't speak about the impact of the nice priority of TB) > >>If TA is cfs and TB is rt, Why util=50% is now a problem for TA ? > > > >You right, in the current implementation, where we _do not_ > >distinguish among scheduling classes it's not possible to get a > >reasonable implementation of a per sched class clamping. > > > >>>To a certain extend I see this problem similar to the rt/dl/irq pressure > >>>in defining cpu_capacity, isn't it? > > > >However, I still think that higher priority classes eclipsing the > >clamping of lower priority classes can still be a problem. > > > >In your example above, the main difference between TA and TB being on > >the same class or different classes is that in the second case TB > >is granted to always preempt TA. We can end up with a non boosted RT > >task consuming all the boosted bandwidth required by a CFS task. > > > >This does not happen, apart maybe for the corner case of really > >different nice values, if the tasks are both CFS, since the fair > >scheduler will grant some progress for both of them. > > > >Thus, given the current implementation, I think it makes sense to drop > >the UCLAMP_SCHED_CLASS policy and stick with a more clean and > >consistent design. > > I agree with everything said in this thread so far. Cool! > So in case you skip UCLAMP_SCHED_CLASS [(B) combine the clamped > utilizations] in v4, you will only provide [A) clamp the combined > utilization]? Right... unless I find time to add support to per scheduling class tracking of clamps values. It should be relatively simple... but I guess it's also something we can keep as a really low prio and propose it once the main bits are not controversial anymore. > I assume that we don't have to guard the util clamping for rt tasks behind a > disabled by default sched feature because all runnable rt tasks will have > util_min = SCHED_CAPACITY_SCALE by default? So, that's what Quentin also proposed in a previous discussion: https://lore.kernel.org/lkml/20180809155551.bp46sixk4u3ilcnh@queper01-lin/ but yes, you're right: it's in my todo list to ensure that by default RT tasks get a task-specific util_min set SCHED_CAPACITY_SCALE. > >I'll then see if it makes sense to add a dedicated patch on top of the > >series to add a proper per-class clamp tracking. > > I assume if you introduce this per-class clamping you will switch to use the > UCLAMP_SCHED_CLASS approach? Likely... but at that point we probably don't need the sched feature anymore and it could be just the default and unique aggregation policy. But let see when we will have the patches... and we don't necessarily need them for v4. Best, Patrick -- #include Patrick Bellasi