From nobody Mon Feb 9 15:32:43 2026 Received: from mail-qv1-f99.google.com (mail-qv1-f99.google.com [209.85.219.99]) (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 50FF62F5339 for ; Wed, 3 Dec 2025 11:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764761889; cv=none; b=AHQqXXBo0vqZNkXtPkb67RVNMZbXyUyVtjRi31YR5woPkHcT6/egO3xKn52fXwt3GEGFkXrPWknY8v/y1FdRAr34luhnOWGffaOYehhSqEKjTOVQLhRh9Goi39Qs0E2f0TWuO/8NmYajAaO97wEnx6h9r1fddw3RqHTTbsISCsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764761889; c=relaxed/simple; bh=3ZfId0fg17jLpmXVAs6RDt/lgvIwJmUHkgZynliI29I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iXKjfVG7S/09YfcmEMru6QpVxVlH3bsxyBB7zrRAj+SGbuv7mWAIpQYrP+jy4mscKSLGiJ/pdshzkEtNXisPYvd3LeC0pzoSkgIRsshNe2v+/6+5sQCAH3cz9rkAzhIc6a/T1UFF070eZkfTCDXCvl3ZeQO3YijiepXGCVhubkY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=RubBXCwX; arc=none smtp.client-ip=209.85.219.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="RubBXCwX" Received: by mail-qv1-f99.google.com with SMTP id 6a1803df08f44-882379c0b14so51373456d6.1 for ; Wed, 03 Dec 2025 03:38:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764761887; x=1765366687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QwoBIBoPcN27LB5ca5Kj/q9w5devdvomIojhATPdeUM=; b=WoBI8lqGhRbVQ8K1e9QHZNsDLWNSOKvYv4YPsxQB3Kk7NxV4jLT7REb032+uF/6X+Y FpdBrMeAZ2aC+RKMyGfv6OaCblOBxhga3lzBUXxwtPdE0d63uYBzBeZ8HDvBbs3YMx19 XYd2/3umjGmm7+l5n9gNLe0G/Umlk31L50nyVxMAiWCyzLahKq1vhU0ihFmlPFTXxygg NpCnXokfrieIerztQ3hzmDjbYLo61j8BNr+RIpD0FyN2WazuLklWhAEvlIBXD5HRS7bE vQHpItKOle/cSzthm9bXESMgQ454cC6lTtzUVLjqFZ41kyO0IYY4JxDElYubLtkQPyJT pPmA== X-Forwarded-Encrypted: i=1; AJvYcCVljV39U0sF8K3DzK8KVQ1ksHI2THKItOKsp+A3zj1iXsdv1yOcaOG9ViysYYubSQ2dmbs/wuOcPgfKDbM=@vger.kernel.org X-Gm-Message-State: AOJu0YwZJLCu0MXyG7rrzeK0i3/G559QNXSqpv1M9bbWoCWAxx0PpbHC fDxu4NWEgkjiXi2n3VDSl2pxCfIhJXDou/JNFk3tzD+5rrI2kj0XeHj5x7VmAcJJfaVH8Ez3wg8 UcO8AU4auWfAiGB5qijx8zfG6LNBKEREIOdpOXHvF5+V36//gCSyxFRWRvWBiRwjLfLkaLYIxPO Au0L3PdUnifmAXCKc53P8gN73Ghfvcl4v9dtbwhRD2AUZivznLH6w7cxl5FaGSU5hBLYUsdsFfb QxTxeXEfBtpOZ2YII4= X-Gm-Gg: ASbGncskan/F/DUIZC64M/xOKd0oXBFlypo7XIA4lFensGbFUyoZLX9VqgUH6cdsvXU FTS+Cfa0rl4TMPIvn1fRRgqXk6PWTCnq9FmqXcGSjgI1P0kTvBBKBFt3VzV7uHBDdkU086uGG6N /YiPBD4H9lYZK7lL72IBw3DW04xYzNGbtq8eL4hMb4uSu39lFX0uLsn8OavyCfyN0SUlTdYGQ2J NZuhDwK5ikDPLjCb5YX1I1VweEPBz+xpUAUyP8E9dBLa+VQ4atTnAP6ejqoeqUY1wsxX1R3Tu3O UtY3r2NOIhWz5vOKR8PAOFK4mDM02qqeGp+hn+5myKyS87CgMzUgZxwgpArS5StktpHfFZ7lDXZ ap4A1PMqh4+gNSvWWes9Ps0k7aA6dZdPZEQT35fGFwehJ7M5gmNgE0bhKXDVkhP+If+DKreoeqd FYeBi6SnJY58bx7IlJd8neXOi6Xg3bZv4fyRRljt8ZAiTK X-Google-Smtp-Source: AGHT+IEZk6a4sqbqi8awV6J5/22H3d+hfhlGOioqLSBOL4kMcwT2MZCz8Ix/XgjF8GgSMMzRtkZtZ3C6AxVj X-Received: by 2002:a05:6214:242a:b0:87c:2919:7db3 with SMTP id 6a1803df08f44-8881955b608mr27350876d6.51.1764761886977; Wed, 03 Dec 2025 03:38:06 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-117.dlp.protect.broadcom.com. [144.49.247.117]) by smtp-relay.gmail.com with ESMTPS id d75a77b69052e-4efd2eef4f0sm5823611cf.0.2025.12.03.03.38.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Dec 2025 03:38:06 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-7b9090d9f2eso10980958b3a.0 for ; Wed, 03 Dec 2025 03:38:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1764761886; x=1765366686; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QwoBIBoPcN27LB5ca5Kj/q9w5devdvomIojhATPdeUM=; b=RubBXCwXV6eqT8DWnifQ/AefdMZqiYX9ybaKYsoG3zDHx2F1iKnFfrGqMONLOGzPbE sMONMT4ToazbNumYTJsLWptBi+EAyWJgsu7v2cnGmYH1jRuEmS2fqfhoM7/fdqa2UHoi ELhlykF8hExgHxigcJ1uD5n7wbvz7ZsS+H9w8= X-Forwarded-Encrypted: i=1; AJvYcCVzrCMXyDXyS3AVfxCdPsyzIF6i1Zo+E1Z1wpTcsPZTOkE7XwNH7TMI2pSF9IbuR31aSoY5774OF3tzAaA=@vger.kernel.org X-Received: by 2002:a05:701a:c965:b0:119:e56b:9593 with SMTP id a92af1059eb24-11df0cc504amr1158019c88.24.1764761885730; Wed, 03 Dec 2025 03:38:05 -0800 (PST) X-Received: by 2002:a05:701a:c965:b0:119:e56b:9593 with SMTP id a92af1059eb24-11df0cc504amr1157989c88.24.1764761885142; Wed, 03 Dec 2025 03:38:05 -0800 (PST) Received: from photon-dev-haas.. ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11dcb03c232sm83169465c88.6.2025.12.03.03.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Dec 2025 03:38:04 -0800 (PST) From: Ajay Kaher To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, ajay.kaher@broadcom.com, alexey.makhalov@broadcom.com, yin.ding@broadcom.com, tapas.kundu@broadcom.com, Joseph Salisbury , Adam Li , Hazem Mohamed Abuelfotoh , Chris Mason Subject: [PATCH v6.12 1/4] sched/fair: Revert max_newidle_lb_cost bump Date: Wed, 3 Dec 2025 11:20:24 +0000 Message-Id: <20251203112027.1738141-2-ajay.kaher@broadcom.com> X-Mailer: git-send-email 2.40.4 In-Reply-To: <20251203112027.1738141-1-ajay.kaher@broadcom.com> References: <20251203112027.1738141-1-ajay.kaher@broadcom.com> 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 X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Content-Type: text/plain; charset="utf-8" From: Peter Zijlstra commit d206fbad9328ddb68ebabd7cf7413392acd38081 upstream. Many people reported regressions on their database workloads due to: 155213a2aed4 ("sched/fair: Bump sd->max_newidle_lb_cost when newidle bala= nce fails") For instance Adam Li reported a 6% regression on SpecJBB. Conversely this will regress schbench again; on my machine from 2.22 Mrps/s down to 2.04 Mrps/s. Reported-by: Joseph Salisbury Reported-by: Adam Li Reported-by: Dietmar Eggemann Reported-by: Hazem Mohamed Abuelfotoh Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Tested-by: Chris Mason Link: https://lkml.kernel.org/r/20250626144017.1510594-2-clm@fb.com Link: https://lkml.kernel.org/r/006c9df2-b691-47f1-82e6-e233c3f91faf@oracle= .com Link: https://patch.msgid.link/20251107161739.406147760@infradead.org [ Ajay: Modified to apply on v6.12 ] Signed-off-by: Ajay Kaher --- kernel/sched/fair.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8bdcb5df0..7ba5dd10e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12223,14 +12223,8 @@ static inline bool update_newidle_cost(struct sche= d_domain *sd, u64 cost) /* * Track max cost of a domain to make sure to not delay the * next wakeup on the CPU. - * - * sched_balance_newidle() bumps the cost whenever newidle - * balance fails, and we don't want things to grow out of - * control. Use the sysctl_sched_migration_cost as the upper - * limit, plus a litle extra to avoid off by ones. */ - sd->max_newidle_lb_cost =3D - min(cost, sysctl_sched_migration_cost + 200); + sd->max_newidle_lb_cost =3D cost; sd->last_decay_max_lb_cost =3D jiffies; } else if (time_after(jiffies, sd->last_decay_max_lb_cost + HZ)) { /* @@ -12935,17 +12929,10 @@ static int sched_balance_newidle(struct rq *this_= rq, struct rq_flags *rf) =20 t1 =3D sched_clock_cpu(this_cpu); domain_cost =3D t1 - t0; + update_newidle_cost(sd, domain_cost); + curr_cost +=3D domain_cost; t0 =3D t1; - - /* - * Failing newidle means it is not effective; - * bump the cost so we end up doing less of it. - */ - if (!pulled_task) - domain_cost =3D (3 * sd->max_newidle_lb_cost) / 2; - - update_newidle_cost(sd, domain_cost); } =20 /* --=20 2.40.4