Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7743439rdb; Thu, 4 Jan 2024 06:28:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaHZ/yoIrqS0wDg/HOb2jvqF3tiFRmwgVAkP127kJrZA4BsYwm6bUzdmushMZDKROcYeY+ X-Received: by 2002:a9d:5616:0:b0:6db:ff86:83a9 with SMTP id e22-20020a9d5616000000b006dbff8683a9mr610346oti.19.1704378483459; Thu, 04 Jan 2024 06:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704378483; cv=none; d=google.com; s=arc-20160816; b=Wbf+SnXBZ+AAxlu0MFJKBADWj8fnLJF0GY64hPRodyb+kleHFKoDB2pwgH+AOehNkt CK1w5n1o4F+yW+VNWhOAkxBYUFKPiSTL6iAHEPOWUE/WjfrHTmQoJelBZLcrmAH1FQ3f SN07ypv3xUoC0icmF4L4brnnPA5oTpkXsxLH4qdT3Xh1iJH4CtUqkk5k0LblXWG3aaNm ClFU4BA3Ibur8qBNuCqETozR7Vz7+q3O1ou6Bo69L4sq5p5wyLpssko6KGzNt6uRm+1l yh2t5o7DafQiP1G5k/m9YlN3PvMawEaV26McPb5AQu2/EJU3f9U5jywCFeNB9eOGqczr lYdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=KlDNdLgG5ibL0gOyrViS7ps98MSZFg5ogqetKbBuLvU=; fh=l83Qd/Hao8IHqfNYwnLRy/m+/UdAPH+5PqS+1Us5X5M=; b=k6iZ6hpQYOLauE02fy3Tcx3Sps2G8RCe734h0+gfV47MFU4OTMS8laD8edtubdANAi DldX0KbrBr6O6ZEsCSyCh3ZZ7xq6Xf2sWji9MUHPr1pLte6PRyAKGftJA18dWift8UOC L1Mpjj4yp+s8vXDE4Gd7dBV9zxuMNLFVSFyOPZRxTtT586VVXt0fvreVUcDNt2VK+2Nv kJRiSItdJMdXzAh+x25g/06c71QMJf2BMflfcW2HUTISHSqYydLZxW+2QqD5myrrHZwP cXPDFfl2Q755bdPowsefDD59ctw02QAy+ZIkusJPvJp068NxqFHJ9HG21HNnSPoqeg6O 4iRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ze6JRXNu; spf=pass (google.com: domain of linux-kernel+bounces-16787-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16787-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c13-20020a05622a024d00b0042775bb6607si32143851qtx.774.2024.01.04.06.28.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 06:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16787-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ze6JRXNu; spf=pass (google.com: domain of linux-kernel+bounces-16787-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16787-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DAD541C21F32 for ; Thu, 4 Jan 2024 14:28:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B631F225D6; Thu, 4 Jan 2024 14:27:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ze6JRXNu" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F4C0225A5 for ; Thu, 4 Jan 2024 14:27:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-5cd51c0e8ebso349790a12.3 for ; Thu, 04 Jan 2024 06:27:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704378473; x=1704983273; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KlDNdLgG5ibL0gOyrViS7ps98MSZFg5ogqetKbBuLvU=; b=ze6JRXNu8h4e79QNoCUrmA376CL9Yg0a/MtGOvLGKP/XZfrkJaypWwPZPv8IThbYZn UAqUq0DEjeTfwmpBW1wACMDw7tQUR0u0hhusJmVc+9jsZ266igEJMUdjWBNka2J3QjSM A0+LtJSB7zYXB3G+1LiO7t6NaDZ13YFpMgmMz8Gap3Dvj8CcYT2krXu2JW9VPI0WRGpQ z6DWpZa5XP9LLGVw4mdlf93PVisHMIGycJH9zT/tYJC/msMHV+7ZlYRl2pIEkNy8TLKL z+zgf2uXx/GumC3eVl9fPhnNtfoMo8nz3S1P/NG+prW+emh2BMdz2Or4SEkEvAjG+Lcr sv6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704378473; x=1704983273; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KlDNdLgG5ibL0gOyrViS7ps98MSZFg5ogqetKbBuLvU=; b=YDpqHM6uEywPTGqIoRyQMYUPGUFbclteMUU86u2ywRypLUAuFMjH0Y4FO6HYERcOXO 9jLZBCmp4HK7PsAwB6m5Id/+bX3NRMzXrUiH8HxSaakdsWkyKKkkHo6abtJPRN/HMmzp +9EViPONhWSMQy0fRjsrA76nMWDEe1/5v+8bgmM9mo5wyvEjgSkH1OwKRX2mfbMdFxKj i67PmGI9hEB15N/vudu1rLvwPwbh/PyLfTTCZphr8xmchpQMUSWMVINuLxZ2eMf1sVnZ sqCJ+UpzNV83Rw49CFb8YXoq7S+BWTrZtth2ib6Qprc5mRmOFhm1WvS7EdkPiQSDodt4 rUhA== X-Gm-Message-State: AOJu0YzAy/zw6IkCxUVxzzatRlWFKebUcNUW/iySljY1k8Q0eDAnIRLl i8Ts40Z8rNHMvNRQM8o24UbfugQKCX1uhFPG49mER1fgvhOJzA== X-Received: by 2002:a17:90b:4c4b:b0:286:6cc1:5fde with SMTP id np11-20020a17090b4c4b00b002866cc15fdemr512285pjb.97.1704378473558; Thu, 04 Jan 2024 06:27:53 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240101154624.100981-1-sshegde@linux.vnet.ibm.com> <20240101154624.100981-2-sshegde@linux.vnet.ibm.com> In-Reply-To: <20240101154624.100981-2-sshegde@linux.vnet.ibm.com> From: Vincent Guittot Date: Thu, 4 Jan 2024 15:27:42 +0100 Message-ID: Subject: Re: [PATCH v2 1/2] sched: use existing helper functions to access ->avg_rt and ->avg_dl To: Shrikanth Hegde Cc: mingo@kernel.org, peterz@infradead.org, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, srikar@linux.vnet.ibm.com, yu.c.chen@intel.com, tim.c.chen@linux.intel.com Content-Type: text/plain; charset="UTF-8" On Mon, 1 Jan 2024 at 16:49, Shrikanth Hegde wrote: > > There are helper functions called cpu_util_dl and cpu_util_rt which gives > the average utilization of DL and RT respectively. But there are few > places in code where these variables are used directly. > > Instead use the helper function so that code becomes simpler and easy to > maintain later on. This patch doesn't intend any functional changes. > > Signed-off-by: Shrikanth Hegde Reviewed-by: Vincent Guittot > --- > kernel/sched/fair.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index bcea3d55d95d..1aeca3f943a8 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9212,10 +9212,10 @@ static inline bool cfs_rq_has_blocked(struct cfs_rq *cfs_rq) > > static inline bool others_have_blocked(struct rq *rq) > { > - if (READ_ONCE(rq->avg_rt.util_avg)) > + if (cpu_util_rt(rq)) > return true; > > - if (READ_ONCE(rq->avg_dl.util_avg)) > + if (cpu_util_dl(rq)) > return true; > > if (thermal_load_avg(rq)) > @@ -9481,8 +9481,8 @@ static unsigned long scale_rt_capacity(int cpu) > * 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 = cpu_util_rt(rq); > + used += cpu_util_dl(rq); > used += thermal_load_avg(rq); > > if (unlikely(used >= max)) > -- > 2.39.3 >