Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp111242rbe; Wed, 28 Feb 2024 14:02:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUzjPZHqwz0/ZtLyB78gQROQTjFWDkUTz2midHgD4wDnK1KTeZyjT02r9hwEXlN1P4qEjA8MJ2n/k0EFsith6yCD/TYq1ETqIEm9e3rmw== X-Google-Smtp-Source: AGHT+IGnhv65/dxqp+Vm+vzplgZ9NttExJQReK+MHOWGZeLesSx2ofCwZzAkLDWF9tc4shDtOHIq X-Received: by 2002:a05:6102:2913:b0:472:6b03:7ef9 with SMTP id cz19-20020a056102291300b004726b037ef9mr179815vsb.32.1709157728082; Wed, 28 Feb 2024 14:02:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709157728; cv=pass; d=google.com; s=arc-20160816; b=lYKewQ4czKxkH4EubQd8sfRkrsXLV3hpGszgAbVoFze5VAXS1kiM0/gpf4mKqYbBfY RYvflVspXyb68pkDCL0jWMTEe9VnkqhYKvXWExrxrJb/CXwD8Xq0jxF7CKRUn8u+uRVv K3Dv82H/sHyeIyMKomTDlWmtyyhXdmNLhT6TbOCEsKXAfSHOmi5gqFYbi3hELTPQ5DT+ 8PbL/pac3jOLZJncgDKy1XZBDHAGGKtvlQ6UKbdoC6QxN4brx9nInUD728Z41Ut8snks u6VKL5oF0HgapD750Eo+5HV2MgaCj5LMppXSrY+6IaSoev3L+lBW6mopMq3o2+0xI0t3 iKZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=AqnqoMpIl5k6Jdqh1nfd2HSKhwv+pZA6RL42OGDprlA=; fh=rTfvrFb8WHxVsmwdqS+Huea6Drs2rLzUBvWHvQ35d2A=; b=UnmwznLGaoFiY0INZMSMz/LOSQ1/c3awr5Xc3hQLrWEgHe5Qh4nB8hRJQZir3d0ffT qqX/xf7aPLCni0d3s7ZINNLuZ/dXVL9LpgQW8Qd2fiu2NmeeYFCKppM1ZaUHygyBcMxa +ujOgA/4XrdLxpt0N1g0umDu/Umb7EAWbKJdwwwB34mDlOvVEMiOw96iUlsbLzCSPOs/ V33PcRBbOwV4hDfEztaq9SH2K29OBICya2PdRft9WM4fGeFh381Jp8RJ/MGIxg5SxJMW vJetOGnRjn7KjhVv5ZRXDm2fQyyYlRjQgCXTr8eCVp+yu4o9KahC/zRX7SpKbctFog2C nJ7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=i8BvkiZ1; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-85760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fs19-20020a056130199300b007d9bff7fcfesi2613uab.121.2024.02.28.14.02.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:02:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85760-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=@linutronix.de header.s=2020 header.b=i8BvkiZ1; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-85760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 AD17B1C22D08 for ; Wed, 28 Feb 2024 22:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CEA815F301; Wed, 28 Feb 2024 22:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="i8BvkiZ1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3oCjP3Uj" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC78376F0A; Wed, 28 Feb 2024 22:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709157620; cv=none; b=XbJp5kMfJxKeYNHADpt3LNaxz3kfsoQ2CgQkc7DH9GzW9Zoaez0Gkmeg+zcrHFXbAaX3ZSIFQ4PSTf92zCmU5pNkmabi1BWoiIpY+32m2GfDLQtM3kKC7nEeuStFYFAol8Zi778q7dphPPTOfuv0K640nwKlEjaRrNh7llQggt4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709157620; c=relaxed/simple; bh=ryJpJr++JH9ILBZsDiPvJLWA6NmY2BKqhb2LWNtd2yY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=r3jU0dwYgf7zgZVCY0D5FOM2NXOnMWyIy9q0evGRKpoO48nCJqVPckHQepcnJ5dDpzNyf/mFQ4+KfAZroYfgOpq/D6/sMrR5JeazsqGRdh+7Gh3q8cYhdcSm4zerCliHQcDicHnXCU7xsBRH5Lfk+iNMCU8DHOK1UCn/OPUiyD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=i8BvkiZ1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3oCjP3Uj; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 28 Feb 2024 22:00:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1709157613; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AqnqoMpIl5k6Jdqh1nfd2HSKhwv+pZA6RL42OGDprlA=; b=i8BvkiZ1u31+7+nVv4iMK6574b+QKmFyumTA0z64UXrn9Lxia1EP6+LNgi4Wkpp+sBOoJc Cfs0NMAjoF2dTbUHF98Dsx6MxShBMzv718xKpqvEy46iS8oAXSosAPccneQedYtrrD9KZi TFNvotEk+nPmeEC/WWXsFa8GOOZektQ9DM0VCBDL/Ld0O8uPfXI9QYeXdAhAyRHaJ6c8en ya9pU7wWsVUROVJR01WCbEWHUA6z5grEA7eydbZlJSJ6fkTpqrXhq6eYQaI/vukLVSvpw5 S3qrLfY2MKJ3TUJ7NazIbvUfksRI0i/LVvE2miLl+5ugGq8QnNNdMhW0Y9ctfw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709157613; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AqnqoMpIl5k6Jdqh1nfd2HSKhwv+pZA6RL42OGDprlA=; b=3oCjP3UjNNbAHtHXbkN9aI3a1KBzXGmKO7vT/2icXl1u4ICHB9R+vxghIjdLcwEK/FaNlh dMDqueWfCU2wWzAg== From: "tip-bot2 for Shrikanth Hegde" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Use existing helper functions to access ->avg_rt and ->avg_dl Cc: Shrikanth Hegde , Ingo Molnar , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240101154624.100981-2-sshegde@linux.vnet.ibm.com> References: <20240101154624.100981-2-sshegde@linux.vnet.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170915761279.398.5988378021122454655.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the sched/core branch of tip: Commit-ID: 8b936fc1d84f7d70009ea34d66bbf6c54c09fae7 Gitweb: https://git.kernel.org/tip/8b936fc1d84f7d70009ea34d66bbf6c54c09fae7 Author: Shrikanth Hegde AuthorDate: Mon, 01 Jan 2024 21:16:23 +05:30 Committer: Ingo Molnar CommitterDate: Wed, 28 Feb 2024 15:11:14 +01:00 sched/fair: Use existing helper functions to access ->avg_rt and ->avg_dl There are helper functions called cpu_util_dl() and cpu_util_rt() which give the average utilization of DL and RT respectively. But there are a few places in code where access to these variables is open-coded. Instead use the helper function so that code becomes simpler and easier to maintain later on. No functional changes intended. Signed-off-by: Shrikanth Hegde Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20240101154624.100981-2-sshegde@linux.vnet.ibm.com --- 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 8e30e2b..127e727 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9237,10 +9237,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)) @@ -9506,8 +9506,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))