From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 761C83C24 for ; Fri, 8 Mar 2024 11:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896716; cv=none; b=KrTNozhi0pK3vi9JO5kS3LbiSmPl6wfe0KNme0GQtdsTirhqICzBd/D4UgDtOt+dI0GWPRT/iBG+2xS+poahtZz+YngqsmFB+6RGp3JPvHx63bgXpgwRBdJpinErNGGf/v16AO27hpB66pj903JV4NpJPGsydfta2kraCUM7lC0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896716; c=relaxed/simple; bh=mZXA0w0qbcZUUB8hRyDOhH4UKVb+9IvvzRfXr3AcBko=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=YzhZoJAcVb7u8vKkVt+21xZZyrOFVY7vuXtCup/OdM0rNeOjHJuKfUFCjs0FEaByTBypOISf5aazsLRGtVe4wqTF8g/DndUMCdLMRzqyauLWiBk2Mz3ff0omKpUlznL+1PddcNtiq65UV9L7Pze0sGBq27/f6gO/q7XFySVkcqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BbX+QNir; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BbX+QNir" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-33e65ed1c3aso601665f8f.3 for ; Fri, 08 Mar 2024 03:18:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896713; x=1710501513; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=BSOz+7Sts53Qhe5VQivnL2JCHzBJY0rk8TTBQBo3Arw=; b=BbX+QNirP775M957hWGqOHlOZ1vbuBeba2MxtlQa1mOX6MSdpQ6wmYmELsQ4LzSaqa AhT2v4TwmwDddMclYNGdjvYFdV+SmTUfL8yJdL8MajK9/xP1SocDY1UWF+32aUEiWqub aDze7JKF/XlUhq/EALLFNc7CpppXQel9X2QfG0WhTlNFFURVNjaunOzv0zUou3wL0yHo VLpH4PvKtqUN/S0dsb9jjhgRiZs5CpKI6fjjU4zmzPUokMl5GHi0Iw1PA686FEiRb7NM IlkNZyILPBxTxr+Z4CZ0eY1o24g/HoA68ZODdEdPvahkj3qb+zTizJ//0MR20PixDjBu lBiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896713; x=1710501513; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BSOz+7Sts53Qhe5VQivnL2JCHzBJY0rk8TTBQBo3Arw=; b=ObsT545IUMmViKerPWf4+OjZ5xS5n29dfjpjTXMEOosPsZib8LPTGC3m35FVkG6RZg dcDbrYeJDC54gVkm5R8G+gSGXIX7L/8kUQROGx1vRxyKlEuNwezOPUrtnaX2bfEX3Y8p D0wKCGw/FGOAOmau2sDu0JoUn9aDnN4oNw/8tHAoBq15aLqNX1amJ7491ptg5l8ZIWmF bGhbHktVZublfDQVjuHcRr00GsLUIH3cyNWI6ox1LssgmDjd1BB9axOwiVE+ItcIsHFI QmruBQP71/0SPStvO/GQzz/YlETJxT1BcvpAU1/J2IBZL/7KQgPTzD/5atzKUtAnXy5f eJnQ== X-Gm-Message-State: AOJu0YwEE1TSITYyfh3rqeSfjo2hQBTk0+p06rJXhXgE9SOBGMsb/IZ/ CDQuuKdtd3cNWCoYh8CqaFVuE/DNP+TjzP/dCkh0TXDVAgyexH3lrB2QJT0SQEc= X-Google-Smtp-Source: AGHT+IE3Upszx1vJaZQz8ncMoS66zlztFZT6PSSeXv2PBr0o9lI/XnNzJ5pm0IO/7nK0nJcVoMs3bQ== X-Received: by 2002:a05:6000:1a51:b0:33e:47d3:a6cd with SMTP id t17-20020a0560001a5100b0033e47d3a6cdmr8019786wry.68.1709896712564; Fri, 08 Mar 2024 03:18:32 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:32 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 01/13] sched/balancing: Rename run_rebalance_domains() => sched_balance_softirq() Date: Fri, 8 Mar 2024 12:18:07 +0100 Message-Id: <20240308111819.1101550-2-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable run_rebalance_domains() is a misnomer, as it doesn't only run rebalance_domains(), but since the introduction of the NOHZ code it also runs nohz_idle_balance(). Rename it to sched_balance_softirq(), reflecting its more generic purpose and that it's a softirq handler. Signed-off-by: Ingo Molnar Reviewed-by: Valentin Schneider Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Vincent Guittot --- Documentation/scheduler/sched-domains.rst | 2 +- Documentation/translations/zh_CN/scheduler/sched-domains.rst | 2 +- kernel/sched/fair.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/scheduler/sched-domains.rst b/Documentation/sche= duler/sched-domains.rst index e57ad28301bd..6577b068f921 100644 --- a/Documentation/scheduler/sched-domains.rst +++ b/Documentation/scheduler/sched-domains.rst @@ -34,7 +34,7 @@ out of balance are tasks moved between groups. In kernel/sched/core.c, trigger_load_balance() is run periodically on each= CPU through scheduler_tick(). It raises a softirq after the next regularly sch= eduled rebalancing event for the current runqueue has arrived. The actual load -balancing workhorse, run_rebalance_domains()->rebalance_domains(), is then= run +balancing workhorse, sched_balance_softirq()->rebalance_domains(), is then= run in softirq context (SCHED_SOFTIRQ). =20 The latter function takes two arguments: the runqueue of current CPU and w= hether diff --git a/Documentation/translations/zh_CN/scheduler/sched-domains.rst b= /Documentation/translations/zh_CN/scheduler/sched-domains.rst index e814d4c01141..fbc326668e37 100644 --- a/Documentation/translations/zh_CN/scheduler/sched-domains.rst +++ b/Documentation/translations/zh_CN/scheduler/sched-domains.rst @@ -36,7 +36,7 @@ CPU=E5=85=B1=E4=BA=AB=E3=80=82=E4=BB=BB=E6=84=8F=E4=B8=A4= =E4=B8=AA=E7=BB=84=E7=9A=84CPU=E6=8E=A9=E7=A0=81=E7=9A=84=E4=BA=A4=E9=9B=86= =E4=B8=8D=E4=B8=80=E5=AE=9A=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=A6=82=E6=9E=9C=E6= =98=AF=E8=BF=99 =20 =E5=9C=A8kernel/sched/core.c=E4=B8=AD=EF=BC=8Ctrigger_load_balance()=E5=9C= =A8=E6=AF=8F=E4=B8=AACPU=E4=B8=8A=E9=80=9A=E8=BF=87scheduler_tick() =E5=91=A8=E6=9C=9F=E6=89=A7=E8=A1=8C=E3=80=82=E5=9C=A8=E5=BD=93=E5=89=8D= =E8=BF=90=E8=A1=8C=E9=98=9F=E5=88=97=E4=B8=8B=E4=B8=80=E4=B8=AA=E5=AE=9A=E6= =9C=9F=E8=B0=83=E5=BA=A6=E5=86=8D=E5=B9=B3=E8=A1=A1=E4=BA=8B=E4=BB=B6=E5=88= =B0=E8=BE=BE=E5=90=8E=EF=BC=8C=E5=AE=83=E5=BC=95=E5=8F=91=E4=B8=80=E4=B8=AA= =E8=BD=AF=E4=B8=AD=E6=96=AD=E3=80=82=E8=B4=9F=E8=BD=BD=E5=9D=87=E8=A1=A1=E7= =9C=9F=E6=AD=A3 -=E7=9A=84=E5=B7=A5=E4=BD=9C=E7=94=B1run_rebalance_domains()->rebalance_dom= ains()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=9C=A8=E8=BD=AF=E4=B8=AD=E6=96=AD=E4=B8= =8A=E4=B8=8B=E6=96=87=E4=B8=AD=E6=89=A7=E8=A1=8C +=E7=9A=84=E5=B7=A5=E4=BD=9C=E7=94=B1sched_balance_softirq()->rebalance_dom= ains()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=9C=A8=E8=BD=AF=E4=B8=AD=E6=96=AD=E4=B8= =8A=E4=B8=8B=E6=96=87=E4=B8=AD=E6=89=A7=E8=A1=8C =EF=BC=88SCHED_SOFTIRQ=EF=BC=89=E3=80=82 =20 =E5=90=8E=E4=B8=80=E4=B8=AA=E5=87=BD=E6=95=B0=E6=9C=89=E4=B8=A4=E4=B8=AA= =E5=85=A5=E5=8F=82=EF=BC=9A=E5=BD=93=E5=89=8DCPU=E7=9A=84=E8=BF=90=E8=A1=8C= =E9=98=9F=E5=88=97=E3=80=81=E5=AE=83=E5=9C=A8scheduler_tick()=E8=B0=83=E7= =94=A8=E6=97=B6=E6=98=AF=E5=90=A6=E7=A9=BA=E9=97=B2=E3=80=82=E5=87=BD=E6=95= =B0=E4=BC=9A=E4=BB=8E diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 116a640534b9..953f39deb68e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12415,7 +12415,7 @@ static int newidle_balance(struct rq *this_rq, stru= ct rq_flags *rf) * - indirectly from a remote scheduler_tick() for NOHZ idle balancing * through the SMP cross-call nohz_csd_func() */ -static __latent_entropy void run_rebalance_domains(struct softirq_action *= h) +static __latent_entropy void sched_balance_softirq(struct softirq_action *= h) { struct rq *this_rq =3D this_rq(); enum cpu_idle_type idle =3D this_rq->idle_balance; @@ -13216,7 +13216,7 @@ __init void init_sched_fair_class(void) #endif } =20 - open_softirq(SCHED_SOFTIRQ, run_rebalance_domains); + open_softirq(SCHED_SOFTIRQ, sched_balance_softirq); =20 #ifdef CONFIG_NO_HZ_COMMON nohz.next_balance =3D jiffies; --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 7B94E5576D for ; Fri, 8 Mar 2024 11:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896717; cv=none; b=LpYKotAFk+JhOgiFHS2GdeJ8ExhDreXj52pQinyHQIwWrcotRk8kg8xN4i+maufcZTgEFez3K20zT4JP+cVnzaEplH8YZwjKySaNlZwloKVSIzqBjhNUzEjfRQDBQQtL3xm5qvEuFlpQpH/SWoT0kppLLYM+fdxUeVYDp48+vmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896717; c=relaxed/simple; bh=j4tkfHZPzR5kYz6YVI0BTP7qRQhgw5O0GU29Ku4YX+s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=IbC+AhBWUjukKvm3SdfyqBKS4CbeUy4F4T58msi4iSkYKam0GOctnOEfgqCA6W2n6hmSqYOstnM5ZRrp9boFwx9RzeGpeI0apDsInplSrk7Eu3sUG3HoWcTPpdUhsRCjkA3CZThDmkgnoJDhDHwPtctXoqsXFNsZzWe+KqsRD8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UT5QjhRs; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UT5QjhRs" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-33e796cc90dso157136f8f.1 for ; Fri, 08 Mar 2024 03:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896714; x=1710501514; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=JvyMn6IbB+KgK6NP2mWjU8ehV/x2G+Dw3KFHSdNlX1g=; b=UT5QjhRsf1XcHocriWIyrXCVUsaQFnNkLWrTgz+lqMq/lez7LwE1KVajXkUwNPnF9q ptN731h/LYisog++uSXPy1/+8NW1lnGC+0VRSfmVP9COlAHPZf5SbVuYIXehck5+uI45 egysOOi0KyTMURAzoBMtMlZVHa2o/3j4m6DiAKWgviuySdhPri5Nup3EK4oyvgoqIuIZ BDupjCmJiDytgr0ePIlqUnHjNW0xpjPYdJV0CVLTyTo6bdHD+ice8PfVO95/oXJuT4WY g5Baq+lPed3Bw43hd1Fa+KAoFpD6/Iyfu2UFkjjNuyh3FTrL8kTgfqtgMCAcPUGh9DEC TadQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896714; x=1710501514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JvyMn6IbB+KgK6NP2mWjU8ehV/x2G+Dw3KFHSdNlX1g=; b=D9btWZsP/19X2ieNUwpoIot8Xz+LvatVVIPO3m5ligS8zvtFSjx0Hj91mOKzvgcKEW LSj/ROrCC9NxrYsSWujpGng3weqlOQ7emOhhul+gpUaRZcCKi0YN+BkwGoywRoIOtmDu J8tZdcXK4e6YN2tAccFZi32CNGQMFpbM0ljHTE5YtU7KZia55s+gWTv4nMXD/BbHeLU5 egkmWXZl66PpAZ8ovpO16EiqbJn0fz6uyYoQtaifRNNXpQQ2+S2Nd1FwXYO5rkBqBJSP gheOfrGLv0UY+r/GHdIZZJCpk4p1mSSy+4q7wEsfkWo0FYMYlPuOi8njELAP9pvAXEeJ bRxw== X-Gm-Message-State: AOJu0YzPIk4IfH3EZN2xl0vUnU5iKDTNdV4jepo2sX9zeHueL/hKhiVp KnRklSSIoc4E9RK4A20StaIpKG0Q94VLLGeF+SUkutsU1ywdGuwA7m9GWup7TTg= X-Google-Smtp-Source: AGHT+IG7+5UMPEvH5Oacvt/WcYRlEnGbJxeTsUdHC9mR1cYCMJ5Eq0Ty7lh0yo62vdbFk3vHghxQrA== X-Received: by 2002:adf:ef0f:0:b0:33e:7637:51fd with SMTP id e15-20020adfef0f000000b0033e763751fdmr992319wro.48.1709896713607; Fri, 08 Mar 2024 03:18:33 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:33 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 02/13] sched/balancing: Rename scheduler_tick() => sched_tick() Date: Fri, 8 Mar 2024 12:18:08 +0100 Message-Id: <20240308111819.1101550-3-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - Standardize on prefixing scheduler-internal functions defined in with sched_*() prefix. scheduler_tick() was the only function using the scheduler_ prefix. Harmonize it. - The other reason to rename it is the NOHZ scheduler tick handling functions are already named sched_tick_*(). Make the 'git grep sched_tick' more meaningful. Signed-off-by: Ingo Molnar Acked-by: Valentin Schneider Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Vincent Guittot --- Documentation/scheduler/sched-domains.rst | 4 += +-- Documentation/translations/zh_CN/scheduler/sched-domains.rst | 4 += +-- include/linux/sched.h | 2 +- kernel/sched/core.c | 4 += +-- kernel/sched/loadavg.c | 2 +- kernel/time/timer.c | 2 +- kernel/workqueue.c | 2 +- tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/scheduler/sched-domains.rst b/Documentation/sche= duler/sched-domains.rst index 6577b068f921..541d6c617971 100644 --- a/Documentation/scheduler/sched-domains.rst +++ b/Documentation/scheduler/sched-domains.rst @@ -32,13 +32,13 @@ load of each of its member CPUs, and only when the load= of a group becomes out of balance are tasks moved between groups. =20 In kernel/sched/core.c, trigger_load_balance() is run periodically on each= CPU -through scheduler_tick(). It raises a softirq after the next regularly sch= eduled +through sched_tick(). It raises a softirq after the next regularly schedul= ed rebalancing event for the current runqueue has arrived. The actual load balancing workhorse, sched_balance_softirq()->rebalance_domains(), is then= run in softirq context (SCHED_SOFTIRQ). =20 The latter function takes two arguments: the runqueue of current CPU and w= hether -the CPU was idle at the time the scheduler_tick() happened and iterates ov= er all +the CPU was idle at the time the sched_tick() happened and iterates over a= ll sched domains our CPU is on, starting from its base domain and going up th= e ->parent chain. While doing that, it checks to see if the current domain has exhaus= ted its rebalance interval. If so, it runs load_balance() on that domain. It then = checks diff --git a/Documentation/translations/zh_CN/scheduler/sched-domains.rst b= /Documentation/translations/zh_CN/scheduler/sched-domains.rst index fbc326668e37..fa0c0bcc6ba5 100644 --- a/Documentation/translations/zh_CN/scheduler/sched-domains.rst +++ b/Documentation/translations/zh_CN/scheduler/sched-domains.rst @@ -34,12 +34,12 @@ CPU=E5=85=B1=E4=BA=AB=E3=80=82=E4=BB=BB=E6=84=8F=E4=B8= =A4=E4=B8=AA=E7=BB=84=E7=9A=84CPU=E6=8E=A9=E7=A0=81=E7=9A=84=E4=BA=A4=E9=9B= =86=E4=B8=8D=E4=B8=80=E5=AE=9A=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=A6=82=E6=9E=9C= =E6=98=AF=E8=BF=99 =E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E7=9A=84=E8=B4=9F=E8=BD=BD=E5=9D=87= =E8=A1=A1=E5=8F=91=E7=94=9F=E5=9C=A8=E8=B0=83=E5=BA=A6=E7=BB=84=E4=B8=AD=E3= =80=82=E4=B9=9F=E5=B0=B1=E6=98=AF=E8=AF=B4=EF=BC=8C=E6=AF=8F=E4=B8=AA=E7=BB= =84=E8=A2=AB=E8=A7=86=E4=B8=BA=E4=B8=80=E4=B8=AA=E5=AE=9E=E4=BD=93=E3=80=82= =E7=BB=84=E7=9A=84=E8=B4=9F=E8=BD=BD=E8=A2=AB=E5=AE=9A=E4=B9=89=E4=B8=BA=E5= =AE=83 =E7=AE=A1=E8=BE=96=E7=9A=84=E6=AF=8F=E4=B8=AACPU=E7=9A=84=E8=B4=9F=E8=BD= =BD=E4=B9=8B=E5=92=8C=E3=80=82=E4=BB=85=E5=BD=93=E7=BB=84=E7=9A=84=E8=B4=9F= =E8=BD=BD=E4=B8=8D=E5=9D=87=E8=A1=A1=E5=90=8E=EF=BC=8C=E4=BB=BB=E5=8A=A1=E6= =89=8D=E5=9C=A8=E7=BB=84=E4=B9=8B=E9=97=B4=E5=8F=91=E7=94=9F=E8=BF=81=E7=A7= =BB=E3=80=82 =20 -=E5=9C=A8kernel/sched/core.c=E4=B8=AD=EF=BC=8Ctrigger_load_balance()=E5=9C= =A8=E6=AF=8F=E4=B8=AACPU=E4=B8=8A=E9=80=9A=E8=BF=87scheduler_tick() +=E5=9C=A8kernel/sched/core.c=E4=B8=AD=EF=BC=8Ctrigger_load_balance()=E5=9C= =A8=E6=AF=8F=E4=B8=AACPU=E4=B8=8A=E9=80=9A=E8=BF=87sched_tick() =E5=91=A8=E6=9C=9F=E6=89=A7=E8=A1=8C=E3=80=82=E5=9C=A8=E5=BD=93=E5=89=8D= =E8=BF=90=E8=A1=8C=E9=98=9F=E5=88=97=E4=B8=8B=E4=B8=80=E4=B8=AA=E5=AE=9A=E6= =9C=9F=E8=B0=83=E5=BA=A6=E5=86=8D=E5=B9=B3=E8=A1=A1=E4=BA=8B=E4=BB=B6=E5=88= =B0=E8=BE=BE=E5=90=8E=EF=BC=8C=E5=AE=83=E5=BC=95=E5=8F=91=E4=B8=80=E4=B8=AA= =E8=BD=AF=E4=B8=AD=E6=96=AD=E3=80=82=E8=B4=9F=E8=BD=BD=E5=9D=87=E8=A1=A1=E7= =9C=9F=E6=AD=A3 =E7=9A=84=E5=B7=A5=E4=BD=9C=E7=94=B1sched_balance_softirq()->rebalance_dom= ains()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=9C=A8=E8=BD=AF=E4=B8=AD=E6=96=AD=E4=B8= =8A=E4=B8=8B=E6=96=87=E4=B8=AD=E6=89=A7=E8=A1=8C =EF=BC=88SCHED_SOFTIRQ=EF=BC=89=E3=80=82 =20 -=E5=90=8E=E4=B8=80=E4=B8=AA=E5=87=BD=E6=95=B0=E6=9C=89=E4=B8=A4=E4=B8=AA= =E5=85=A5=E5=8F=82=EF=BC=9A=E5=BD=93=E5=89=8DCPU=E7=9A=84=E8=BF=90=E8=A1=8C= =E9=98=9F=E5=88=97=E3=80=81=E5=AE=83=E5=9C=A8scheduler_tick()=E8=B0=83=E7= =94=A8=E6=97=B6=E6=98=AF=E5=90=A6=E7=A9=BA=E9=97=B2=E3=80=82=E5=87=BD=E6=95= =B0=E4=BC=9A=E4=BB=8E +=E5=90=8E=E4=B8=80=E4=B8=AA=E5=87=BD=E6=95=B0=E6=9C=89=E4=B8=A4=E4=B8=AA= =E5=85=A5=E5=8F=82=EF=BC=9A=E5=BD=93=E5=89=8DCPU=E7=9A=84=E8=BF=90=E8=A1=8C= =E9=98=9F=E5=88=97=E3=80=81=E5=AE=83=E5=9C=A8sched_tick()=E8=B0=83=E7=94=A8= =E6=97=B6=E6=98=AF=E5=90=A6=E7=A9=BA=E9=97=B2=E3=80=82=E5=87=BD=E6=95=B0=E4= =BC=9A=E4=BB=8E =E5=BD=93=E5=89=8DCPU=E6=89=80=E5=9C=A8=E7=9A=84=E5=9F=BA=E8=B0=83=E5=BA= =A6=E5=9F=9F=E5=BC=80=E5=A7=8B=E8=BF=AD=E4=BB=A3=E6=89=A7=E8=A1=8C=EF=BC=8C= =E5=B9=B6=E6=B2=BF=E7=9D=80parent=E6=8C=87=E9=92=88=E9=93=BE=E5=90=91=E4=B8= =8A=E8=BF=9B=E5=85=A5=E6=9B=B4=E9=AB=98=E5=B1=82=E7=BA=A7=E7=9A=84=E8=B0=83= =E5=BA=A6=E5=9F=9F=E3=80=82=E5=9C=A8=E8=BF=AD=E4=BB=A3 =E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E5=87=BD=E6=95=B0=E4=BC=9A=E6=A3=80= =E6=9F=A5=E5=BD=93=E5=89=8D=E8=B0=83=E5=BA=A6=E5=9F=9F=E6=98=AF=E5=90=A6=E5= =B7=B2=E7=BB=8F=E8=80=97=E5=B0=BD=E4=BA=86=E5=86=8D=E5=B9=B3=E8=A1=A1=E7=9A= =84=E6=97=B6=E9=97=B4=E9=97=B4=E9=9A=94=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF= =EF=BC=8C=E5=AE=83=E5=9C=A8=E8=AF=A5=E8=B0=83=E5=BA=A6=E5=9F=9F=E8=BF=90=E8= =A1=8C load_balance()=E3=80=82=E6=8E=A5=E4=B8=8B=E6=9D=A5=E5=AE=83=E6=A3=80=E6=9F= =A5=E7=88=B6=E8=B0=83=E5=BA=A6=E5=9F=9F=EF=BC=88=E5=A6=82=E6=9E=9C=E5=AD=98= =E5=9C=A8=EF=BC=89=EF=BC=8C=E5=86=8D=E5=90=8E=E6=9D=A5=E7=88=B6=E8=B0=83=E5= =BA=A6=E5=9F=9F=E7=9A=84=E7=88=B6=E8=B0=83=E5=BA=A6=E5=9F=9F=EF=BC=8C=E4=BB= =A5=E6=AD=A4=E7=B1=BB=E6=8E=A8=E3=80=82 diff --git a/include/linux/sched.h b/include/linux/sched.h index ffe8f618ab86..739e32ead24b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -301,7 +301,7 @@ enum { TASK_COMM_LEN =3D 16, }; =20 -extern void scheduler_tick(void); +extern void sched_tick(void); =20 #define MAX_SCHEDULE_TIMEOUT LONG_MAX =20 diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a76c7095f736..3affa9a6b249 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5651,7 +5651,7 @@ static inline u64 cpu_resched_latency(struct rq *rq) = { return 0; } * This function gets called by the timer code, with HZ frequency. * We call it with interrupts disabled. */ -void scheduler_tick(void) +void sched_tick(void) { int cpu =3D smp_processor_id(); struct rq *rq =3D cpu_rq(cpu); @@ -6574,7 +6574,7 @@ pick_next_task(struct rq *rq, struct task_struct *pre= v, struct rq_flags *rf) * paths. For example, see arch/x86/entry_64.S. * * To drive preemption between tasks, the scheduler sets the flag in = timer - * interrupt handler scheduler_tick(). + * interrupt handler sched_tick(). * * 3. Wakeups don't really cause entry into schedule(). They add a * task to the run-queue and that's it. diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c index 52c8f8226b0d..ca9da66cc894 100644 --- a/kernel/sched/loadavg.c +++ b/kernel/sched/loadavg.c @@ -379,7 +379,7 @@ void calc_global_load(void) } =20 /* - * Called from scheduler_tick() to periodically update this CPU's + * Called from sched_tick() to periodically update this CPU's * active count. */ void calc_global_load_tick(struct rq *this_rq) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 352b161113cd..ec003ad18b2d 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2089,7 +2089,7 @@ void update_process_times(int user_tick) if (in_irq()) irq_work_tick(); #endif - scheduler_tick(); + sched_tick(); if (IS_ENABLED(CONFIG_POSIX_TIMERS)) run_posix_cpu_timers(); } diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 7b482a26d741..8aa3a0829dd4 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1324,7 +1324,7 @@ void wq_worker_sleeping(struct task_struct *task) * wq_worker_tick - a scheduler tick occurred while a kworker is running * @task: task currently running * - * Called from scheduler_tick(). We're in the IRQ context and the current + * Called from sched_tick(). We're in the IRQ context and the current * worker's fields which follow the 'K' locking rule can be accessed safel= y. */ void wq_worker_tick(struct task_struct *task) diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_f= ile.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.= tc index 25432b8cd5bd..073a748b9380 100644 --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc @@ -19,7 +19,7 @@ fail() { # mesg =20 FILTER=3Dset_ftrace_filter FUNC1=3D"schedule" -FUNC2=3D"scheduler_tick" +FUNC2=3D"sched_tick" =20 ALL_FUNCS=3D"#### all functions enabled ####" =20 --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 0DCD556445 for ; Fri, 8 Mar 2024 11:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896718; cv=none; b=CdIl9ix5HBbVQnwikK8dAikyAz7/PJc1OzIAmA5YZP5lQ8JqfNQlcw73hMR8CF8sNVDuR3Q6StP6NUxJ0yOO4/CjES26qM9TmvAcSqsk2LT10LEikxII+BCweaH3T/kzxAyVhvhxbjXb61R2iy89Ii22v92xzZtogekt1XdQRAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896718; c=relaxed/simple; bh=gz4nzHQU4MqpQnSbS1UBHclLJR2lYPGm79ku55jtwUo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=aZ975jR7dgRH/vl/ROBY8O9YC9bfB2dAEe3CaU0jpUvafSWNH3uFA+qR86zAnsLO5V2ZVM9f7OoAYtMEtM3gVuYZ73Q2JUSkVPAljVB9IWqdbpczyRffIisqAJcMxkzkCtvL+UJ5FLDKUPkxXMsyYZLEaxIdVXtPdlcwHqJrIh4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JUY4JTm+; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JUY4JTm+" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-33d0a7f2424so1051584f8f.0 for ; Fri, 08 Mar 2024 03:18:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896715; x=1710501515; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=kGZnAIvUgvAxitPfQkgWaHDP0NrNZ4xt2txiDBCV+rk=; b=JUY4JTm+D41p9if9sRLYvN79IBPATGAWynda1r3PglpM1zZjP8x31d+JsX0KW9umyC h64qOHDApSZGoB1fw37Pv3aYhwZVFso6t3Hxulcn+1YHqwT2o3n+qzPlnr/esxs/wmWp 4L8FfMlcVg1hZBfWFoDDtMCeAN+blt+wtTz/MZ+sRnJS0iE/Clm0/KSByzwyObrFYQ8Z 38gB0lU+3950gqEYQSNcQnADAPGJ4mfrVpQv6pnExd6Fzf6AeFYuI9Zkg809Jq6gdfjV qV8KqEM3KCAwx5tWj1Nx634tOiGKl0S7GFGfZO4cTaFVK82BEgX6TNaVCnoN0mb/rrPq GlFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896715; x=1710501515; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kGZnAIvUgvAxitPfQkgWaHDP0NrNZ4xt2txiDBCV+rk=; b=A3qBB+phbJvXmJJFB/s/4utoBdUhTuQz/0T7fch0+HnKKq0PZ707rT4WxXpUV5CPb5 wl+jmRJXLLVi4BBH2knJOp7Mgr2LHcAis8KC1GsLRzP+9iZv6jLIXEr6VJ6Eb3jb/8ai 3ymtaC/cEQRftEhIsw8o7KTOun1bqkZq+Pz/Qs24iqFbg3KXV+D4Igcbu9LHv/dYEKOP iejeaSD8mN8AUToNOAVIedPYt2klwNQwQ9DzTmklA3tMGgiskwrDUydQ8iXMB3RhK1sf Dd0cPiBFgveAjoR0XL1u3T2TLJyJgvhgThCl7wAIcdi7xyAJEKPaDofw8q7i89aQT4tI KKyg== X-Gm-Message-State: AOJu0YwLww0JFkNgZW3QQh9YVlvZ/2HP+nJeS6cVK9PYntM9IuAe5xZp A+Mux2/ks/HcEqzHybNF4stAbZ0OhnsvX3CvCBw9AoIj33vFrbBHwK6R6bUZtxc= X-Google-Smtp-Source: AGHT+IG/ZOfTRyNMuqlIXC2XXQDV3Qscmwuf+ogRDOtj7F8xG44YAobKyaKtjaxYXNd2lAGJQEPJ4Q== X-Received: by 2002:adf:fc8e:0:b0:33d:2f2f:b135 with SMTP id g14-20020adffc8e000000b0033d2f2fb135mr16307669wrr.46.1709896714723; Fri, 08 Mar 2024 03:18:34 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:34 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 03/13] sched/balancing: Rename trigger_load_balance() => sched_balance_trigger() Date: Fri, 8 Mar 2024 12:18:09 +0100 Message-Id: <20240308111819.1101550-4-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Standardize scheduler load-balancing function names on the sched_balance_() prefix. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot --- Documentation/scheduler/sched-domains.rst | 2 +- Documentation/translations/zh_CN/scheduler/sched-domains.rst | 2 +- kernel/sched/core.c | 2 +- kernel/sched/fair.c | 2 +- kernel/sched/sched.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/scheduler/sched-domains.rst b/Documentation/sche= duler/sched-domains.rst index 541d6c617971..c7ea05f4107b 100644 --- a/Documentation/scheduler/sched-domains.rst +++ b/Documentation/scheduler/sched-domains.rst @@ -31,7 +31,7 @@ is treated as one entity. The load of a group is defined = as the sum of the load of each of its member CPUs, and only when the load of a group becomes out of balance are tasks moved between groups. =20 -In kernel/sched/core.c, trigger_load_balance() is run periodically on each= CPU +In kernel/sched/core.c, sched_balance_trigger() is run periodically on eac= h CPU through sched_tick(). It raises a softirq after the next regularly schedul= ed rebalancing event for the current runqueue has arrived. The actual load balancing workhorse, sched_balance_softirq()->rebalance_domains(), is then= run diff --git a/Documentation/translations/zh_CN/scheduler/sched-domains.rst b= /Documentation/translations/zh_CN/scheduler/sched-domains.rst index fa0c0bcc6ba5..1a8587a971f9 100644 --- a/Documentation/translations/zh_CN/scheduler/sched-domains.rst +++ b/Documentation/translations/zh_CN/scheduler/sched-domains.rst @@ -34,7 +34,7 @@ CPU=E5=85=B1=E4=BA=AB=E3=80=82=E4=BB=BB=E6=84=8F=E4=B8=A4= =E4=B8=AA=E7=BB=84=E7=9A=84CPU=E6=8E=A9=E7=A0=81=E7=9A=84=E4=BA=A4=E9=9B=86= =E4=B8=8D=E4=B8=80=E5=AE=9A=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=A6=82=E6=9E=9C=E6= =98=AF=E8=BF=99 =E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E7=9A=84=E8=B4=9F=E8=BD=BD=E5=9D=87= =E8=A1=A1=E5=8F=91=E7=94=9F=E5=9C=A8=E8=B0=83=E5=BA=A6=E7=BB=84=E4=B8=AD=E3= =80=82=E4=B9=9F=E5=B0=B1=E6=98=AF=E8=AF=B4=EF=BC=8C=E6=AF=8F=E4=B8=AA=E7=BB= =84=E8=A2=AB=E8=A7=86=E4=B8=BA=E4=B8=80=E4=B8=AA=E5=AE=9E=E4=BD=93=E3=80=82= =E7=BB=84=E7=9A=84=E8=B4=9F=E8=BD=BD=E8=A2=AB=E5=AE=9A=E4=B9=89=E4=B8=BA=E5= =AE=83 =E7=AE=A1=E8=BE=96=E7=9A=84=E6=AF=8F=E4=B8=AACPU=E7=9A=84=E8=B4=9F=E8=BD= =BD=E4=B9=8B=E5=92=8C=E3=80=82=E4=BB=85=E5=BD=93=E7=BB=84=E7=9A=84=E8=B4=9F= =E8=BD=BD=E4=B8=8D=E5=9D=87=E8=A1=A1=E5=90=8E=EF=BC=8C=E4=BB=BB=E5=8A=A1=E6= =89=8D=E5=9C=A8=E7=BB=84=E4=B9=8B=E9=97=B4=E5=8F=91=E7=94=9F=E8=BF=81=E7=A7= =BB=E3=80=82 =20 -=E5=9C=A8kernel/sched/core.c=E4=B8=AD=EF=BC=8Ctrigger_load_balance()=E5=9C= =A8=E6=AF=8F=E4=B8=AACPU=E4=B8=8A=E9=80=9A=E8=BF=87sched_tick() +=E5=9C=A8kernel/sched/core.c=E4=B8=AD=EF=BC=8Csched_balance_trigger()=E5= =9C=A8=E6=AF=8F=E4=B8=AACPU=E4=B8=8A=E9=80=9A=E8=BF=87sched_tick() =E5=91=A8=E6=9C=9F=E6=89=A7=E8=A1=8C=E3=80=82=E5=9C=A8=E5=BD=93=E5=89=8D= =E8=BF=90=E8=A1=8C=E9=98=9F=E5=88=97=E4=B8=8B=E4=B8=80=E4=B8=AA=E5=AE=9A=E6= =9C=9F=E8=B0=83=E5=BA=A6=E5=86=8D=E5=B9=B3=E8=A1=A1=E4=BA=8B=E4=BB=B6=E5=88= =B0=E8=BE=BE=E5=90=8E=EF=BC=8C=E5=AE=83=E5=BC=95=E5=8F=91=E4=B8=80=E4=B8=AA= =E8=BD=AF=E4=B8=AD=E6=96=AD=E3=80=82=E8=B4=9F=E8=BD=BD=E5=9D=87=E8=A1=A1=E7= =9C=9F=E6=AD=A3 =E7=9A=84=E5=B7=A5=E4=BD=9C=E7=94=B1sched_balance_softirq()->rebalance_dom= ains()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=9C=A8=E8=BD=AF=E4=B8=AD=E6=96=AD=E4=B8= =8A=E4=B8=8B=E6=96=87=E4=B8=AD=E6=89=A7=E8=A1=8C =EF=BC=88SCHED_SOFTIRQ=EF=BC=89=E3=80=82 diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3affa9a6b249..d56ebe8230bc 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5689,7 +5689,7 @@ void sched_tick(void) =20 #ifdef CONFIG_SMP rq->idle_balance =3D idle_cpu(cpu); - trigger_load_balance(rq); + sched_balance_trigger(rq); #endif } =20 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 953f39deb68e..e377b675920a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12438,7 +12438,7 @@ static __latent_entropy void sched_balance_softirq(= struct softirq_action *h) /* * Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing. */ -void trigger_load_balance(struct rq *rq) +void sched_balance_trigger(struct rq *rq) { /* * Don't need to rebalance while attached to NULL domain or diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index d2242679239e..5b0ddb0e6017 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2397,7 +2397,7 @@ extern struct task_struct *pick_next_task_idle(struct= rq *rq); =20 extern void update_group_capacity(struct sched_domain *sd, int cpu); =20 -extern void trigger_load_balance(struct rq *rq); +extern void sched_balance_trigger(struct rq *rq); =20 extern void set_cpus_allowed_common(struct task_struct *p, struct affinity= _context *ctx); =20 --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 D126B56470 for ; Fri, 8 Mar 2024 11:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896719; cv=none; b=aLBMl58t6dlZNsJXXGy9YqYOtlcIWiYicjHopTUEACDL0WDfrOUCA+r+F/H+Nv0RhVW7g0vYsKzoGzDkfor0a/eDCF/jf2qyw35bcb5iObHFsyTw8I5GXW0bzlKEENHdbpx7dtyv8wjwn26Mq9oVIlnIpcPvmjEIgAJxRHVMp1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896719; c=relaxed/simple; bh=L8lafKDdMvn9EJ78tUaB5RQaPJsItc6VfHZEgy27vM4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=UszSaZn0DQMLUJ0yy4SrgOIxMKhUlLHN8EnzYrhcfLy/WKYtF7YCzMtUdKJuxQ70JixbMkbDHs3BwXoD+gIwk7VQKODeTN2cRtZjVk4zhlgGe3eMmDvpLX/HG7ued16EBBdkm1oM2uIscg0MrEcHzt9VMCxc1KHnT/3PP5Z7VX0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=S93+uT/1; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S93+uT/1" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4131bbb7fbcso1275135e9.2 for ; Fri, 08 Mar 2024 03:18:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896716; x=1710501516; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=rEG8SsO50Sv7fjH2Pfb6/80Dg/X78lX+4wLY8v7JRQE=; b=S93+uT/1AKOd/2uCNx43xexTE4pYP1d24+nKwSKjfVMbHdPjQ/Pg60RdcrQ51EN6IN ZLRG8Sl3scQnmDiijTDIC+5mCmr53XTBVdMMzGQu4NhhOaucc+3xqZ0TpXGwwEzYriQH tdeBis97IZIl+Ir83eHFCcYkezxwsIBSmWpkbB2873lAOwB7wYOh06+kuCCRiXFdqOi2 8bz1A3qtrSg6QG3kBhnFutX67xrpK1DgSuNZdV4VL6Ci9MGLw+48JI/KI/NvD94f5knu ShYgplHn/NSq+uHYnIml2YSSYnfVPRnvzokZPmZ+iZlgXhIHBoBT9V5J4N9Wl7oaBnQs E6gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896716; x=1710501516; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rEG8SsO50Sv7fjH2Pfb6/80Dg/X78lX+4wLY8v7JRQE=; b=l3OZUrAdROMr6xXnzmIWhBGp02tqq0u25J+wx3ci3SxacYuz+NfTYJEEr6gqrLZSHQ FJ8hqD+lm4oyGFjy1uAmpB5TvUGDf5g4q1rQGt1OAzPCqVLPm/iTCu1Uc9qodIJ2RES5 GvKbkm3SfUoRkJO3btlNsq+QkS5xPt1zSBHI/eXhi2R2I0jk2zY2zmIrRTCHgjiarcGI vOA7KHfrDqhphjYJ+29qHxmsXbITRs/gPn4S83Wh2ULMCrR57XEP4GMrKc60qe0DEEUb pSQ+7YeFg2evUXUHeDBo5ENes0oKnF0R3N7EHuvBiY3tsP0dtWFKqc9gkTMFZLmajuJ9 +u5w== X-Gm-Message-State: AOJu0YwX9igbEt1DfvSJUtHNH4H6v7l1YbwwE1i7MS+71tSfaX/kpd3b tfab0JBTjMuOKmKhTevQ4emL/0t23jQv4xk3M+jKSLZ0gwL57ZaXJOHNobvsfuc= X-Google-Smtp-Source: AGHT+IEEGohF2Hgc88Hig10dgi5nhxZypyL6ZJnV9HXjN9si0iG1jgbHuRi7acQd7W8NmtluUsPBSQ== X-Received: by 2002:adf:f94a:0:b0:33d:bb65:806d with SMTP id q10-20020adff94a000000b0033dbb65806dmr14960404wrr.50.1709896715830; Fri, 08 Mar 2024 03:18:35 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:35 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 04/13] sched/balancing: Rename rebalance_domains() => sched_balance_domains() Date: Fri, 8 Mar 2024 12:18:10 +0100 Message-Id: <20240308111819.1101550-5-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Standardize scheduler load-balancing function names on the sched_balance_() prefix. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- Documentation/scheduler/sched-domains.rst | 2 +- Documentation/translations/zh_CN/scheduler/sched-domains.rst | 2 +- arch/arm/kernel/topology.c | 2 +- kernel/sched/fair.c | 8 ++++---- kernel/sched/sched.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/scheduler/sched-domains.rst b/Documentation/sche= duler/sched-domains.rst index c7ea05f4107b..5d8e8b8b269e 100644 --- a/Documentation/scheduler/sched-domains.rst +++ b/Documentation/scheduler/sched-domains.rst @@ -34,7 +34,7 @@ out of balance are tasks moved between groups. In kernel/sched/core.c, sched_balance_trigger() is run periodically on eac= h CPU through sched_tick(). It raises a softirq after the next regularly schedul= ed rebalancing event for the current runqueue has arrived. The actual load -balancing workhorse, sched_balance_softirq()->rebalance_domains(), is then= run +balancing workhorse, sched_balance_softirq()->sched_balance_domains(), is = then run in softirq context (SCHED_SOFTIRQ). =20 The latter function takes two arguments: the runqueue of current CPU and w= hether diff --git a/Documentation/translations/zh_CN/scheduler/sched-domains.rst b= /Documentation/translations/zh_CN/scheduler/sched-domains.rst index 1a8587a971f9..e6590fd80640 100644 --- a/Documentation/translations/zh_CN/scheduler/sched-domains.rst +++ b/Documentation/translations/zh_CN/scheduler/sched-domains.rst @@ -36,7 +36,7 @@ CPU=E5=85=B1=E4=BA=AB=E3=80=82=E4=BB=BB=E6=84=8F=E4=B8=A4= =E4=B8=AA=E7=BB=84=E7=9A=84CPU=E6=8E=A9=E7=A0=81=E7=9A=84=E4=BA=A4=E9=9B=86= =E4=B8=8D=E4=B8=80=E5=AE=9A=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=A6=82=E6=9E=9C=E6= =98=AF=E8=BF=99 =20 =E5=9C=A8kernel/sched/core.c=E4=B8=AD=EF=BC=8Csched_balance_trigger()=E5= =9C=A8=E6=AF=8F=E4=B8=AACPU=E4=B8=8A=E9=80=9A=E8=BF=87sched_tick() =E5=91=A8=E6=9C=9F=E6=89=A7=E8=A1=8C=E3=80=82=E5=9C=A8=E5=BD=93=E5=89=8D= =E8=BF=90=E8=A1=8C=E9=98=9F=E5=88=97=E4=B8=8B=E4=B8=80=E4=B8=AA=E5=AE=9A=E6= =9C=9F=E8=B0=83=E5=BA=A6=E5=86=8D=E5=B9=B3=E8=A1=A1=E4=BA=8B=E4=BB=B6=E5=88= =B0=E8=BE=BE=E5=90=8E=EF=BC=8C=E5=AE=83=E5=BC=95=E5=8F=91=E4=B8=80=E4=B8=AA= =E8=BD=AF=E4=B8=AD=E6=96=AD=E3=80=82=E8=B4=9F=E8=BD=BD=E5=9D=87=E8=A1=A1=E7= =9C=9F=E6=AD=A3 -=E7=9A=84=E5=B7=A5=E4=BD=9C=E7=94=B1sched_balance_softirq()->rebalance_dom= ains()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=9C=A8=E8=BD=AF=E4=B8=AD=E6=96=AD=E4=B8= =8A=E4=B8=8B=E6=96=87=E4=B8=AD=E6=89=A7=E8=A1=8C +=E7=9A=84=E5=B7=A5=E4=BD=9C=E7=94=B1sched_balance_softirq()->sched_balance= _domains()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=9C=A8=E8=BD=AF=E4=B8=AD=E6=96=AD= =E4=B8=8A=E4=B8=8B=E6=96=87=E4=B8=AD=E6=89=A7=E8=A1=8C =EF=BC=88SCHED_SOFTIRQ=EF=BC=89=E3=80=82 =20 =E5=90=8E=E4=B8=80=E4=B8=AA=E5=87=BD=E6=95=B0=E6=9C=89=E4=B8=A4=E4=B8=AA= =E5=85=A5=E5=8F=82=EF=BC=9A=E5=BD=93=E5=89=8DCPU=E7=9A=84=E8=BF=90=E8=A1=8C= =E9=98=9F=E5=88=97=E3=80=81=E5=AE=83=E5=9C=A8sched_tick()=E8=B0=83=E7=94=A8= =E6=97=B6=E6=98=AF=E5=90=A6=E7=A9=BA=E9=97=B2=E3=80=82=E5=87=BD=E6=95=B0=E4= =BC=9A=E4=BB=8E diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index ef0058de432b..2336ee2aa44a 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -42,7 +42,7 @@ * can take this difference into account during load balance. A per cpu * structure is preferred because each CPU updates its own cpu_capacity fi= eld * during the load balance except for idle cores. One idle core is selected - * to run the rebalance_domains for all idle cores and the cpu_capacity ca= n be + * to run the sched_balance_domains for all idle cores and the cpu_capacit= y can be * updated during this sequence. */ =20 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e377b675920a..330788b0c617 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11685,7 +11685,7 @@ static inline bool update_newidle_cost(struct sched= _domain *sd, u64 cost) * * Balancing parameters are set up in init_sched_domains. */ -static void rebalance_domains(struct rq *rq, enum cpu_idle_type idle) +static void sched_balance_domains(struct rq *rq, enum cpu_idle_type idle) { int continue_balancing =3D 1; int cpu =3D rq->cpu; @@ -12161,7 +12161,7 @@ static void _nohz_idle_balance(struct rq *this_rq, = unsigned int flags) rq_unlock_irqrestore(rq, &rf); =20 if (flags & NOHZ_BALANCE_KICK) - rebalance_domains(rq, CPU_IDLE); + sched_balance_domains(rq, CPU_IDLE); } =20 if (time_after(next_balance, rq->next_balance)) { @@ -12422,7 +12422,7 @@ static __latent_entropy void sched_balance_softirq(= struct softirq_action *h) /* * If this CPU has a pending NOHZ_BALANCE_KICK, then do the * balancing on behalf of the other idle CPUs whose ticks are - * stopped. Do nohz_idle_balance *before* rebalance_domains to + * stopped. Do nohz_idle_balance *before* sched_balance_domains to * give the idle CPUs a chance to load balance. Else we may * load balance only within the local sched_domain hierarchy * and abort nohz_idle_balance altogether if we pull some load. @@ -12432,7 +12432,7 @@ static __latent_entropy void sched_balance_softirq(= struct softirq_action *h) =20 /* normal load balance */ update_blocked_averages(this_rq->cpu); - rebalance_domains(this_rq, idle); + sched_balance_domains(this_rq, idle); } =20 /* diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 5b0ddb0e6017..41024c1c49b4 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2904,7 +2904,7 @@ extern void cfs_bandwidth_usage_dec(void); #define NOHZ_NEWILB_KICK_BIT 2 #define NOHZ_NEXT_KICK_BIT 3 =20 -/* Run rebalance_domains() */ +/* Run sched_balance_domains() */ #define NOHZ_BALANCE_KICK BIT(NOHZ_BALANCE_KICK_BIT) /* Update blocked load */ #define NOHZ_STATS_KICK BIT(NOHZ_STATS_KICK_BIT) --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 E1BC256761 for ; Fri, 8 Mar 2024 11:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896721; cv=none; b=f+iQCrczfQNT/5QvN6oLY+jYvNG2X73MH8P0dZi5zwoBX2z/I4ZYnhIKJDbwt68QAANYAcewqUU6IAcCFl2NtMiZ/Kae8ZxK4NnIKnOcSEm6ZRSSfG+2SkldUYbxWBqP4giBJ26M/zNIdbGH3273XISP7BtkBu2fBWfMQTgeZPY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896721; c=relaxed/simple; bh=+vVG2QYkF0mp4T5ALGhtl7UkYSxy7vS8aoVqlykA/50=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Xuq3vjLm4T2R4BiqV+JFF/5m23L+uLr776fi1m5E7zXCmi66ptjV0v9IMUf6gC6syq17LCmmUh3VDhAmSqGJpHG4NvC0ZhIoii8Y6sM9XAmP91sboI/Lu1TBi7V+yCtR7aUfFEYUxhj1b2DevgA5tLWzFP0bAbN6SSF+AJlpGhg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SNCZHDj0; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SNCZHDj0" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-33e1878e357so1288499f8f.3 for ; Fri, 08 Mar 2024 03:18:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896717; x=1710501517; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=estP9Tu8p0RmYA73Y3Xz5YQtwlvzKHk4Qvv5GZzWF7s=; b=SNCZHDj05/cfAxHM3DXmxs4C4qNRP572GU4BHIXTPCsBjgC6KxUS3ZLi+8N+1KZ/qh S7B7Dzr1mz9+FtnOjnw6vstK3sRPHrBbzXej5NvvEOFjg3gLdClo/mIfjQ941ovcoHHU iLYV0dzkRAFudn2XIC+GbMeBmepo4X3b4psohFvDHtN0zH2lNv5UwfMR5oNY3hOFgSj+ oElaej9ty2x37jCpH2qmSjKcsEGlG1vpG1QrHxiB53Zv2jQPmKukJFjvDCudRmF+J9Ex GMHMmxlxrzbRSBU439iV0bP+u1vEEK+E9/Q6XD8lZIkbV0MRkzZ4u8sxYNhR5NtG/ZCn nFbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896717; x=1710501517; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=estP9Tu8p0RmYA73Y3Xz5YQtwlvzKHk4Qvv5GZzWF7s=; b=tkqi+s/eAATzlSLf0PtYN2dxi0xqrlRJKA7Vcfo+E+YgaDCVHFPwRdhsGpdHwZzJ8T 0Vu+8eEbR7IbD6HkayBwTGRvMI485cfacbxmAcrcJFzl2N6zlttDfTtBQsWpPm/Bnltm U9nirOF4TTzcKK7BzLyPx8+U2ZYur1MEvD4rfPVJkXodJ35YpfnSqPS9A/gkLXucNDu1 PkFHq0WWIiikhwgXx1RLbGBOSj5CX2m6IFtXikIPzrk3I3GdRJMExL98cr9SOeTCjD1+ huwv2JQOBWB6cps6uJ/89oysE6+mIVBnduhvRlQB82K0EckeswU6yWwTtnLf0JKfcX2W dO1Q== X-Gm-Message-State: AOJu0YybBWSpByUuq3AgGPtbJB05MEMO1riiyy7S6WnnP+MiHHsAPrUl GSIWDWAu5pXwiXHqN4fznHihVflf6OwwlXC12NjEdRy9+1YyDz9P13ppBmUlOgo= X-Google-Smtp-Source: AGHT+IHDH8xDoNw2OwWwMve0rNWfpnp3DzzP5dVPbV06WxpJPSIdlcShVf1OSxsgKkAlGAYq356RIQ== X-Received: by 2002:adf:f350:0:b0:33e:592c:d7e5 with SMTP id e16-20020adff350000000b0033e592cd7e5mr5477886wrp.31.1709896716949; Fri, 08 Mar 2024 03:18:36 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:36 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 05/13] sched/balancing: Rename load_balance() => sched_balance_rq() Date: Fri, 8 Mar 2024 12:18:11 +0100 Message-Id: <20240308111819.1101550-6-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Standardize scheduler load-balancing function names on the sched_balance_() prefix. Also load_balance() has become somewhat of a misnomer: historically it was the first and primary load-balancing function that was called, but with the introduction of sched domains, it's become a lower layer function that balances runqueues. Rename it to sched_balance_rq() accordingly. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot Reviewed-by: Shrikanth Hegde --- Documentation/scheduler/sched-domains.rst | 4 ++-- Documentation/scheduler/sched-stats.rst | 32 ++++++++= ++++++++---------------- Documentation/translations/zh_CN/scheduler/sched-domains.rst | 4 ++-- Documentation/translations/zh_CN/scheduler/sched-stats.rst | 30 ++++++++= +++++++--------------- include/linux/sched/topology.h | 2 +- kernel/sched/fair.c | 10 +++++---= -- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Documentation/scheduler/sched-domains.rst b/Documentation/sche= duler/sched-domains.rst index 5d8e8b8b269e..5e996fe973b1 100644 --- a/Documentation/scheduler/sched-domains.rst +++ b/Documentation/scheduler/sched-domains.rst @@ -41,11 +41,11 @@ The latter function takes two arguments: the runqueue o= f current CPU and whether the CPU was idle at the time the sched_tick() happened and iterates over a= ll sched domains our CPU is on, starting from its base domain and going up th= e ->parent chain. While doing that, it checks to see if the current domain has exhaus= ted its -rebalance interval. If so, it runs load_balance() on that domain. It then = checks +rebalance interval. If so, it runs sched_balance_rq() on that domain. It t= hen checks the parent sched_domain (if it exists), and the parent of the parent and so forth. =20 -Initially, load_balance() finds the busiest group in the current sched dom= ain. +Initially, sched_balance_rq() finds the busiest group in the current sched= domain. If it succeeds, it looks for the busiest runqueue of all the CPUs' runqueu= es in that group. If it manages to find such a runqueue, it locks both our initi= al CPU's runqueue and the newly found busiest one and starts moving tasks fro= m it diff --git a/Documentation/scheduler/sched-stats.rst b/Documentation/schedu= ler/sched-stats.rst index 03c062915998..afb39be7d6d2 100644 --- a/Documentation/scheduler/sched-stats.rst +++ b/Documentation/scheduler/sched-stats.rst @@ -72,53 +72,53 @@ domain 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15= 16 17 18 19 20 21 22 23 =20 The first field is a bit mask indicating what cpus this domain operates ov= er. =20 -The next 24 are a variety of load_balance() statistics in grouped into typ= es +The next 24 are a variety of sched_balance_rq() statistics in grouped into= types of idleness (idle, busy, and newly idle): =20 - 1) # of times in this domain load_balance() was called when the + 1) # of times in this domain sched_balance_rq() was called when the cpu was idle - 2) # of times in this domain load_balance() checked but found + 2) # of times in this domain sched_balance_rq() checked but found the load did not require balancing when the cpu was idle - 3) # of times in this domain load_balance() tried to move one or + 3) # of times in this domain sched_balance_rq() tried to move one or more tasks and failed, when the cpu was idle 4) sum of imbalances discovered (if any) with each call to - load_balance() in this domain when the cpu was idle + sched_balance_rq() in this domain when the cpu was idle 5) # of times in this domain pull_task() was called when the cpu was idle 6) # of times in this domain pull_task() was called even though the target task was cache-hot when idle - 7) # of times in this domain load_balance() was called but did + 7) # of times in this domain sched_balance_rq() was called but did not find a busier queue while the cpu was idle 8) # of times in this domain a busier queue was found while the cpu was idle but no busier group was found - 9) # of times in this domain load_balance() was called when the + 9) # of times in this domain sched_balance_rq() was called when the cpu was busy - 10) # of times in this domain load_balance() checked but found the + 10) # of times in this domain sched_balance_rq() checked but found the load did not require balancing when busy - 11) # of times in this domain load_balance() tried to move one or + 11) # of times in this domain sched_balance_rq() tried to move one or more tasks and failed, when the cpu was busy 12) sum of imbalances discovered (if any) with each call to - load_balance() in this domain when the cpu was busy + sched_balance_rq() in this domain when the cpu was busy 13) # of times in this domain pull_task() was called when busy 14) # of times in this domain pull_task() was called even though the target task was cache-hot when busy - 15) # of times in this domain load_balance() was called but did not + 15) # of times in this domain sched_balance_rq() was called but did not find a busier queue while the cpu was busy 16) # of times in this domain a busier queue was found while the cpu was busy but no busier group was found =20 - 17) # of times in this domain load_balance() was called when the + 17) # of times in this domain sched_balance_rq() was called when the cpu was just becoming idle - 18) # of times in this domain load_balance() checked but found the + 18) # of times in this domain sched_balance_rq() checked but found the load did not require balancing when the cpu was just becoming idle - 19) # of times in this domain load_balance() tried to move one or more + 19) # of times in this domain sched_balance_rq() tried to move one or = more tasks and failed, when the cpu was just becoming idle 20) sum of imbalances discovered (if any) with each call to - load_balance() in this domain when the cpu was just becoming idle + sched_balance_rq() in this domain when the cpu was just becoming i= dle 21) # of times in this domain pull_task() was called when newly idle 22) # of times in this domain pull_task() was called even though the target task was cache-hot when just becoming idle - 23) # of times in this domain load_balance() was called but did not + 23) # of times in this domain sched_balance_rq() was called but did not find a busier queue while the cpu was just becoming idle 24) # of times in this domain a busier queue was found while the cpu was just becoming idle but no busier group was found diff --git a/Documentation/translations/zh_CN/scheduler/sched-domains.rst b= /Documentation/translations/zh_CN/scheduler/sched-domains.rst index e6590fd80640..06363169c56b 100644 --- a/Documentation/translations/zh_CN/scheduler/sched-domains.rst +++ b/Documentation/translations/zh_CN/scheduler/sched-domains.rst @@ -42,9 +42,9 @@ CPU=E5=85=B1=E4=BA=AB=E3=80=82=E4=BB=BB=E6=84=8F=E4=B8=A4= =E4=B8=AA=E7=BB=84=E7=9A=84CPU=E6=8E=A9=E7=A0=81=E7=9A=84=E4=BA=A4=E9=9B=86= =E4=B8=8D=E4=B8=80=E5=AE=9A=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=A6=82=E6=9E=9C=E6= =98=AF=E8=BF=99 =E5=90=8E=E4=B8=80=E4=B8=AA=E5=87=BD=E6=95=B0=E6=9C=89=E4=B8=A4=E4=B8=AA= =E5=85=A5=E5=8F=82=EF=BC=9A=E5=BD=93=E5=89=8DCPU=E7=9A=84=E8=BF=90=E8=A1=8C= =E9=98=9F=E5=88=97=E3=80=81=E5=AE=83=E5=9C=A8sched_tick()=E8=B0=83=E7=94=A8= =E6=97=B6=E6=98=AF=E5=90=A6=E7=A9=BA=E9=97=B2=E3=80=82=E5=87=BD=E6=95=B0=E4= =BC=9A=E4=BB=8E =E5=BD=93=E5=89=8DCPU=E6=89=80=E5=9C=A8=E7=9A=84=E5=9F=BA=E8=B0=83=E5=BA= =A6=E5=9F=9F=E5=BC=80=E5=A7=8B=E8=BF=AD=E4=BB=A3=E6=89=A7=E8=A1=8C=EF=BC=8C= =E5=B9=B6=E6=B2=BF=E7=9D=80parent=E6=8C=87=E9=92=88=E9=93=BE=E5=90=91=E4=B8= =8A=E8=BF=9B=E5=85=A5=E6=9B=B4=E9=AB=98=E5=B1=82=E7=BA=A7=E7=9A=84=E8=B0=83= =E5=BA=A6=E5=9F=9F=E3=80=82=E5=9C=A8=E8=BF=AD=E4=BB=A3 =E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E5=87=BD=E6=95=B0=E4=BC=9A=E6=A3=80= =E6=9F=A5=E5=BD=93=E5=89=8D=E8=B0=83=E5=BA=A6=E5=9F=9F=E6=98=AF=E5=90=A6=E5= =B7=B2=E7=BB=8F=E8=80=97=E5=B0=BD=E4=BA=86=E5=86=8D=E5=B9=B3=E8=A1=A1=E7=9A= =84=E6=97=B6=E9=97=B4=E9=97=B4=E9=9A=94=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF= =EF=BC=8C=E5=AE=83=E5=9C=A8=E8=AF=A5=E8=B0=83=E5=BA=A6=E5=9F=9F=E8=BF=90=E8= =A1=8C -load_balance()=E3=80=82=E6=8E=A5=E4=B8=8B=E6=9D=A5=E5=AE=83=E6=A3=80=E6=9F= =A5=E7=88=B6=E8=B0=83=E5=BA=A6=E5=9F=9F=EF=BC=88=E5=A6=82=E6=9E=9C=E5=AD=98= =E5=9C=A8=EF=BC=89=EF=BC=8C=E5=86=8D=E5=90=8E=E6=9D=A5=E7=88=B6=E8=B0=83=E5= =BA=A6=E5=9F=9F=E7=9A=84=E7=88=B6=E8=B0=83=E5=BA=A6=E5=9F=9F=EF=BC=8C=E4=BB= =A5=E6=AD=A4=E7=B1=BB=E6=8E=A8=E3=80=82 +sched_balance_rq()=E3=80=82=E6=8E=A5=E4=B8=8B=E6=9D=A5=E5=AE=83=E6=A3=80= =E6=9F=A5=E7=88=B6=E8=B0=83=E5=BA=A6=E5=9F=9F=EF=BC=88=E5=A6=82=E6=9E=9C=E5= =AD=98=E5=9C=A8=EF=BC=89=EF=BC=8C=E5=86=8D=E5=90=8E=E6=9D=A5=E7=88=B6=E8=B0= =83=E5=BA=A6=E5=9F=9F=E7=9A=84=E7=88=B6=E8=B0=83=E5=BA=A6=E5=9F=9F=EF=BC=8C= =E4=BB=A5=E6=AD=A4=E7=B1=BB=E6=8E=A8=E3=80=82 =20 -=E8=B5=B7=E5=88=9D=EF=BC=8Cload_balance()=E6=9F=A5=E6=89=BE=E5=BD=93=E5=89= =8D=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E6=9C=80=E7=B9=81=E5=BF=99=E7=9A=84= =E8=B0=83=E5=BA=A6=E7=BB=84=E3=80=82=E5=A6=82=E6=9E=9C=E6=88=90=E5=8A=9F=EF= =BC=8C=E5=9C=A8=E8=AF=A5=E8=B0=83=E5=BA=A6=E7=BB=84=E7=AE=A1=E8=BE=96=E7=9A= =84=E5=85=A8=E9=83=A8CPU +=E8=B5=B7=E5=88=9D=EF=BC=8Csched_balance_rq()=E6=9F=A5=E6=89=BE=E5=BD=93= =E5=89=8D=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E6=9C=80=E7=B9=81=E5=BF=99=E7= =9A=84=E8=B0=83=E5=BA=A6=E7=BB=84=E3=80=82=E5=A6=82=E6=9E=9C=E6=88=90=E5=8A= =9F=EF=BC=8C=E5=9C=A8=E8=AF=A5=E8=B0=83=E5=BA=A6=E7=BB=84=E7=AE=A1=E8=BE=96= =E7=9A=84=E5=85=A8=E9=83=A8CPU =E7=9A=84=E8=BF=90=E8=A1=8C=E9=98=9F=E5=88=97=E4=B8=AD=E6=89=BE=E5=87=BA= =E6=9C=80=E7=B9=81=E5=BF=99=E7=9A=84=E8=BF=90=E8=A1=8C=E9=98=9F=E5=88=97=E3= =80=82=E5=A6=82=E8=83=BD=E6=89=BE=E5=88=B0=EF=BC=8C=E5=AF=B9=E5=BD=93=E5=89= =8D=E7=9A=84CPU=E8=BF=90=E8=A1=8C=E9=98=9F=E5=88=97=E5=92=8C=E6=96=B0=E6=89= =BE=E5=88=B0=E7=9A=84=E6=9C=80=E7=B9=81=E5=BF=99=E8=BF=90=E8=A1=8C =E9=98=9F=E5=88=97=E5=9D=87=E5=8A=A0=E9=94=81=EF=BC=8C=E5=B9=B6=E6=8A=8A= =E4=BB=BB=E5=8A=A1=E4=BB=8E=E6=9C=80=E7=B9=81=E5=BF=99=E9=98=9F=E5=88=97=E4= =B8=AD=E8=BF=81=E7=A7=BB=E5=88=B0=E5=BD=93=E5=89=8DCPU=E4=B8=8A=E3=80=82=E8= =A2=AB=E8=BF=81=E7=A7=BB=E7=9A=84=E4=BB=BB=E5=8A=A1=E6=95=B0=E9=87=8F=E7=AD= =89=E4=BA=8E=E5=9C=A8=E5=85=88=E5=89=8D=E8=BF=AD=E4=BB=A3=E6=89=A7=E8=A1=8C =E4=B8=AD=E8=AE=A1=E7=AE=97=E5=87=BA=E7=9A=84=E8=AF=A5=E8=B0=83=E5=BA=A6= =E5=9F=9F=E7=9A=84=E8=B0=83=E5=BA=A6=E7=BB=84=E7=9A=84=E4=B8=8D=E5=9D=87=E8= =A1=A1=E5=80=BC=E3=80=82 diff --git a/Documentation/translations/zh_CN/scheduler/sched-stats.rst b/D= ocumentation/translations/zh_CN/scheduler/sched-stats.rst index c5e0be663837..09eee2517610 100644 --- a/Documentation/translations/zh_CN/scheduler/sched-stats.rst +++ b/Documentation/translations/zh_CN/scheduler/sched-stats.rst @@ -75,42 +75,42 @@ domain 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15= 16 17 18 19 20 21 22 23 =E7=B9=81=E5=BF=99=EF=BC=8C=E6=96=B0=E7=A9=BA=E9=97=B2=EF=BC=89=EF=BC=9A =20 =20 - 1) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=E4=BA=86#=E6=AC=A1 - 2) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E4=BD=86=E6=98=AF=E5=8F=91=E7=8E=B0=E8=B4=9F=E8=BD=BD= =E6=97=A0=E9=9C=80 + 1) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=E4=BA=86#=E6=AC=A1 + 2) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E4=BD=86=E6=98=AF=E5=8F=91=E7=8E=B0=E8=B4=9F=E8=BD= =BD=E6=97=A0=E9=9C=80 =E5=9D=87=E8=A1=A1#=E6=AC=A1 - 3) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E8=AF=95=E5=9B=BE=E8=BF=81=E7=A7=BB1=E4=B8=AA=E6=88= =96=E6=9B=B4=E5=A4=9A + 3) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E8=AF=95=E5=9B=BE=E8=BF=81=E7=A7=BB1=E4=B8=AA=E6= =88=96=E6=9B=B4=E5=A4=9A =E4=BB=BB=E5=8A=A1=E4=B8=94=E5=A4=B1=E8=B4=A5=E4=BA=86#=E6=AC=A1 - 4) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E5=8F=91=E7=8E=B0=E4=B8=8D=E5=9D=87=E8=A1=A1=EF=BC=88= =E5=A6=82=E6=9E=9C=E6=9C=89=EF=BC=89 + 4) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E5=8F=91=E7=8E=B0=E4=B8=8D=E5=9D=87=E8=A1=A1=EF=BC= =88=E5=A6=82=E6=9E=9C=E6=9C=89=EF=BC=89 #=E6=AC=A1 5) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cpull_task()=E5=9C= =A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0=83= =E7=94=A8#=E6=AC=A1 6) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8C=E5=B0=BD=E7=AE=A1= =E7=9B=AE=E6=A0=87=E4=BB=BB=E5=8A=A1=E6=98=AF=E7=83=AD=E7=BC=93=E5=AD=98=E7= =8A=B6=E6=80=81=EF=BC=8Cpull_task()=E4=BE=9D=E7=84=B6=E8=A2=AB=E8=B0=83=E7= =94=A8#=E6=AC=A1 - 7) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E6=9C=AA=E8=83=BD=E6=89=BE=E5=88=B0=E6=9B=B4=E7=B9=81= =E5=BF=99=E7=9A=84 + 7) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E6=9C=AA=E8=83=BD=E6=89=BE=E5=88=B0=E6=9B=B4=E7=B9= =81=E5=BF=99=E7=9A=84 =E9=98=9F=E5=88=97#=E6=AC=A1 8) =E5=BD=93CPU=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8C=E5=9C=A8=E8=B0=83= =E5=BA=A6=E5=9F=9F=E4=B8=AD=E6=89=BE=E5=88=B0=E4=BA=86=E6=9B=B4=E7=B9=81=E5= =BF=99=E7=9A=84=E9=98=9F=E5=88=97=EF=BC=8C=E4=BD=86=E6=9C=AA=E6=89=BE=E5=88= =B0=E6=9B=B4=E7=B9=81=E5=BF=99=E7=9A=84=E8=B0=83=E5=BA=A6=E7=BB=84 #=E6=AC=A1 - 9) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=E4=BA=86#=E6=AC=A1 - 10) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E4=BD=86=E6=98=AF=E5=8F=91=E7=8E=B0=E8=B4=9F=E8=BD=BD= =E6=97=A0=E9=9C=80 + 9) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=E4=BA=86#=E6=AC=A1 + 10) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E4=BD=86=E6=98=AF=E5=8F=91=E7=8E=B0=E8=B4=9F=E8=BD= =BD=E6=97=A0=E9=9C=80 =E5=9D=87=E8=A1=A1#=E6=AC=A1 - 11) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E8=AF=95=E5=9B=BE=E8=BF=81=E7=A7=BB1=E4=B8=AA=E6=88= =96=E6=9B=B4=E5=A4=9A + 11) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E8=AF=95=E5=9B=BE=E8=BF=81=E7=A7=BB1=E4=B8=AA=E6= =88=96=E6=9B=B4=E5=A4=9A =E4=BB=BB=E5=8A=A1=E4=B8=94=E5=A4=B1=E8=B4=A5=E4=BA=86#=E6=AC=A1 - 12) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E5=8F=91=E7=8E=B0=E4=B8=8D=E5=9D=87=E8=A1=A1=EF=BC=88= =E5=A6=82=E6=9E=9C=E6=9C=89=EF=BC=89 + 12) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E5=8F=91=E7=8E=B0=E4=B8=8D=E5=9D=87=E8=A1=A1=EF=BC= =88=E5=A6=82=E6=9E=9C=E6=9C=89=EF=BC=89 #=E6=AC=A1 13) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Cpull_task()=E5=9C= =A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0=83= =E7=94=A8#=E6=AC=A1 14) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8C=E5=B0=BD=E7=AE=A1= =E7=9B=AE=E6=A0=87=E4=BB=BB=E5=8A=A1=E6=98=AF=E7=83=AD=E7=BC=93=E5=AD=98=E7= =8A=B6=E6=80=81=EF=BC=8Cpull_task()=E4=BE=9D=E7=84=B6=E8=A2=AB=E8=B0=83=E7= =94=A8#=E6=AC=A1 - 15) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Cload_balance()=E5= =9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8=B0= =83=E7=94=A8=EF=BC=8C=E6=9C=AA=E8=83=BD=E6=89=BE=E5=88=B0=E6=9B=B4=E7=B9=81= =E5=BF=99=E7=9A=84 + 15) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8Csched_balance_rq()= =E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB=E8= =B0=83=E7=94=A8=EF=BC=8C=E6=9C=AA=E8=83=BD=E6=89=BE=E5=88=B0=E6=9B=B4=E7=B9= =81=E5=BF=99=E7=9A=84 =E9=98=9F=E5=88=97#=E6=AC=A1 16) =E5=BD=93CPU=E7=B9=81=E5=BF=99=E6=97=B6=EF=BC=8C=E5=9C=A8=E8=B0=83= =E5=BA=A6=E5=9F=9F=E4=B8=AD=E6=89=BE=E5=88=B0=E4=BA=86=E6=9B=B4=E7=B9=81=E5= =BF=99=E7=9A=84=E9=98=9F=E5=88=97=EF=BC=8C=E4=BD=86=E6=9C=AA=E6=89=BE=E5=88= =B0=E6=9B=B4=E7=B9=81=E5=BF=99=E7=9A=84=E8=B0=83=E5=BA=A6=E7=BB=84 #=E6=AC=A1 - 17) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_bala= nce()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2= =AB=E8=B0=83=E7=94=A8=E4=BA=86#=E6=AC=A1 - 18) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_bala= nce()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2= =AB=E8=B0=83=E7=94=A8=EF=BC=8C=E4=BD=86=E6=98=AF=E5=8F=91=E7=8E=B0=E8=B4=9F= =E8=BD=BD=E6=97=A0=E9=9C=80 + 17) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_bal= ance_rq()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8= =A2=AB=E8=B0=83=E7=94=A8=E4=BA=86#=E6=AC=A1 + 18) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_bal= ance_rq()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8= =A2=AB=E8=B0=83=E7=94=A8=EF=BC=8C=E4=BD=86=E6=98=AF=E5=8F=91=E7=8E=B0=E8=B4= =9F=E8=BD=BD=E6=97=A0=E9=9C=80 =E5=9D=87=E8=A1=A1#=E6=AC=A1 - 19) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_bala= nce()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2= =AB=E8=B0=83=E7=94=A8=EF=BC=8C=E8=AF=95=E5=9B=BE=E8=BF=81=E7=A7=BB1=E4=B8= =AA=E6=88=96=E6=9B=B4=E5=A4=9A + 19) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_bal= ance_rq()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8= =A2=AB=E8=B0=83=E7=94=A8=EF=BC=8C=E8=AF=95=E5=9B=BE=E8=BF=81=E7=A7=BB1=E4= =B8=AA=E6=88=96=E6=9B=B4=E5=A4=9A =E4=BB=BB=E5=8A=A1=E4=B8=94=E5=A4=B1=E8=B4=A5=E4=BA=86#=E6=AC=A1 - 20) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_bala= nce()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2= =AB=E8=B0=83=E7=94=A8=EF=BC=8C=E5=8F=91=E7=8E=B0=E4=B8=8D=E5=9D=87=E8=A1=A1= =EF=BC=88=E5=A6=82=E6=9E=9C=E6=9C=89=EF=BC=89 + 20) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_bal= ance_rq()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8= =A2=AB=E8=B0=83=E7=94=A8=EF=BC=8C=E5=8F=91=E7=8E=B0=E4=B8=8D=E5=9D=87=E8=A1= =A1=EF=BC=88=E5=A6=82=E6=9E=9C=E6=9C=89=EF=BC=89 #=E6=AC=A1 21) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cpull_task= ()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2=AB= =E8=B0=83=E7=94=A8#=E6=AC=A1 22) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8C=E5=B0=BD= =E7=AE=A1=E7=9B=AE=E6=A0=87=E4=BB=BB=E5=8A=A1=E6=98=AF=E7=83=AD=E7=BC=93=E5= =AD=98=E7=8A=B6=E6=80=81=EF=BC=8Cpull_task()=E4=BE=9D=E7=84=B6=E8=A2=AB=E8= =B0=83=E7=94=A8#=E6=AC=A1 - 23) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Cload_bala= nce()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8=A2= =AB=E8=B0=83=E7=94=A8=EF=BC=8C=E6=9C=AA=E8=83=BD=E6=89=BE=E5=88=B0=E6=9B=B4= =E7=B9=81=E5=BF=99=E7=9A=84 + 23) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8Csched_bal= ance_rq()=E5=9C=A8=E8=BF=99=E4=B8=AA=E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E8= =A2=AB=E8=B0=83=E7=94=A8=EF=BC=8C=E6=9C=AA=E8=83=BD=E6=89=BE=E5=88=B0=E6=9B= =B4=E7=B9=81=E5=BF=99=E7=9A=84 =E9=98=9F=E5=88=97#=E6=AC=A1 24) =E5=BD=93CPU=E6=96=B0=E7=A9=BA=E9=97=B2=E6=97=B6=EF=BC=8C=E5=9C=A8= =E8=B0=83=E5=BA=A6=E5=9F=9F=E4=B8=AD=E6=89=BE=E5=88=B0=E4=BA=86=E6=9B=B4=E7= =B9=81=E5=BF=99=E7=9A=84=E9=98=9F=E5=88=97=EF=BC=8C=E4=BD=86=E6=9C=AA=E6=89= =BE=E5=88=B0=E6=9B=B4=E7=B9=81=E5=BF=99=E7=9A=84=E8=B0=83=E5=BA=A6=E7=BB=84 #=E6=AC=A1 diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 191b122158fb..f0b721b5d42d 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -110,7 +110,7 @@ struct sched_domain { unsigned long last_decay_max_lb_cost; =20 #ifdef CONFIG_SCHEDSTATS - /* load_balance() stats */ + /* sched_balance_rq() stats */ unsigned int lb_count[CPU_MAX_IDLE_TYPES]; unsigned int lb_failed[CPU_MAX_IDLE_TYPES]; unsigned int lb_balanced[CPU_MAX_IDLE_TYPES]; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 330788b0c617..0d2753c50be9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6866,7 +6866,7 @@ static void dequeue_task_fair(struct rq *rq, struct t= ask_struct *p, int flags) =20 #ifdef CONFIG_SMP =20 -/* Working cpumask for: load_balance, load_balance_newidle. */ +/* Working cpumask for: sched_balance_rq, load_balance_newidle. */ static DEFINE_PER_CPU(cpumask_var_t, load_balance_mask); static DEFINE_PER_CPU(cpumask_var_t, select_rq_mask); static DEFINE_PER_CPU(cpumask_var_t, should_we_balance_tmpmask); @@ -11242,7 +11242,7 @@ static int should_we_balance(struct lb_env *env) * Check this_cpu to ensure it is balanced within domain. Attempt to move * tasks if there is an imbalance. */ -static int load_balance(int this_cpu, struct rq *this_rq, +static int sched_balance_rq(int this_cpu, struct rq *this_rq, struct sched_domain *sd, enum cpu_idle_type idle, int *continue_balancing) { @@ -11647,7 +11647,7 @@ static int active_load_balance_cpu_stop(void *data) static atomic_t sched_balance_running =3D ATOMIC_INIT(0); =20 /* - * Scale the max load_balance interval with the number of CPUs in the syst= em. + * Scale the max sched_balance_rq interval with the number of CPUs in the = system. * This trades load-balance latency on larger machines for less cross talk. */ void update_max_interval(void) @@ -11727,7 +11727,7 @@ static void sched_balance_domains(struct rq *rq, en= um cpu_idle_type idle) } =20 if (time_after_eq(jiffies, sd->last_balance + interval)) { - if (load_balance(cpu, rq, sd, idle, &continue_balancing)) { + if (sched_balance_rq(cpu, rq, sd, idle, &continue_balancing)) { /* * The LBF_DST_PINNED logic could have changed * env->dst_cpu, so we can't know our idle @@ -12353,7 +12353,7 @@ static int newidle_balance(struct rq *this_rq, stru= ct rq_flags *rf) =20 if (sd->flags & SD_BALANCE_NEWIDLE) { =20 - pulled_task =3D load_balance(this_cpu, this_rq, + pulled_task =3D sched_balance_rq(this_cpu, this_rq, sd, CPU_NEWLY_IDLE, &continue_balancing); =20 --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 01A2E57865 for ; Fri, 8 Mar 2024 11:18:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896721; cv=none; b=ShaZu5vBL9pMisHp9/SD1v8zjjn9Vg3XSm0QoaxsycgWsOCGvyV4xNKXNE8yled3u1V8FycmsaOojEOJ7rJlxL+HmIbAPtgQUly9qBLqBIrZhEtgXYC0jdPHOa3XRMGhLKHAjddfd/SJyjx97HkgLRUqgc9bj8U74Pu1ztDK3As= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896721; c=relaxed/simple; bh=AESe7ke6Yrm588PLCrye9y338EkZkbZJPxKaorzKjI8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F/YYtDucBRtMuvJgG+T/gkEl89TB0zoLeKQKEGCwxIdT5JWIOUrviAGck0qq01fb6y0V8VgRPo153+e6KkKx6EyC6xv0iUuij6q+Y35W63BdEPkdhMnY/2JHr306iTX2Cj6RELvCwJLOfNqGaw8XV9SD94WzwG+05Vq1RI2V2S0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TAuu3gKT; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TAuu3gKT" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-33e162b1b71so1781112f8f.1 for ; Fri, 08 Mar 2024 03:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896718; x=1710501518; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=pNmM6RIenOn/m5YEPt0cx45ySsFNjYzl8lKQCamjeno=; b=TAuu3gKTdY5auzwqLtXbMRl5+QB6F8eA/A9T8np//UWNEVYAqdCuNIXE4CCvWJqajo 3OyQzjpUVwwVRL5btNbrWVDs60LE9XkBgyvqWrSaxo1mgYdrQlX8HkU4wjNpkRB4wqfI eoX2PCjml1XtbS88VNKKboqJiuNRhiLK0qjUJDn1K8XROWlJneZMC022jcX5WxsTUEBF ae0xfc6UauHag/pmAgrfhO82ojFU3KoVaRywehNtm98HQSUcaknYpLaHqWxt+CIDB7N3 3vqMZkKf3brL0DqFH+V2Bn1s9W+3iELsdMcxhl3hfkrwJIiLVm/3+H7TF1hwL4NDLE26 rPmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896718; x=1710501518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pNmM6RIenOn/m5YEPt0cx45ySsFNjYzl8lKQCamjeno=; b=mEJTuEUFO0lAihSS3AnoGnLTcNInimGd4nNJgf/S7bfMDci+ZeKuyXSn/v2gsrA6gL lYPYiJ1lMD0ce+mFtNtv95REHtPpZ1R7Nb0w0JwynO09lHGCicxo65Pwp2T9InxSJsCB t3fOA8x3wUaV0nSUwSMx7dZ4u4K7deSzaQi2OPi/BO6Ypw64QkIxIwpnVzzRJbMxBHPC 2ISHCeRMC1snp/uVB0WxXWLEM5BgoWJv6kV8MowDvgCmJU5bI9/kGyGFMIby400sYl00 hkiJStoARvThPj86ewbjJJH3iMC79NhB3LbXYVsRPD7nDnZzNHoCsmNuApC/mfVTrQYw IytA== X-Gm-Message-State: AOJu0YyP1z+YbaynCbFWrGgNBbr89WoRppuV7FbHEOAi93hnGMZzT07Q gcqXMZiHt1oAvBJfR8DK/o4e/669zwMtwWsuPFspj7fNsk0xLJQl9hFkg4F7GsQ= X-Google-Smtp-Source: AGHT+IGwLQ2ttyzIU6BRrqrLkPlr9/1NOZYNLni4hMseXlcw3MQ0yLcmRzBgb5YXR+QdJHBG54qLFA== X-Received: by 2002:adf:b649:0:b0:33e:1f2b:a468 with SMTP id i9-20020adfb649000000b0033e1f2ba468mr15210958wre.24.1709896718127; Fri, 08 Mar 2024 03:18:38 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:37 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 06/13] sched/balancing: Rename find_busiest_queue() => find_src_rq() Date: Fri, 8 Mar 2024 12:18:12 +0100 Message-Id: <20240308111819.1101550-7-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The find_busiest_queue() naming has two small quirks: - Scheduler functions that deal with runqueues usually have a rq_ prefix or _rq postfix, but this function has neither. - Plus the 'busiest' qualifier to this function was historically correct, but has become somewhat of a misnomer: in quite a few cases we will not pick the busiest runqueue - but the best (possible) runqueue we can balance tasks from. So name it a bit more neutrally, similar to the 'src/dst' nomenclature we are already using when moving tasks between runqueues. To fix both quirks, rename it to find_src_rq(). Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0d2753c50be9..e600cac7806d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10959,9 +10959,9 @@ static struct sched_group *find_busiest_group(struc= t lb_env *env) } =20 /* - * find_busiest_queue - find the busiest runqueue among the CPUs in the gr= oup. + * find_src_rq - find the busiest runqueue among the CPUs in the group. */ -static struct rq *find_busiest_queue(struct lb_env *env, +static struct rq *find_src_rq(struct lb_env *env, struct sched_group *group) { struct rq *busiest =3D NULL, *rq; @@ -11280,7 +11280,7 @@ static int sched_balance_rq(int this_cpu, struct rq= *this_rq, goto out_balanced; } =20 - busiest =3D find_busiest_queue(&env, group); + busiest =3D find_src_rq(&env, group); if (!busiest) { schedstat_inc(sd->lb_nobusyq[idle]); goto out_balanced; --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 521F25823E for ; Fri, 8 Mar 2024 11:18:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896723; cv=none; b=PHTxy3VHzlesWMEgQn7ZIEwUngiC6UYKfOipWRnPw+c65/LGWpt6vbfAU2kC/wkFfEuBrsWlr0ROZuu+CKxljCng3NaIhLmHf/SDRHg8RW4WaGOlRFta6oCrdPUML1ea87ZCvfx4wqqr7CIdrLcK4oYJ+TNRxCc0VlgMn90rKMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896723; c=relaxed/simple; bh=3Ui4kzQ8HyLHw1fD3j8kBFgxut87ua7kY/lvg3h1zdQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YG4peQe+hFoMXYiNv7ZLVGQqD3QpispjdeLdz+9LYgH20eJMRBTuXQev3sOaRWR9C4vDslt4713RggYN3Vt4545WXZXbKORStW/V8UZiMoT6W68QWazLmJh63sdG+dy2PY/kfjJK11IVKj0r5qwcjnHsPTlFXC9ysYgveUBoaz0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J2rMnosh; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J2rMnosh" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-33e65ed1c3aso601757f8f.3 for ; Fri, 08 Mar 2024 03:18:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896719; x=1710501519; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=7utVQf7xMO0/FjNcW1e+QFSl1hivqvd6aOD+j/KAet0=; b=J2rMnoshRaE5g9rvhmdOLrpSbHKGOjiOQhzt9zXr3frVZKqRmTMxJG4uVmNQ35wFpw IcK4jomsfVTrAx9fDli4qfbJQs4iev6PIW/cxneL5wP7PCsXppyqz/kLyeav2YsJfNI1 EH+WzIEranYavviwLzhgxOmATPQ4HY0h26Gyk4+SA8pFVmOjTkh0G87dMtzJIIi7T2GC PALFf/Drc63CyLvBrMWJZwm2v0BGP3R7dLjqd1u47ulFVoBMcqViPRFvMMTDV/fWYFCs MkXjH8fZkAGnmC7tlmDIcNm6jbql4qAmI1v4w+TqXjiTFPc0oumqv1GUmFEE/PJGLUow wACA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896719; x=1710501519; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7utVQf7xMO0/FjNcW1e+QFSl1hivqvd6aOD+j/KAet0=; b=B3C8qSyul3C8FG40J1AMZwdkvga9ob2lauO7HxyTzZ/AReWbZCRbo7fJUu1S4SrJg5 jLEcxD48ANSRicDbcPC4qblXoCePOiiO4dpuhoxTpHdlLKoixL2Jp1yYQj15sJOo1xXk yVGN0n+yhLOPE70ANyf/PPU4g6q0zmZ3VM4H3sbINuPaRSuYAKOo7ZEdjVqpx0Xy69pl JYkpcI+rpUh1Cwnx6Y1jBE8899nxcfbHPtK0EL8Nqdv1oqduD46ckbeerS6XsDGZU0F1 j/n0cJwA/6wmIxU0ZpRJOPjRDG+f0EcktGbvWXtWc0Bw99TKP5HXC7ZTDFygfllgE53l taMA== X-Gm-Message-State: AOJu0YwUjbmbad/Mt77gDsb/xYz45C7rOpht04kFiOoWclKTK0OGQkb9 eDUgpBF05gDxicFKWLplhGjKl8HrTm3QeMNhVAbLaFEuHtCZscw/vZrnkJlcSvc= X-Google-Smtp-Source: AGHT+IFU+Ze4eEQh+9fuTJyuzTTlBHCBU901JRusgpUEQiMMuzkTQ/KjBLs72UOKrMxnm5dQQFY2kg== X-Received: by 2002:adf:e60d:0:b0:33d:f60e:5c6c with SMTP id p13-20020adfe60d000000b0033df60e5c6cmr14331054wrm.53.1709896719377; Fri, 08 Mar 2024 03:18:39 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:38 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 07/13] sched/balancing: Rename find_src_rq() => sched_balance_find_src_rq() Date: Fri, 8 Mar 2024 12:18:13 +0100 Message-Id: <20240308111819.1101550-8-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Standardize scheduler load-balancing function names on the sched_balance_() prefix. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e600cac7806d..1cd9a18b35e0 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10959,9 +10959,9 @@ static struct sched_group *find_busiest_group(struc= t lb_env *env) } =20 /* - * find_src_rq - find the busiest runqueue among the CPUs in the group. + * sched_balance_find_src_rq - find the busiest runqueue among the CPUs in= the group. */ -static struct rq *find_src_rq(struct lb_env *env, +static struct rq *sched_balance_find_src_rq(struct lb_env *env, struct sched_group *group) { struct rq *busiest =3D NULL, *rq; @@ -11280,7 +11280,7 @@ static int sched_balance_rq(int this_cpu, struct rq= *this_rq, goto out_balanced; } =20 - busiest =3D find_src_rq(&env, group); + busiest =3D sched_balance_find_src_rq(&env, group); if (!busiest) { schedstat_inc(sd->lb_nobusyq[idle]); goto out_balanced; --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 5A5F95A114 for ; Fri, 8 Mar 2024 11:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896724; cv=none; b=FPG26OFLGEiDyLAvOnEntjr4rZocx+DuXXZWYGZ3azSds8KBvjQ/+2wkQTrfp7KEbUDSp2P3A3A9u6OCNOrjlTTT5mqErKF2kud6GebBys6AZdDOMZ5OlU6Qa3deYDGo17o8qBcQZXExi6rUtD5KcoCySOEjYMag9Rjh0ffRKTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896724; c=relaxed/simple; bh=nWAdE3F7BRDWOKYU1dGhEL/Gt6Pz2HaqkBWrYqkdxp8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y5m7olh09pafXHkEkM98LipgSNoLd9OXsxsmFDNnDWmH76KRl55756aRH+u2akGEPy3yzYviWvDvBw/JD+4i++HqXCiWToEKgB3HGzqEcP9Ikn99x6RR/ac17eR9/9Deb2zi7kvdQwuMsjv2mJh7sZot3frOf5TSA09oNGfxNGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Oumpr25P; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Oumpr25P" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-33e742ca96bso845907f8f.3 for ; Fri, 08 Mar 2024 03:18:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896721; x=1710501521; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=FaLG7QIIZcpDrCdrmpaWSCsV5vJM+SYzNheYz5z39lw=; b=Oumpr25PvoZJ7/A7adE7BKPAB12VmQJLHD8zrz5TLIAXgC4ZpFarUdtAVL5dNPxRki Nsd1geKvK/PRs6m2ZRICvfEXjWZbZrqSQVZWL2+Pte35uFQPFgZXYYKILDS53Pduw7Cv cX5Sr3nKEps4wduUtzYSsvOW6jW7iAqZPMiAWyBHO4n6siAqdwUzAoGmJ2uoax+8uNIO lE4F2qkCIK4M2ND7jKA1MMiP4XLkwpIUwx1GISUP0GC9Y0asmlnYS8f4FKWlHmkXqRbt YYzrezUtoi97kcIT9qpMiv9SSbOzYPRV7Oty9BLt5Lqe/vqqJDlRHWvd+FB1aMAm2yEJ KtvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896721; x=1710501521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FaLG7QIIZcpDrCdrmpaWSCsV5vJM+SYzNheYz5z39lw=; b=RXFlldWwl8iIwljKjWaWcucaOIOY5cWgo/adAo7JEHQnMhLs+0s6NuiRYrsQMipzvK A+cPITz6rEXtrFQs9z1lFuQZbINlZNw597LkYDdq9tSeVcsL3xc+avx/Kcz4qXYiiKv0 UsISxKRwXfxZhxyEU8ANnfh5pmNxO9DK3KpIFT9wG6Ghvp1uqC5VrX+gzMY1pHff10XR XH8vGGFbhxbEp720EMFY3AcZtkBAn3H/EOnlGCvABBOaFiwVrO9LhrzAYmU4ruwz4vsO +8LWoXQNkJPPtMttlrzSu4ZmojLptflHsdAN6uOLdBqL4o92nvQIXBwlxGnqEQ9o/3vp WfBw== X-Gm-Message-State: AOJu0YxMWmh60oaBN4bPdiylFTzI4S2vXQ8RMwFVkQvTJ2ZuCH7r++Ok mSoJGgwUtSYM9gydR/v0LOqKyI8t7JdMReecn6M1k5EdHEAS3q345eFB67piU5g= X-Google-Smtp-Source: AGHT+IFXgOHB5yw+2wOuJyhg4nDRg4hMhK9Enpf8qfhH2sELiIf/nEuwlKOzbxqiDy6pzhYO9nwu4Q== X-Received: by 2002:adf:cc06:0:b0:33e:6ac:691b with SMTP id x6-20020adfcc06000000b0033e06ac691bmr15139587wrh.9.1709896720464; Fri, 08 Mar 2024 03:18:40 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:39 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 08/13] sched/balancing: Rename find_busiest_group() => sched_balance_find_src_group() Date: Fri, 8 Mar 2024 12:18:14 +0100 Message-Id: <20240308111819.1101550-9-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Make two naming changes: 1) Standardize scheduler load-balancing function names on the sched_balance_() prefix. 2) Similar to find_busiest_queue(), the find_busiest_group() naming has become a bit of a misnomer: the 'busiest' qualifier to this function was historically correct but in the current code in quite a few cases we will not pick the 'busiest' group - but the best (possible) group we can balance from based on a complex set of constraints. So name it a bit more neutrally, similar to the 'src/dst' nomenclature we are already using when moving tasks between runqueues, and also use the sched_balance_ prefix: sched_balance_find_src_group(). Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot --- kernel/sched/fair.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1cd9a18b35e0..96a81b2fa281 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9430,7 +9430,7 @@ static void update_blocked_averages(int cpu) rq_unlock_irqrestore(rq, &rf); } =20 -/********** Helpers for find_busiest_group ************************/ +/********** Helpers for sched_balance_find_src_group *********************= ***/ =20 /* * sg_lb_stats - stats of a sched_group required for load-balancing: @@ -9637,7 +9637,7 @@ static inline int check_misfit_status(struct rq *rq, = struct sched_domain *sd) * * When this is so detected; this group becomes a candidate for busiest; s= ee * update_sd_pick_busiest(). And calculate_imbalance() and - * find_busiest_group() avoid some of the usual balance conditions to allo= w it + * sched_balance_find_src_group() avoid some of the usual balance conditio= ns to allow it * to create an effective group imbalance. * * This is a somewhat tricky proposition since the next run might not find= the @@ -10788,7 +10788,7 @@ static inline void calculate_imbalance(struct lb_en= v *env, struct sd_lb_stats *s ) / SCHED_CAPACITY_SCALE; } =20 -/******* find_busiest_group() helpers end here *********************/ +/******* sched_balance_find_src_group() helpers end here *****************= ****/ =20 /* * Decision matrix according to the local and busiest group type: @@ -10811,7 +10811,7 @@ static inline void calculate_imbalance(struct lb_en= v *env, struct sd_lb_stats *s */ =20 /** - * find_busiest_group - Returns the busiest group within the sched_domain + * sched_balance_find_src_group - Returns the busiest group within the sch= ed_domain * if there is an imbalance. * @env: The load balancing environment. * @@ -10820,7 +10820,7 @@ static inline void calculate_imbalance(struct lb_en= v *env, struct sd_lb_stats *s * * Return: - The busiest group if imbalance exists. */ -static struct sched_group *find_busiest_group(struct lb_env *env) +static struct sched_group *sched_balance_find_src_group(struct lb_env *env) { struct sg_lb_stats *local, *busiest; struct sd_lb_stats sds; @@ -11274,7 +11274,7 @@ static int sched_balance_rq(int this_cpu, struct rq= *this_rq, goto out_balanced; } =20 - group =3D find_busiest_group(&env); + group =3D sched_balance_find_src_group(&env); if (!group) { schedstat_inc(sd->lb_nobusyg[idle]); goto out_balanced; @@ -11298,7 +11298,7 @@ static int sched_balance_rq(int this_cpu, struct rq= *this_rq, env.flags |=3D LBF_ALL_PINNED; if (busiest->nr_running > 1) { /* - * Attempt to move tasks. If find_busiest_group has found + * Attempt to move tasks. If sched_balance_find_src_group has found * an imbalance but busiest->nr_running <=3D 1, the group is * still unbalanced. ld_moved simply stays zero, so it is * correctly treated as an imbalance. --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 555A65A7B4 for ; Fri, 8 Mar 2024 11:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896725; cv=none; b=oqOP3Mu37LI7iFRX2TtkWx/rFuzH4fd+pxk207x7TmDxAfbCOB+2QfFT32abTvebcN/vjpS7a0lZt3GK52K+mi9lUmNywdUXqfJ/P8aYABM97lKM7IYXS44xayd92lUZL7pRzy5FTlASek9ImQCsNR1XCjSBRSYUYTJJpOKyzdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896725; c=relaxed/simple; bh=XOlHRZpNJzJOGTfiYeMtDAQDbibFUKlq+BfLB1rIyVQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rSIes/+TttJdH9CuliAZrUo5RzbtIBpJUQxJBoWGVIM0udeCsKL+CLdHcmEXVjgtB+vFRfrOu3joi30fUkiI4DSYQNABAfs6poo+INkAvTBURda2qzZUuRlOisflFTrTk5DG8B1ag8jr8P2byyHVlq/fJ5QKsAfiS0QZlKRfBGA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QBxLU06K; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QBxLU06K" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-33d36736d4eso1327781f8f.1 for ; Fri, 08 Mar 2024 03:18:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896722; x=1710501522; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=u+S+y+K7L4kzFDSnrRYytcE4IP6j1WnNg2t2ez9J4+8=; b=QBxLU06KXeAwxDRQ3aw/7HAC/OnnRm+NYWB1Nob26V32lM8Qy1EovI0/0tUWKARsF5 NYAuUdrJ2991Xm9NUibT1Iv1cZ1pf+MrNthkelRRpenoF+rZ2B3hGIWrVIPYErgLCEUD YiM60A559sKFv+/hfcIz5rGa9Aw2oj0BxFYJDUS4wjsB73VVDhORu9/l0BZzFvS4unST rkOf0/acv6RtC7dJzzExK8fFRRLgHCys/aA2xRqO4l0gnpIcv3KKnERH9fS5dMXWQ2Ji st/P+2xNaIYvysmkPUj/SxpLHN3LpQkVhPTdQTMrgMe4SQXuFp86v1ydR6H0076H/L+R agjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896722; x=1710501522; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=u+S+y+K7L4kzFDSnrRYytcE4IP6j1WnNg2t2ez9J4+8=; b=urL06Jcci1d7D5eUbQwsKooLUwW/qexCn41exOKjl2zdWQyEtWra+gNKQQFXJiOqHC pMlY/fZx/kimMhJLFzthi5u3Fd+M3f8nrHVKlAQ7Fsw2GeE4rjN/BDQj1RcGdHhjXfv4 bnR5SBHt/7d0yh8iSxTt7px6bsYvZUfltMkukfBKt3bGvAUm4WNKMxOAoVNCyyV2pjz9 z21vFrCs6iStKyAUP8bjvGwn3XN+pViaXh/BaayT9XBzb8XSjVNyXa+spes6qipSVR+g gjPNhoNfOWGfo1gUnQgFatPF6r8j3vRu7/ix0sH895TWC9MlYhNLC50mtB0+lywj7E9n LLDA== X-Gm-Message-State: AOJu0Yw7qMgmw3W8HpDxZ0gLQdQayHe7RiFVkBXvnASv0J4HCbvQmktK 8VnUUlbfSCnGnCXyBNvxeCNKykvtDVc6EE+gJDP9lMvTTSnTVkq5UGcU8Pz/l38= X-Google-Smtp-Source: AGHT+IGJ/u2kq/nAqCIem9ztFPRflJ6RtzgIlNhFNk3aSHzFqjhVYTzgNLoh7hT0ECLBgwX73TMiHw== X-Received: by 2002:adf:dd8a:0:b0:33e:7938:9e65 with SMTP id x10-20020adfdd8a000000b0033e79389e65mr605299wrl.18.1709896721557; Fri, 08 Mar 2024 03:18:41 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:41 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 09/13] sched/balancing: Rename update_blocked_averages() => sched_balance_update_blocked_averages() Date: Fri, 8 Mar 2024 12:18:15 +0100 Message-Id: <20240308111819.1101550-10-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Standardize scheduler load-balancing function names on the sched_balance_() prefix. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot Reported-by: Honglei Wang --- kernel/sched/fair.c | 8 ++++---- kernel/sched/pelt.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 96a81b2fa281..95f7092043f3 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9411,7 +9411,7 @@ static unsigned long task_h_load(struct task_struct *= p) } #endif =20 -static void update_blocked_averages(int cpu) +static void sched_balance_update_blocked_averages(int cpu) { bool decayed =3D false, done =3D true; struct rq *rq =3D cpu_rq(cpu); @@ -12079,7 +12079,7 @@ static bool update_nohz_stats(struct rq *rq) if (!time_after(jiffies, READ_ONCE(rq->last_blocked_load_update_tick))) return true; =20 - update_blocked_averages(cpu); + sched_balance_update_blocked_averages(cpu); =20 return rq->has_blocked_load; } @@ -12339,7 +12339,7 @@ static int newidle_balance(struct rq *this_rq, stru= ct rq_flags *rf) raw_spin_rq_unlock(this_rq); =20 t0 =3D sched_clock_cpu(this_cpu); - update_blocked_averages(this_cpu); + sched_balance_update_blocked_averages(this_cpu); =20 rcu_read_lock(); for_each_domain(this_cpu, sd) { @@ -12431,7 +12431,7 @@ static __latent_entropy void sched_balance_softirq(= struct softirq_action *h) return; =20 /* normal load balance */ - update_blocked_averages(this_rq->cpu); + sched_balance_update_blocked_averages(this_rq->cpu); sched_balance_domains(this_rq, idle); } =20 diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c index 63b6cf898220..f80955ecdce6 100644 --- a/kernel/sched/pelt.c +++ b/kernel/sched/pelt.c @@ -209,7 +209,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa, * This means that weight will be 0 but not running for a sched_entity * but also for a cfs_rq if the latter becomes idle. As an example, * this happens during idle_balance() which calls - * update_blocked_averages(). + * sched_balance_update_blocked_averages(). * * Also see the comment in accumulate_sum(). */ --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 694A95B5C1 for ; Fri, 8 Mar 2024 11:18:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896726; cv=none; b=g4K022Tj5smcMNWe+LEITupuBXTS743/ecuBmXhQ6mfdwTanQcJOL/FY0JjomaulDEJwota/GKeYLduBMjxsVTn2C/2+erygRJgJAVcgIpnJZl/k8JWuidkKYvOoXvaT43zu5JG6jvhPVi/nFNv+wvEbUmN0D1AWqE/4kF6jV24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896726; c=relaxed/simple; bh=NedhpULzZYZ8ME39VE5CA7FZTCBqwKEANbkZH0WTMm8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FFRSHuVHiBRjOfeDZqU7Jq12KIbOBmbfPgZMSFRvLizbucC0UEq9wD2AVMrLDnhljVIL+Q5Vt+unAavLxiQmi009CUDY9Qpm/FE6y5ifrgmaqEXgYi7riisG53x9eVf6UzmpSJD/BqRuT2ir1GTFh42I98LwAH5mMECylHteQ08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KVZP88vr; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KVZP88vr" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-33e742ca96bso845929f8f.3 for ; Fri, 08 Mar 2024 03:18:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896723; x=1710501523; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=uwlzocWJiHgoQscu/IevEQ9ciKsE6ki7xCF7izVWXbo=; b=KVZP88vrlEQPp2sORyjXtpoxv3vPAYVT/XTUBbtV47ovwTp0YHqdpgLrGhUlg82eD7 PFP6zQGcv5CzFtWNJqskL1nTWZHfro6TGGx1MYNfFxKF8DLq3Ha3v9ELtEMB4LXiQN09 t7Xqyfpo577eridg4OyzsNBjtC1wzLDGHEy9Bg9ky2c6DlCEk1/CEU7bk9QVnrJZUn6y 51tLNTeLGKICSuX+9vD3ol7Ms5VdgcexpqTjphvlF+joYiBXG0sJZFzMVQXvGJOQQ98O gy5PkiFpCFdeXGwdH2Oj1oTOsvCay1aW7z5DbKPrnCjpoYG3lkBghRbk/Z0wniBVdGw8 CrIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896723; x=1710501523; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uwlzocWJiHgoQscu/IevEQ9ciKsE6ki7xCF7izVWXbo=; b=qrlai4TYN5zfoRudywvKyStR6QVybprfqnlxDv92+DqV6NntLPa5TRG5uB0kGQ09f5 4Fv5AVhAvCLLRoT8d2SucJQMAN0r8YyvgOVlEikiiV7IluOeuRxoWeD1IuqmF4LmqD+E kzC5kA5kdrtRvqVAi0Mcoz7PPaE7uEa5n9ktji41M4K7N2TCivXb/XaGR7GgR2IY9BCi UeiTKOlnyyTcJdCwUTtRKNI1L6xl71RHlnx+QNRU9VY12CXf/4ge24q+aopsqdnEM1El M1pB3Ds6fW2KkymnAgatskXi0ImFXRa/zTNaVLv0RY+TTlZlZAgp8DJ9pBqdN3thOrRf 2wpQ== X-Gm-Message-State: AOJu0YzXyBTS+CwYPwXRTzDBKGMQ0ZROzM37bZsDBXiqXD4eCJX9R9ik O76dFtdhLMTUlvn0FDGNZc2zRLw0cBb1sFnWokcOpmv1oInMYiJaYJpNpX86kwo= X-Google-Smtp-Source: AGHT+IGo7P28Gp2ufYx6Crbr7Ra3EzTo31RpNymsqZjiR16YHYN//fNVyrBJeMMOL9iDk6VqD2zWrQ== X-Received: by 2002:adf:cc06:0:b0:33e:6ac:691b with SMTP id x6-20020adfcc06000000b0033e06ac691bmr15139647wrh.9.1709896722553; Fri, 08 Mar 2024 03:18:42 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:42 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 10/13] sched/balancing: Rename newidle_balance() => sched_balance_newidle() Date: Fri, 8 Mar 2024 12:18:16 +0100 Message-Id: <20240308111819.1101550-11-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Standardize scheduler load-balancing function names on the sched_balance_() prefix. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot --- kernel/sched/fair.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 95f7092043f3..aa5ff0efcca8 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4816,7 +4816,7 @@ static inline unsigned long cfs_rq_load_avg(struct cf= s_rq *cfs_rq) return cfs_rq->avg.load_avg; } =20 -static int newidle_balance(struct rq *this_rq, struct rq_flags *rf); +static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf); =20 static inline unsigned long task_util(struct task_struct *p) { @@ -5136,7 +5136,7 @@ attach_entity_load_avg(struct cfs_rq *cfs_rq, struct = sched_entity *se) {} static inline void detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) {} =20 -static inline int newidle_balance(struct rq *rq, struct rq_flags *rf) +static inline int sched_balance_newidle(struct rq *rq, struct rq_flags *rf) { return 0; } @@ -8253,7 +8253,7 @@ balance_fair(struct rq *rq, struct task_struct *prev,= struct rq_flags *rf) if (rq->nr_running) return 1; =20 - return newidle_balance(rq, rf) !=3D 0; + return sched_balance_newidle(rq, rf) !=3D 0; } #endif /* CONFIG_SMP */ =20 @@ -8505,10 +8505,10 @@ done: __maybe_unused; if (!rf) return NULL; =20 - new_tasks =3D newidle_balance(rq, rf); + new_tasks =3D sched_balance_newidle(rq, rf); =20 /* - * Because newidle_balance() releases (and re-acquires) rq->lock, it is + * Because sched_balance_newidle() releases (and re-acquires) rq->lock, i= t is * possible for any higher priority task to appear. In that case we * must re-start the pick_next_entity() loop. */ @@ -11493,7 +11493,7 @@ static int sched_balance_rq(int this_cpu, struct rq= *this_rq, ld_moved =3D 0; =20 /* - * newidle_balance() disregards balance intervals, so we could + * sched_balance_newidle() disregards balance intervals, so we could * repeatedly reach this code, which would lead to balance_interval * skyrocketing in a short amount of time. Skip the balance_interval * increase logic to avoid that. @@ -12277,7 +12277,7 @@ static inline void nohz_newidle_balance(struct rq *= this_rq) { } #endif /* CONFIG_NO_HZ_COMMON */ =20 /* - * newidle_balance is called by schedule() if this_cpu is about to become + * sched_balance_newidle is called by schedule() if this_cpu is about to b= ecome * idle. Attempts to pull tasks from other CPUs. * * Returns: @@ -12285,7 +12285,7 @@ static inline void nohz_newidle_balance(struct rq *= this_rq) { } * 0 - failed, no new tasks * > 0 - success, new (fair) tasks present */ -static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) +static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf) { unsigned long next_balance =3D jiffies + HZ; int this_cpu =3D this_rq->cpu; --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 73CE45CDC9 for ; Fri, 8 Mar 2024 11:18:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896727; cv=none; b=fZnMBwucGD+phhab3zPL3WmDJ1gj+Ip78FEahNS0DCcYvjzgwKwsVdj8k7TtpxaeO26zDVQEGmAdNp1hoP5p86uWFCa3bW/E+yKHkOUzLOYLL2FUumzvxHsJWJKqu7NZDT1wGur73xQHk8enc2e0sSROwzEzZkdUF9zMVAp4OhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896727; c=relaxed/simple; bh=nFc6H2LARbAQKvySIdNn59YzkG9s6blD8CUVxFU9/GY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cSRz1TNzGHjZOftuDFn0S2Je+6uWhU5KfwTtRRSU5iE1u2sC5aLTAxbvIIQrelMRUMjR8OiDAU6TPwNdTxyhJb2tds+Nag0ZqK9swTJvCTcv1mDU7e5cgh5IglnOS48SXkzx0oJfyBMjIbSgSXRLLxkoKIPda/Sxa6gIgai75Rc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q3Re3A8A; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q3Re3A8A" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-33e285a33bdso1105740f8f.2 for ; Fri, 08 Mar 2024 03:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896724; x=1710501524; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=+9br3RKNBjSYu+KVu9Dy6exTj0eK3ABqPcmihkUiY/s=; b=Q3Re3A8AU6orRCQOTAIyIM7jDklw3lrI58pZ5PR4NcuTF/RUOEm5YkKtXejlM8r+/P d6LBJqSU07W37Cz/2cSkm206Ogz558kLbZp8A/EOORgMmlzAh/jZqCGqUVl25VT7zOop r42uaZriUyxY0tqg/LuN3awHqLYrH8J/g7rVv5OJYaSTo7Sv4oIdDCFLnclkpsZQWQfG AELkVmediC+wQoND1x2t5+IY7Zu1BRsNlE64VVchEqg9QQpn/c87k3pvYy0LKvXJjwRn 8f27TWp2xXvELH19SHNnUk+g0AQEHcxZ8lxrzboJk/4w935vwEmVsBsFhx4bX2iH+1dA /HuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896724; x=1710501524; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+9br3RKNBjSYu+KVu9Dy6exTj0eK3ABqPcmihkUiY/s=; b=BES0llpPFC4y22oBixU0AXjZiVWG/TfSORkD8+8iS59qxeW0RHdoP9uxfWDs6m9r4x x/GyC4KxH6p5nJwEk9anOi1Oj0u+ZXSgMhPYBgbXGmx85tocaX+64l1wFTHzmMLPMLGl uZvAEXWNv9vdr2YEhpDAbmPGFE2y6ENH5PUSXQFhROgEsuFvD6ehiIaKZkramYEuEHsq 3uXwKDEnysZniWZHxb7SM00kyjmstLvlD9VPAvvv4RoX4LFQZyE5rGyfhTQ6eTfgNs2q hamybpCHktGCKiFnQTmf+p/3K9+HNPPi8LlDm4lSg/wIcf2TSbi7rl/BAPzpyZ7kR1sf R8zg== X-Gm-Message-State: AOJu0Yx9eAxuf2bF58762xN9ceoF4bBOX58/pwvedo89KQKRKb1BFtkY DHGZpXICViJ+zCCvzPzla3pIFQcs1oY9HYZtN8tA/pqJW/J9FBw2k+vDj9pbaVs= X-Google-Smtp-Source: AGHT+IGcF28p92A8DRlDGAVRCdFfvRrfDEBQssqa2PgWBghX4EByUoYPEF4vuErrTQidtPhoZS37LQ== X-Received: by 2002:adf:9c92:0:b0:33e:1df1:b76d with SMTP id d18-20020adf9c92000000b0033e1df1b76dmr14697595wre.44.1709896723539; Fri, 08 Mar 2024 03:18:43 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:43 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 11/13] sched/balancing: Rename find_idlest_group_cpu() => sched_balance_find_dst_group_cpu() Date: Fri, 8 Mar 2024 12:18:17 +0100 Message-Id: <20240308111819.1101550-12-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Standardize scheduler load-balancing function names on the sched_balance_() prefix. Also use 'dst' instead of 'idlest': while historically correct, today it's not really true anymore that we return the 'idlest' group or CPU, we sort by idle-exit latency and only return the idlest CPUs from the lowest-latency set of CPUs. The true 'idlest' CPUs often remain idle for a long time and are never returned as long as the system is under-loaded. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index aa5ff0efcca8..02ff0272b2e4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7101,10 +7101,10 @@ static struct sched_group * find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this= _cpu); =20 /* - * find_idlest_group_cpu - find the idlest CPU among the CPUs in the group. + * sched_balance_find_dst_group_cpu - find the idlest CPU among the CPUs i= n the group. */ static int -find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, in= t this_cpu) +sched_balance_find_dst_group_cpu(struct sched_group *group, struct task_st= ruct *p, int this_cpu) { unsigned long load, min_load =3D ULONG_MAX; unsigned int min_exit_latency =3D UINT_MAX; @@ -7191,7 +7191,7 @@ static inline int find_idlest_cpu(struct sched_domain= *sd, struct task_struct *p continue; } =20 - new_cpu =3D find_idlest_group_cpu(group, p, cpu); + new_cpu =3D sched_balance_find_dst_group_cpu(group, p, cpu); if (new_cpu =3D=3D cpu) { /* Now try balancing at a lower domain level of 'cpu': */ sd =3D sd->child; --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 6BCAB5D746 for ; Fri, 8 Mar 2024 11:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896728; cv=none; b=eqIJQlVcsSz1hygE5CRC7vpieuRw0zUzGCJ+7fR08UY47Ti3WWihDIzzVf+bB3H4oK0xxVOaogoAjVolH1sabKf7bhPr9kyEispiS8QaKB1W6BV8T8EtHeu3C9S+Hy7nzrnSnfSo55s0mp3AH35+UiZxR7JFqaBt5e66VBZMAZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896728; c=relaxed/simple; bh=1Qy8fQjqx8ZxvIi4pjJjdOJElW1kL76efZnQGOLJkt8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Irqsnj1ogFo7CsE2CjPJvKFzSINn4HBUqqlxzoVa5+sdmf9/a8zzdacMTKLHrWvconfCpbcYgwia5Lu4jpUFUoxxfClzh1Grvp5OZ90iTzvEGfG8/imoyT2B0WPu7EGTTRSElN/gTWEEHIGquTcUY6fn/HwztR+g0HC9LKgH+Dc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JrZeEiCv; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JrZeEiCv" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-412f1961101so17124715e9.0 for ; Fri, 08 Mar 2024 03:18:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896725; x=1710501525; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=JTzCczXvQjKBJxCPwBhryBD4dLKi2fHh1v5KBqSA4qo=; b=JrZeEiCvDLNJ2ArHvTSQpiLw7GFojKuFQwzu/d+0f//NWPSznjeXzfUSQrVvQ7QUnt +7HUIKAqnUZDYI1WPhsmpu1A7HJaITH33ADkGxODb+MfExfGyA9i8d17L949NvILMFL1 mi7lfQrH1HFmMpitPqlsIAa3MoR3JhQHlPbaQb1BSK8D20PsC+dgbO8uOf9UZvldkRNO osO/3hgzJjbRfnhILOoeUQl2492T+x2zs95ZTIO1qTaI4xahRf4jh23hVBoCiJThlRrj g/sks/J4HmrHhejt2gM0O5isBFT7273p6w7azwqaPRVJFgKueV3sm31A6ovGWgfxYYIa 4kPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896725; x=1710501525; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JTzCczXvQjKBJxCPwBhryBD4dLKi2fHh1v5KBqSA4qo=; b=NK/5I5iYu77BDmv+m6W54M6n+RJPhjrHddQEMZDIYmVs4bozPDz6cqGRYS8Xc769Iy hYyskDZvsGOy0UhOxaPjtcX+/Ow7BubQ7ZfvVPNmEzOGtxOoo9XUL2TmtFv/GmCxpVuH 1opIeVU5dnYWWLLtJh83liANMSccTyelpfS2TNlyYiQQlIUm/4fgpy7cTB9OPg5c9lt/ 3yvYlznTqbWE9Qw6xRbT/n4uB3r73pr8Vf7GAc1S9ZcUqyLmqE1H9Ge67m0QI+HZjuJL bPyp4Bs0fUMlHcbahuJ8bz/ryO+zx6ndrFduLo6oSgdfU1P7aW8ujujmADeuveZ0ft3m ucbw== X-Gm-Message-State: AOJu0YwDAPTxoYMTXR3KIDuk+m9KSLnfiA05ckCSyR1BOpMvTRihtxTX jCc7LPNqKcEddTvEzjO6Djjdjn4gu5xbVCI+bGbdSMWcQc1zPFLSvlOqPWwhPGw= X-Google-Smtp-Source: AGHT+IEaFgMXxbldQDMji3qVITQatIqqKRMpyNd7fjQqkchlZvSIOz7R1DocoUTFVJPshNa4Ac0PnA== X-Received: by 2002:a5d:4287:0:b0:33d:e74b:e3e with SMTP id k7-20020a5d4287000000b0033de74b0e3emr13636669wrq.41.1709896724638; Fri, 08 Mar 2024 03:18:44 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:44 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 12/13] sched/balancing: Rename find_idlest_group() => sched_balance_find_dst_group() Date: Fri, 8 Mar 2024 12:18:18 +0100 Message-Id: <20240308111819.1101550-13-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Standardize scheduler load-balancing function names on the sched_balance_() prefix. Also use 'dst' instead of 'idlest', because it's not really true that we return the 'idlest' group or CPU, we sort by idle-exit latency and only return the idlest CPUs from the lowest-latency set of CPUs. The true 'idlest' CPUs often remain idle for a long time and are never returned as long as the system is under-loaded. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: 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 02ff0272b2e4..d0c3a091d7d1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7098,7 +7098,7 @@ static int wake_affine(struct sched_domain *sd, struc= t task_struct *p, } =20 static struct sched_group * -find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this= _cpu); +sched_balance_find_dst_group(struct sched_domain *sd, struct task_struct *= p, int this_cpu); =20 /* * sched_balance_find_dst_group_cpu - find the idlest CPU among the CPUs i= n the group. @@ -7185,7 +7185,7 @@ static inline int find_idlest_cpu(struct sched_domain= *sd, struct task_struct *p continue; } =20 - group =3D find_idlest_group(sd, p, cpu); + group =3D sched_balance_find_dst_group(sd, p, cpu); if (!group) { sd =3D sd->child; continue; @@ -10296,13 +10296,13 @@ static bool update_pick_idlest(struct sched_group= *idlest, } =20 /* - * find_idlest_group() finds and returns the least busy CPU group within t= he + * sched_balance_find_dst_group() finds and returns the least busy CPU gro= up within the * domain. * * Assumes p is allowed on at least one CPU in sd. */ static struct sched_group * -find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this= _cpu) +sched_balance_find_dst_group(struct sched_domain *sd, struct task_struct *= p, int this_cpu) { struct sched_group *idlest =3D NULL, *local =3D NULL, *group =3D sd->grou= ps; struct sg_lb_stats local_sgs, tmp_sgs; --=20 2.40.1 From nobody Sun Feb 8 06:54:46 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 A3E145E066 for ; Fri, 8 Mar 2024 11:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896729; cv=none; b=pfQhgbcPajTYX+xmHkufWjLixbzomK+HQfUim/4TpVVxbJdgZ6a3LZEYYYmwh37dVe5WBDpAqujJDoq6ymIzQfya+f+iXxWNTEfJGllqck3qBIHqmlIjaxEKsXqggP5Z/mPAB/wRzr68aoTzy3Qy2RN1bFXI2waJ9ShSI5ccN4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709896729; c=relaxed/simple; bh=3TPeEYMp0yyN8WNSLogtpkRpVWIYbmF4zEhIzBhjpnc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DUxnzJHkTQrHuTMADBSPFMAXYkaDWEE4NBSTL5Q2phAeu/9KK65xUHjNgkbetaI1Hw5KEWluyarzCv1nJ2g5ahenq2Qv1hJTPFh6lb6UkIQONeKpwMwI8ykrxn7GIwKqa+Tjpxt6S/zTpGRV7jUMaZ23ROJQykzJY59mUvIrr2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eRg32m8F; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eRg32m8F" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-33e4c676f0aso1260423f8f.3 for ; Fri, 08 Mar 2024 03:18:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709896726; x=1710501526; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=JOvd7yJCsrm2lekArZtftwEXy7qvg7yRQDw3i8wVqcM=; b=eRg32m8FL4Xp9pQ0UVTsmOsgohtf4n80odaEbSJJjay7VUT7XoRLiXSM5VwraM3wHX 3NBPqmuJZpArMjjw4DroMJoaG+xZ/NdH304w7KHaIznDRl2uvzNB4okVSpuZ6aTLFGIT QLr33bvc9KlCIHYN+OwsS83rBTjDT3owC3kqLYGz//ZixSw7YRys9aSlZD24Aqn7GBBk Pq44MT0ys9722Z6cPFfNTV1cgVsFir/vNqcwkkSL5IX7TABcxG2M9AY06R8kBv6eG4ZI uGQbkHi2BBMRyPA8IIjAJQJ7Jy09sVTKE+eSbkd52t3N/+zizwfp6wxgd9e2MoaVw6jB TbaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709896726; x=1710501526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JOvd7yJCsrm2lekArZtftwEXy7qvg7yRQDw3i8wVqcM=; b=cUQErTG4bqrwo7rIikbFjI3TBJEHI8BjxVgYKBhtINKhdbjEYCe//h0kknc3KRwfhx 23XJyRIOz3mxfwAUJ1hsgnuekr1Wjti3NNl/RePIzt6U7+b/ANuyJPGeSD4JnOjp1oBg Xkh54en8fPcNyHCuwa9muej+lhbO0zE0C7nxxTlqDZBsZRNgk44i0GYP7w0hoi+a7/6P tkf/+kS/NZHDGqGQiczqB8H6aa919u/8RFuXaH2PcsFSf+MJj4JESHiCpUg3YzpB7vzi Ki6hqDmT2Wr+SY+QFyAjJw+DVOzvDgGfm9NNttX0ruNXjzAD1AhPX8es+o3x8Y9J1PTn sjnA== X-Gm-Message-State: AOJu0YxQxZoVnp/paOAAUk7CgxoEgHohdy8VcMq88/bfExzkbeG/2y/x BdU/0kdTlH8aui8KejBIT6RtTVsAOsTQ9vnDEy0tR631dkI9jf6TPj0/IRWCmxg= X-Google-Smtp-Source: AGHT+IGpBp7GqhUTGDTINFIfxuSQRWKuUPNeqRuDFXz548rHE6K1eT/bIN1DSn6d+ChVRcXdkEYfWQ== X-Received: by 2002:a5d:6603:0:b0:33e:3b95:d80c with SMTP id n3-20020a5d6603000000b0033e3b95d80cmr10402445wru.29.1709896725738; Fri, 08 Mar 2024 03:18:45 -0800 (PST) Received: from kepler.redhat.com (1F2EF3E5.nat.pool.telekom.hu. [31.46.243.229]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm2523884wro.77.2024.03.08.03.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:18:45 -0800 (PST) Sender: Ingo Molnar From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Dietmar Eggemann , Linus Torvalds , Peter Zijlstra , Shrikanth Hegde , Valentin Schneider , Vincent Guittot Subject: [PATCH 13/13] sched/balancing: Rename find_idlest_cpu() => sched_balance_find_dst_cpu() Date: Fri, 8 Mar 2024 12:18:19 +0100 Message-Id: <20240308111819.1101550-14-mingo@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240308111819.1101550-1-mingo@kernel.org> References: <20240308111819.1101550-1-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Standardize scheduler load-balancing function names on the sched_balance_() prefix. Also use 'dst' instead of 'idlest', because it's not really true that we return the 'idlest' group or CPU, we sort by idle-exit latency and only return the idlest CPUs from the lowest-latency set of CPUs. The true 'idlest' CPUs often remain idle for a long time and are never returned as long as the system is under-loaded. Signed-off-by: Ingo Molnar Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Valentin Schneider Cc: Vincent Guittot --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d0c3a091d7d1..4b3c4a181a91 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7160,7 +7160,7 @@ sched_balance_find_dst_group_cpu(struct sched_group *= group, struct task_struct * return shallowest_idle_cpu !=3D -1 ? shallowest_idle_cpu : least_loaded_c= pu; } =20 -static inline int find_idlest_cpu(struct sched_domain *sd, struct task_str= uct *p, +static inline int sched_balance_find_dst_cpu(struct sched_domain *sd, stru= ct task_struct *p, int cpu, int prev_cpu, int sd_flag) { int new_cpu =3D cpu; @@ -7936,7 +7936,7 @@ compute_energy(struct energy_env *eenv, struct perf_d= omain *pd, * NOTE: Forkees are not accepted in the energy-aware wake-up path because * they don't have any useful utilization data yet and it's not possible to * forecast their impact on energy consumption. Consequently, they will be - * placed by find_idlest_cpu() on the least loaded CPU, which might turn o= ut + * placed by sched_balance_find_dst_cpu() on the least loaded CPU, which m= ight turn out * to be energy-inefficient in some use-cases. The alternative would be to * bias new tasks towards specific types of CPUs first, or to try to infer * their util_avg from the parent task, but those heuristics could hurt @@ -8201,7 +8201,7 @@ select_task_rq_fair(struct task_struct *p, int prev_c= pu, int wake_flags) =20 if (unlikely(sd)) { /* Slow path */ - new_cpu =3D find_idlest_cpu(sd, p, cpu, prev_cpu, sd_flag); + new_cpu =3D sched_balance_find_dst_cpu(sd, p, cpu, prev_cpu, sd_flag); } else if (wake_flags & WF_TTWU) { /* XXX always ? */ /* Fast path */ new_cpu =3D select_idle_sibling(p, prev_cpu, new_cpu); --=20 2.40.1