Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp511391ybv; Thu, 13 Feb 2020 04:48:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyzg7rE0etVs9KEST5obhVK6PhjIdFJyPBgGCsW1XoiKGXuEYmLgl8s4GRfx6r+NkybYwfj X-Received: by 2002:a05:6830:98:: with SMTP id a24mr6388751oto.115.1581598100547; Thu, 13 Feb 2020 04:48:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581598100; cv=none; d=google.com; s=arc-20160816; b=c6dqivpf/rK7G32yC4FFd7Zyudy8VN2WjqhltNHM2HbXhrBR4U12E8GG/51dbTiyLU RNRcC2eSrTQaOr8FYXreRtSesbwqWZ5b1HyFVJ6G1aDUTykVp0op5MkH8BDWdwWoBQyb FMzlL9OceHmGTs7JoIzYr5jdth681FJkKOlm/BhAVBmhvkpLC1Fd4tiVFKzO9gELYNW9 e7CZjYhcsICoAj1HclAtcnYNRnO7BrYQ3lk4mCZmo1mVKKDB+sKVC1BfjDtTI95TILod RpjhmYpZJ9pJUAhZAnLbNUucSh6MpWKqorvmgSMw99NsISyIQKqDMzDery+wLICmPzJt j6eg== 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=9oy1TQ4c1/kXbmr4BqUIxSWOruEHkmefnsn2cXhY8GI=; b=SeEZObFPreUwYfhrk+NdT1ARHAJbKqY/Y2NaBB3CHnA3SU+bNCBUPygDRBMcNdmgBh 2fendhDKM0VwcN9lVtTxSk8Qq5L26iDGVsj4vLILfqAITkcgSk27SOLUWTsqbVU5YeA7 C8STq7jpKJyDTCEYMBamBjBPwSBQwItO1aUmQziwbRAJ0vpUfVK7EDY+coZ+5H+T+r+p QuCFfLOrBzWM0Ag7BKxzpNGxvZXh4RZ5bP91IEYHupHYCJpddv1oT8zDiEsGESvMFV6C YGkhJB0V8pCHMD1qjr76hYNWiTXh/jpDWFY5Xz0qEvCSgulOBcF1/dD9AGNuIbeHhwWF 9i2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b="d/kPtkI1"; 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 l13si1171403otq.30.2020.02.13.04.48.07; Thu, 13 Feb 2020 04:48:20 -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="d/kPtkI1"; 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 S1729903AbgBMMrl (ORCPT + 99 others); Thu, 13 Feb 2020 07:47:41 -0500 Received: from mail-ua1-f66.google.com ([209.85.222.66]:40306 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729428AbgBMMrk (ORCPT ); Thu, 13 Feb 2020 07:47:40 -0500 Received: by mail-ua1-f66.google.com with SMTP id g13so2200916uab.7 for ; Thu, 13 Feb 2020 04:47:39 -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=9oy1TQ4c1/kXbmr4BqUIxSWOruEHkmefnsn2cXhY8GI=; b=d/kPtkI1Bf+wOmHtFluHQL9zwvFpmUqimDwOEHVuDq+h3190eH+3fmlMnouS7EVOe6 i8tmfqAlcls2SSnlKqmGPnK1pp6AaXe/waW/T4ol169mqsa1+9rJtvKA/G8++BG60MNB uMyjapfqvO/CzlKxOO6dm8IQiZtKhQO6lNWTblhv5pYSjncM/tqhTBKKjWM8TnEw4npD asAx0Ccjcw8s6WwNcyLM2mc40Fy7pcutNwqoxRdMax7I0ZmttnepA5ZDmtWNaTiJnqfi VH9IfyRpKjwvLbUfdCqmUBfi46DPNZny932JGl+i6Ujk/0SIIX7vGYCneIRFeE4J/gJ8 dnVw== 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=9oy1TQ4c1/kXbmr4BqUIxSWOruEHkmefnsn2cXhY8GI=; b=HQ5PfJcE5uo0kjgiuOQZ7Dt9Kd5C8mqbx17V1XIWBGxf8+md4dFoFEH4ZhmDZd5+Sa Mabs0BO7i7O8blZhugPu7/USpbSKzJw4dCZmHjyDoYCIYX+lMbWdouNGqHqt/h4gJmy6 oWECH5axCeHP6a02nO9dOe0FrAsmktOBPy2MNdnqt8lHVE9Tw1Vl9HxU3t5pm1d/hJrK FQbzfb7wzISF59yK2uuSS68H3e8x/WkH8T3gtjpIaVCip0m/Jt5WDpyYaCXhfaOmhp83 UpmkaiT5O+xFpehWVhbIpaOvxnbJef+k1ZHRX4e0KuMDAicnvLKdAH4CuMqd3twNr7fh WQWA== X-Gm-Message-State: APjAAAVVbTZ83mm2naXPySuouOVPgqyLrfzLQ0a0sW5/GvHrvEgoz89M Pi2GAJT913i6OqFRfFWg+q4hlCNYJniQaTpEimNA8A== X-Received: by 2002:ab0:1849:: with SMTP id j9mr6881047uag.77.1581598058351; Thu, 13 Feb 2020 04:47:38 -0800 (PST) MIME-Version: 1.0 References: <1580250967-4386-1-git-send-email-thara.gopinath@linaro.org> <1580250967-4386-6-git-send-email-thara.gopinath@linaro.org> In-Reply-To: <1580250967-4386-6-git-send-email-thara.gopinath@linaro.org> From: Amit Kucheria Date: Thu, 13 Feb 2020 18:17:26 +0530 Message-ID: Subject: Re: [Patch v9 5/8] sched/fair: update cpu_capacity to reflect thermal pressure To: Thara Gopinath Cc: Ingo Molnar , Peter Zijlstra , ionela.voinescu@arm.com, Vincent Guittot , Dietmar Eggemann , Zhang Rui , qperret@google.com, Daniel Lezcano , Viresh Kumar , Steven Rostedt , Will Deacon , Catalin Marinas , Sudeep Holla , Juri Lelli , corbet@lwn.net, LKML , Amit Daniel Kachhap , Javi Merino 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, Jan 29, 2020 at 4:06 AM Thara Gopinath wrote: > > cpu_capacity initially reflects the maximum possible capacity of a cpu. > Thermal pressure on a cpu means this maximum possible capacity is > unavailable due to thermal events. This patch subtracts the average thermal > pressure for a cpu from its maximum possible capacity so that cpu_capacity > reflects the actual maximum currently available capacity. > > Signed-off-by: Thara Gopinath > --- > > v8->v9: > - Use thermal_load_avg to read rq->avg_thermal.load_avg. > > kernel/sched/fair.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 5f58c03..d879077 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7753,8 +7753,15 @@ static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu) > if (unlikely(irq >= max)) > return 1; > > + /* > + * avg_rt.util avg and avg_dl.util track binary signals For avg_rt, s/util avg/util_avg/ For avg_dl, s/util/util_avg/ ? > + * (running and not running) with weights 0 and 1024 respectively. > + * avg_thermal.load_avg tracks thermal pressure and the weighted > + * average uses the actual delta max capacity(load). > + */ > used = READ_ONCE(rq->avg_rt.util_avg); > used += READ_ONCE(rq->avg_dl.util_avg); > + used += thermal_load_avg(rq); > > if (unlikely(used >= max)) > return 1; > -- > 2.1.4 >