Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2940648imm; Mon, 13 Aug 2018 03:16:13 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyLQme4sD1OulFV6quN01eVEnNHFS3Z6nTygdKpieE8iz9ZjDVMrc4hGzSYGCebIIe9AJ0I X-Received: by 2002:a63:ab0c:: with SMTP id p12-v6mr16284851pgf.190.1534155373257; Mon, 13 Aug 2018 03:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534155373; cv=none; d=google.com; s=arc-20160816; b=WR0LzriX1LUKB+4Ef3C3PpPzWRMPh6tmASLzvvMo8/YogJPb1Uwqm4HGQJJAtkiEHQ A+I+0VufjmDTuj24EBGm8IoPHXJrAeSp5vbuDomBggvWXsmR4ETDIEkfdWxBCVkv9iXR l4UqAJ4gcBs+stbUBVOkgxwbORsEcnMZ/A5IIGpXocSsD/TCDyUr/Kx2DrsYgtGHGOO1 T1DkW3r3MPqwRXFqaXrFIlkqS/08j4kRaYZNLYEAshpN0lFRABnSuqTDBqLL/KNCeMa4 TnXPSoUMixGG5WwmDDghhPFXc0qNGYYUiA8SH7/NZkIlGHFjEEVVZFjfcUo8DtWzi6/j xw1g== 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=Z1ATB9d8S5G1WULh97Zi1uPEO0gziKlEKqXsMKi+xkk=; b=vW7zo16BjhvVc7Y4S3Emvpmy3f3JDS2Glo0v/jiAT4FvfaK1Q8seHeO2yv1Cy7SgTa D86VUGki5SbsQuTA5nIJDMGZ0aeDhWMMSAK7+sfmoH3hXdfqiphbpQ2Po9OHw0MNxDXJ dzr37B7dhiJx6TsLUUv9UhBcJZuWsiVK4rV6vA2dYBFm0NgvK7/JkqfCB8bsRlYggFC/ 2XaSkc7YRIgD0aK1IHrEiJSsneA/7LcokVJilln7O5wlqk6x64uo8p84UwFI/0uGAegq 6+ue23djkHRjUymo9uFmTtMMVfe5nveEq/7e49D4+1fmtA+Hi0mGb9f8tyZ3Syg39rDy RMNg== 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 u4-v6si17032599pgm.454.2018.08.13.03.15.58; Mon, 13 Aug 2018 03:16:13 -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 S1729007AbeHMMyF (ORCPT + 99 others); Mon, 13 Aug 2018 08:54:05 -0400 Received: from foss.arm.com ([217.140.101.70]:56458 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728055AbeHMMyF (ORCPT ); Mon, 13 Aug 2018 08:54:05 -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 97F417A9; Mon, 13 Aug 2018 03:12:30 -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 ED3363F5D0; Mon, 13 Aug 2018 03:12:27 -0700 (PDT) Date: Mon, 13 Aug 2018 11:12:21 +0100 From: Patrick Bellasi To: Vincent Guittot Cc: Juri Lelli , 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: <20180813101221.GA2605@e110439-lin> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-7-patrick.bellasi@arm.com> <20180807132630.GB3062@localhost.localdomain> <20180809153423.nsoepprhut3dv4u2@darkstar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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. > > We had an internal discussion and we found pro/cons for both... but The UCLAMP_SCHED_CLASS policy is thus less energy efficiency but it should grant a better "isolation" in terms of what is the expected speed-up a task will get at run-time, independently from higher priority classes. Does that make sense? > > I'm not sure keeping the sched_feat is a good solution on the long > > run, i.e. mainline merge ;) This problem still stands... -- #include Patrick Bellasi