Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp376775ybc; Tue, 19 Nov 2019 02:54:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxhcy0P+UhaOIUiKrHz+2VBWhtAFSn/6YpiWpIxq17Rw2k0rcWZudvxXtJnpZx6+XoZgaJG X-Received: by 2002:a17:906:1d59:: with SMTP id o25mr33886409ejh.17.1574160857484; Tue, 19 Nov 2019 02:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574160857; cv=none; d=google.com; s=arc-20160816; b=sodVxVVxjhPP6ExJIoWmdhE7oRDyiAPACrSxuLDcR1Hc9cQ8LLpIYmeZSGjY6nsTDS EDoI3GrbxmYcj9QqtNlx7Mw6Ydo2hDlcVFBURnh9dZB+lD1u6p82H0gexrY5J3u3qrCx 26LTem6BtKBn8U4xZYnVsYUY3LECSL/i8hVLb0Gh0K7ZMd90Hut1QTQpWj1npY87RM42 oHA5ffdgZzgKBW2kNjwHjTJXvqgNX16x3Cycd9dNw1KlQk+mTI6jLR9+gGhCwfN9Hztj Uk4YvZ0b8slL9YDCkNLXe5yv4Vm+fvH975TUo3veLQE7tnDQyahGpXwsaprJdNrrV9aC UAVw== 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; bh=YzykAgzqBASxD+Sf3WzDkQESPdZCVRtMU0601lbZ+QA=; b=B7RJRgvqlYMXIXbE71hwOcKIfpA9pGpqME9/qx7OhMfgLJrsnDDGZkYFGOfy2BlCkU hQAH5hC5VRGifE8Va+VjpkrJ+r9SLz07inxAo1Hcl5QmdkiiO4WrU2Q2NA0Tk4tvF5Zc /vUFdrlUQyy9s/ER/CR52Snx+Eg2msrdsiMwSRmZrbTcFH86kpreIgQLj745PhwaM69g UOx9ResRDwexkNutCCAlMBPgF8115LwF2coJv7tn2lOi467kce93HWMLZcdSwPZptlJj 6G22veaaoY3sxXajwCXKxkI3sKBMLTfKR4nd4qZLiRrYAlW0EH3bedHWdR5Z6Lrll5WD vmug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=fK8robB6; 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 cx17si12698237ejb.421.2019.11.19.02.53.53; Tue, 19 Nov 2019 02:54:17 -0800 (PST) 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=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=fK8robB6; 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 S1727716AbfKSKwB (ORCPT + 99 others); Tue, 19 Nov 2019 05:52:01 -0500 Received: from mail-vs1-f68.google.com ([209.85.217.68]:44921 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbfKSKwB (ORCPT ); Tue, 19 Nov 2019 05:52:01 -0500 Received: by mail-vs1-f68.google.com with SMTP id j85so13861104vsd.11 for ; Tue, 19 Nov 2019 02:52:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YzykAgzqBASxD+Sf3WzDkQESPdZCVRtMU0601lbZ+QA=; b=fK8robB6LDhqEsKEVJTuYw4VxW5gVbD04EykOxsoQeWS2+pZG42RtxQpE86dNn0lF5 txSCEEd0BoMaBpM8BbQSay80/bW2VGVK1GVlJ8VCDZFWnI7VKnlznB48f7oeYkgX7qx6 RrI7svDsdDbRY0k44Hf8Co5JNBj3v75ZcrLXTge66yU+SpFBBDuhiD6Kv1NMJ7GuJqs8 C90yf3uFMXyBI7+2iOdD5al/4geQu+U818P64lUV3Ozr/nLBqKGZfpMAeKHapUprny3x XVI7qCHVVB3RCqcfBHPEILJ+IBd3Tt6Ekn+Du0aIp9sCen5AEsUd4wY7sIPGbb+fOoFb CNMA== 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=YzykAgzqBASxD+Sf3WzDkQESPdZCVRtMU0601lbZ+QA=; b=drLMZQ913e6IFpsA3qJWaOHFh6ALwMGzmdAq6ll/wbcYH9z0bfnDa30rHlzkpOZLzx lILSNL1ysyd6Rfe3KbVIEKuNXSGWQlpJ6BduspQpJpq/Mydvicq85bEwjqO5KOHb359b bjKPHgtH9y3Jx/8oJiJl6N+pjdX+8ahd2NfJjVRaTo3l3DDWN/DsLCHSIYPu8qBZ3kw8 b9qkN2EjjGtRHbiMRERtJtwe4cvK737jgJT5Q5i6SeOLrVtMs+jS/khm9AZmfQQLfMFz rgHr2C0rWtytC/aPxSxClz/NivY19WISWraAKfuiIotNdVCaDNBQ3U37Y80XFBDFXK53 6Icg== X-Gm-Message-State: APjAAAWsYIA7bRfHmTqIrBr5pjLk22juNmlNH2YtlBl2+fGfpZk3gAI4 9cNrtnNN7k+A0mWnf9Nn7vLHaa7umW6+HJYh679RXw== X-Received: by 2002:a67:eb91:: with SMTP id e17mr20497351vso.95.1574160720519; Tue, 19 Nov 2019 02:52:00 -0800 (PST) MIME-Version: 1.0 References: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> <1572979786-20361-5-git-send-email-thara.gopinath@linaro.org> In-Reply-To: <1572979786-20361-5-git-send-email-thara.gopinath@linaro.org> From: Amit Kucheria Date: Tue, 19 Nov 2019 16:21:49 +0530 Message-ID: Subject: Re: [Patch v5 4/6] sched/fair: update cpu_capcity to reflect thermal pressure To: Thara Gopinath Cc: Ingo Molnar , Peter Zijlstra , ionela.voinescu@arm.com, Vincent Guittot , Zhang Rui , Eduardo Valentin , qperret@google.com, LKML , Amit Daniel Kachhap , Javi Merino , Daniel Lezcano 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 On Wed, Nov 6, 2019 at 12:20 AM Thara Gopinath wrote: > > cpu_capacity relflects the maximum available capacity of a cpu. Thermal s/relflects/reflects > pressure on a cpu means this maximum available capacity is reduced. This > patch reduces the average thermal pressure for a cpu from its maximum > available capacity so that cpu_capacity reflects the actual > available capacity. > > Other signals that are deducted from cpu_capacity to reflect the actual > capacity available are rt and dl util_avg. util_avg tracks a binary signal > and uses the weights 1024 and 0. Whereas thermal pressure is tracked > using load_avg. load_avg uses the actual "delta" capacity as the weight. Consider rephrasing as, Currently, effective cpu capacity is calculated by deducting RT and DL average utilization (util_avg) from cpu_capacity. For thermal pressure, we use load_avg instead of util_avg which is a binary signal (0 or 1024) because > Signed-off-by: Thara Gopinath > --- > kernel/sched/fair.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 9fb0494..5f6c371 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7738,6 +7738,7 @@ static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu) > > used = READ_ONCE(rq->avg_rt.util_avg); > used += READ_ONCE(rq->avg_dl.util_avg); > + used += READ_ONCE(rq->avg_thermal.load_avg); > > if (unlikely(used >= max)) > return 1; > -- > 2.1.4 >