Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2182942imm; Thu, 9 Aug 2018 08:36:07 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwX1AyawiTA84D73Ny3a9KXcMuEN22VvhVI3lMhnz+cnb3RxtxzvTI8gm/UhbVBW8Hf59oD X-Received: by 2002:a17:902:7287:: with SMTP id d7-v6mr2521715pll.54.1533828967480; Thu, 09 Aug 2018 08:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533828967; cv=none; d=google.com; s=arc-20160816; b=ZioOjmK8KPB874Sgrs6IDNxOsdCx1ZHLQu23+zTdW6uPm8rJLDD9xiFh+/aJFeEjQI HlbkPFbIsZ6xtRTBlFgeYMwjr0WZ6jCVtccrPMACLpjLM3o2Vu5X2Ozd+Kdw5Po4m30S 7V1yjxGRQhyVqtzZFyKzBeWxI4lZpIoDC8fERpOhgdNQU+R/J0XFWImSxD8cMGRFjVzB 6VqHgQMAiXWh9o+Y9M9rXvYMdlO2mQNLMHVU2BQKIRdZwQJbMMxgpYWGWYkBFWfJZeJZ fEZNwFYWsh4884UDFoCdVUsS2aXed1zs8+HV79jxAxGg3vZIPRBiEVWIP7TNxIUlwzaC ymVQ== 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=FZVWXScVAfDMs1iODhifR/cca5w1hDb1JLgR+ebfmSQ=; b=Vucy3a56Ws+W0QKx30FEIa5k7f4QvhFCUAJzPCHtCfZqsUOpDW2LEeAiGwLXyukMok BVPzSNUK6ka1kQvJaAn2yui4IpNXZWM2jYwSPlb3vkjrZg15YaRe3nhVnIkcU352eMwO lqTvfBnG5mdPaPP/Iap7nkGFg6FgH4j3K96lyA1k4zSrdY/z1JLuVbbSCOZmJ3wvWTdC Hk63SaVPRskmktQVEENHXp/nIeGn/7XBbXGP2KkNNeffJO7up3ZKMGc8FPfTtjTAd1bn Tlt7JY7P0eBqZHMofM7ewEZsPXvUU2hl/KUVrz163evyw35/FPJMEXMv7oIBKhGdnCub sjoQ== 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 f10-v6si6555235pfn.85.2018.08.09.08.35.52; Thu, 09 Aug 2018 08:36: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732374AbeHIR77 (ORCPT + 99 others); Thu, 9 Aug 2018 13:59:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55594 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731112AbeHIR77 (ORCPT ); Thu, 9 Aug 2018 13:59:59 -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 D84D77A9; Thu, 9 Aug 2018 08:34:33 -0700 (PDT) Received: from darkstar (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BFF553F5B3; Thu, 9 Aug 2018 08:34:27 -0700 (PDT) Date: Thu, 9 Aug 2018 16:34:23 +0100 From: Patrick Bellasi To: Juri Lelli Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , 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: <20180809153423.nsoepprhut3dv4u2@darkstar> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-7-patrick.bellasi@arm.com> <20180807132630.GB3062@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180807132630.GB3062@localhost.localdomain> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07-Aug 15:26, Juri Lelli wrote: > Hi, > > On 06/08/18 17:39, Patrick Bellasi wrote: > > [...] > > > @@ -223,13 +224,25 @@ static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu) > > * utilization (PELT windows are synchronized) we can directly add them > > * to obtain the CPU's actual utilization. > > * > > - * CFS utilization can be boosted or capped, depending on utilization > > - * clamp constraints configured for currently RUNNABLE tasks. > > + * CFS and RT utilizations can be boosted or capped, depending on > > + * utilization constraints enforce by currently RUNNABLE tasks. > > + * They are individually clamped to ensure fairness across classes, > > + * meaning that CFS always gets (if possible) the (minimum) required > > + * bandwidth on top of that required by higher priority classes. > > Is this a stale comment written before UCLAMP_SCHED_CLASS was > introduced? It seems to apply to the below if branch only. Yes, you right... I'll update the comment. > > */ > > - util = cpu_util_cfs(rq); > > - if (util) > > - util = uclamp_util(cpu_of(rq), util); > > - util += cpu_util_rt(rq); > > + 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? We had an internal discussion and we found pro/cons for both... but I'm not sure keeping the sched_feat is a good solution on the long run, i.e. mainline merge ;) -- #include Patrick Bellasi