Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2213666imm; Thu, 9 Aug 2018 09:05:30 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxv76I0yqv8t6WliQ1eXpybKJ+GiPhvREZlfZdXaob+1Y0Y78xmwMRRVEIFFUkO+/DGWa1E X-Received: by 2002:aa7:818f:: with SMTP id g15-v6mr2954264pfi.71.1533830730147; Thu, 09 Aug 2018 09:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533830730; cv=none; d=google.com; s=arc-20160816; b=mRRGMDbB++xKpu23BKTboA6T0XkjxA6Aqro0fcd9FVBr1tYrIiTMoYS8WrZU3bVlAt duZ4/+MMvlmCuXXGcu0C9rb9RcM8U8+EgzmZGCHb+/ILF8GC7HtGX6CUyc2rTDrlyfqi yT6xEVRL9UxeHtfnFgEi469yeaii8VCYPWfDZ3JthEwCcMWok2hb1az7wdli2f4RqJsk 05zY1/6Zciq+6JyGhWU+aVNERXszBxlmtQGt37lFnp4cmMLqatruqj+6YPTygGlPCvWh iNM/wuKhJq8qnCzuYe/r8nDKq0XdQZEDwNO95VjD47GNd1868kpyE2LlDm3VbWNjTmxO XqoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=45R2rVVQ7AyLO7hHrHWF/TuxLcpzTR3BLt2OR6mR/cc=; b=BkH9rn8a6/jOjNH9soJJoedO5t46v9YOih2+E2aq8Hp6NVPRLFqKDe17lNv1wKzsRd A45Vu6I1XzcGUU6wRTCHdG6PToWwL0rN/hvoI6djcu6bY8WxNNHzY+0zW8R4/i+NqhC5 NRU575ISJIOoNiYb6drU9/lZR6iam4nOFSjToX0izjINbJX1TFMB1Uf5lqq82/RMNovz xEJqnCVX4clNQhQSbREgBGqrcepxAkPG1tPQLWnHxViaVI5CtmqQ+z9tgcSJw62tDxMg W3wVhlXgDUCcu8jZFFzEusi4zwfgcYXjEbkgbTIjDE3o3OGYFQdPhGTEt7abSl9dzfhL PVrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PiKikA/u"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j184-v6si7479592pge.607.2018.08.09.09.05.12; Thu, 09 Aug 2018 09:05:30 -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; dkim=pass header.i=@linaro.org header.s=google header.b="PiKikA/u"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732163AbeHIS3m (ORCPT + 99 others); Thu, 9 Aug 2018 14:29:42 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:52130 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730634AbeHIS3m (ORCPT ); Thu, 9 Aug 2018 14:29:42 -0400 Received: by mail-it0-f65.google.com with SMTP id e14-v6so966531itf.1 for ; Thu, 09 Aug 2018 09:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=45R2rVVQ7AyLO7hHrHWF/TuxLcpzTR3BLt2OR6mR/cc=; b=PiKikA/uVsQo7wLMJKN6X3vPzXEwAYjTVVBGeMiX72PqcakiDaJHbPu1A4GyF/LsP/ waLHXJzI2NzunhEaRdHlhRTTC8KS5DIA+bMP3CVWnpVfBM8CbCrKookH9w61qLvwdwWv fqKQLpnfvBT8tztr7Llr5kpxRFcgH1foW2qlM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=45R2rVVQ7AyLO7hHrHWF/TuxLcpzTR3BLt2OR6mR/cc=; b=te+j+HTVHJNg547J4+BUY3XSuQvA9L2Y9JnUHHJdIWvS8irqdIroRb7upV9GIY+dW5 V3GUQFLfHGSl5OCp5rKF1bgn2NZv7jm7+5vOi+tG4LPVuWt3gHwH9q7GJgh6TxgORQqR KjhNFe2tWS04yR9SpzSPU1vTuX70dIXcBJ7rAgrAb2Iybwe0HoZtmv9k8w4btYQDfvev /0I3P+v88CHqvHdewsqWhE2+oJ19ryK87SQGM1yKM80Khv0JZJyQkPN5v9ATJbzVe5vx JEOj3YKdDVT5P3ZaFMYVsCvckzV2CMvCFLEHKQRR10JprULYU3xiz0p/Mhw5Qa3LY3aG N50w== X-Gm-Message-State: AOUpUlHrso4Zxm28+mfsPbJUpXtoL27bTRWhEjsBGMx3PXpkAhbC26DX 00xtLMLRDLOdncexoR6gZseIbu2Qzz6M/k15qIwBvxdEd34= X-Received: by 2002:a24:55cd:: with SMTP id e196-v6mr2374747itb.8.1533830648447; Thu, 09 Aug 2018 09:04:08 -0700 (PDT) MIME-Version: 1.0 References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-7-patrick.bellasi@arm.com> <20180807132630.GB3062@localhost.localdomain> <20180809153423.nsoepprhut3dv4u2@darkstar> In-Reply-To: <20180809153423.nsoepprhut3dv4u2@darkstar> From: Vincent Guittot Date: Thu, 9 Aug 2018 18:03:57 +0200 Message-ID: Subject: Re: [PATCH v3 06/14] sched/cpufreq: uclamp: add utilization clamping for RT tasks To: Patrick Bellasi 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Patrick, On Thu, 9 Aug 2018 at 17:34, Patrick Bellasi wrote: > > 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? 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() > > 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