Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4819576imm; Tue, 7 Aug 2018 07:54:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdjXQVfzU352u3vfUPWsWDoznyt0253/ZrAstq0+gilfQpB9+lQgUK+VhZmsXnlySIEcAU4 X-Received: by 2002:a63:2906:: with SMTP id p6-v6mr19618940pgp.204.1533653655662; Tue, 07 Aug 2018 07:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533653655; cv=none; d=google.com; s=arc-20160816; b=CqSSftz/QLaYYNaE+bZEYwo+ufJPTcWh1g+OAFVBm7Wk4o8KmS1QCzA12TjVqcQMEu Sgxx8AZp0LB3hvPpLWayQseeU92pzJV4rxkVdx6QHTOq05nmm+oVqqd0IeT29QdS+g2q +GrNajYzzNpklfSNAx+CFe2unO7Tesz4J5Vd3CizpBBJ/AfUHKIhS1FkyxWYnvxm4ixX fiuGkFcTbRn5d7S9YYMMrH/ITrF++JVlR6Lcdtsg5lW7yOY+qy9aFPQHbim0MHKDoxmR TRWm4gpxYdTfpnIjhfX/WvEYIXFrEHo5ikI25iC17QXuNSJPIPxtYVPpXFU+o7owFvav iSMA== 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=uEPiQtdPS0U88+B+mGvXuHnVlXEbwn22EegVG1v9c48=; b=wybnwBL9CJ5snH624Luc80fsUgNrRTbecyYvVMX6eflDx4qPJVXBvA+OhiMfcsgXV8 xIEEOVu0LU/Ee2yhWqVssEd6ZnurcbjWNhqySaznYQVVkImVPY7RwGAxYEfWoFFAJ7xv BzDu7zzbwplctFDygIanaiswbMxOlwFpT4u/H0gwfZ2QivHSIp5o9jPgCwV0tRhn4VEo QuWjK1AvHRrJs7w3neLwCtQWNRCURZtZ9IBcY9ahlO3+EuhTDsIJllG3T94GZTcb4sfL WDAeRoj5NOu980ZAsCVKP1IDy01vLMGzvOro13OBaPistCSCbqeZVRjdelqdz5uU0ed/ CKIQ== 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 e185-v6si1546368pgc.318.2018.08.07.07.54.01; Tue, 07 Aug 2018 07:54:15 -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 S2389179AbeHGPk6 (ORCPT + 99 others); Tue, 7 Aug 2018 11:40:58 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:56105 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388581AbeHGPk6 (ORCPT ); Tue, 7 Aug 2018 11:40:58 -0400 Received: by mail-wm0-f65.google.com with SMTP id f21-v6so17430541wmc.5 for ; Tue, 07 Aug 2018 06:26:37 -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=uEPiQtdPS0U88+B+mGvXuHnVlXEbwn22EegVG1v9c48=; b=o0E9PGfPG/DK2FgYLIkm5PYDEfdtjAiH01Kr5zCUBh2Ypk3nime/hOvIiXBP0wR7uf uk06qEmt+BQDLR0uaOUdhIQBRQu0qZ04PIapHiG332g4UTZ+CEdi6Jok3m33zfUP4q5d Auk/mPsm+MObj0+3GkU8C537dY2riNll0LHFZOCnheicx7vzABWmHIX5U2CBdt1sRllY VjNaRaX/3qhg5VxN8Rc8jLmHmdwTRiaaYva+QOd47um1ZIGtiG8q3Yn6R7d52U4Ak0fR SMzISo12NbOZ/5Je+RbI35fMvtj3PiafIErh+STEve8Mv3rqMB2Ki4TBNVOgfevx9z8T xrHg== X-Gm-Message-State: AOUpUlHoRS5LT5qiChyVCyO9wGtQzNzBJLhN5UguglNplnunFGlgFoqt WLX0pnmRNXguMx7ly8FjWXlUhg== X-Received: by 2002:a1c:f306:: with SMTP id q6-v6mr1695061wmq.111.1533648396803; Tue, 07 Aug 2018 06:26:36 -0700 (PDT) Received: from localhost.localdomain (p200300EF2BD31703FE367972448AED7A.dip0.t-ipconnect.de. [2003:ef:2bd3:1703:fe36:7972:448a:ed7a]) by smtp.gmail.com with ESMTPSA id e141-v6sm2719950wmd.32.2018.08.07.06.26.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Aug 2018 06:26:33 -0700 (PDT) Date: Tue, 7 Aug 2018 15:26:30 +0200 From: Juri Lelli To: Patrick Bellasi 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: <20180807132630.GB3062@localhost.localdomain> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-7-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806163946.28380-7-patrick.bellasi@arm.com> 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 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. > */ > - 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); > + } Best, - Juri