From nobody Mon Feb 9 15:32:45 2026 Received: from mail-oa1-f97.google.com (mail-oa1-f97.google.com [209.85.160.97]) (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 528B52F5467 for ; Wed, 3 Dec 2025 11:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.97 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764762021; cv=none; b=mPOJVxryCP3p9VD/nPq+z2CGJ2BqWdo6kx/Cd6jWZ6skErRuU8j2C1bGaBMKCXb4sHzawWGvQdij4+7haJ9D94WWDuAjXN3If7z7NLAD6VS26VAApIQDFvc+rpnR0N/ErrakplPLOBectdH3fg7Jcv9FCw3ylzq86kaQjWxF/7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764762021; c=relaxed/simple; bh=1gdc28kwhY19UQraDdo+Rzp2Og6mCveOvOii9v+y3lw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aJd6sJRySwjI2EhycgguEWDnocUNkueGvppWpQaLLy6gdEpMWZvj343Z8YMu9NaNGeTa5c0DkYJ42z/QO+bKq6I0C1WEPQNc/sLB4DMMJmmfxUcIZstjN+k6vnMojpfhgGjxbb1dzcHbeqOVV29PSTTMLyW0yInZT9VGGB68/pM= 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=Fa9O9KeQ; arc=none smtp.client-ip=209.85.160.97 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="Fa9O9KeQ" Received: by mail-oa1-f97.google.com with SMTP id 586e51a60fabf-3f0cbfae787so1823580fac.3 for ; Wed, 03 Dec 2025 03:40:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764762019; x=1765366819; 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=Brn42TT1Ey4jdpd/BGskKy4rpvE127k8ANXujp7zLgY=; b=G0YfiZc+YR3J3a9vFhS7cJSZW4fodhZjWtEJJxGKSccgzY8bgljynL4k3VgzX8hhwB r7w+v6hHM0k0uixpXdhUuc7zwDp+qnmyXummCZ4mAWiMANif2mAr4jfL3TuiMstR+J+G hPpyQo2mUsvExOHmlDvcPZxmjUz60LIO7XK5x7MVxkkTPjbcA8D3fZPFFHeY8iYWCBbi zORORgUPwVuUpPUkSlfUjoauQ+Q4DIQICJ4+n+uBXr8TvK+8ahc7FlrQgJK9N0lQL8Fn CDTr6ezUkSNNfM9LARz+bE719IMSkHmLn6ydEvK3WOl1gwL9Zpu3J5dhuciZVrxqd/EI 7xRQ== X-Forwarded-Encrypted: i=1; AJvYcCV4PXvt6jQHJMohUJltmKKiEHKFpCGjuJ6NsTWkappZH/EbOBnXzlDvLYlkMD4aKr24Njnwqd1OBrwcSaA=@vger.kernel.org X-Gm-Message-State: AOJu0YzJf6SZCMoALIyG0A7axL7bkhv/vjClZyRnyJagdaNS9cSisuz2 sgZCbPLmea9ICuealrK0eLFS+dFEJhJBH+s99lhOVKL6zuk3VTgwBMIuuICJjyRldwlg7LkR7yd bs2OFLJJJ5hyhzMc0w0Lzmysi2z6ZVJ2e4jXI2rHBICrREbTEmCjACeaINUa6qBcBDeOs6lGTpR 7zMVkou+ZtitAvltwRTar+uGr3IKWoaE7Q0ZfYUyOC6UFkbcmdbeK09ey1kJgMMCIvOWCmoxXP0 +VoYLZ5YBMobZCZLj0= X-Gm-Gg: ASbGncv1/qwrzn8u3NxkwVXWLj/8aq5MDljEvs+tHngwNJKS+QHDTxGQA4a31Hei6fx 43eCGPi9Mzu3FgwH0tpyN/l4Ax6frmifEO3cCnRjso3/UxuVBkkjjDd0JTbRPPra2PPm2NLHXGJ WkJj7+7stZXnqFqvm5ZDDJFanED5win8G0okQygEflimF//9JpW+TqTAN/U6QKynCeqzb4t1FIj yLAZUIJaDDO5Pvie8PiYHDY9itCIcHCNxLmnkJ5apShdcRSgoZqfW11rnTc0hAkNplZGDCiX/TU MseXXa3WMziPmjt9aunujML3BrWl75hBk/kLkcIBhqSysdQIMYL+dHARgE2zvrJ2DUsTrdDHZlz +itGd8NsKmmO5I3KTheVJpyw1no9V8ftQyLUkYoD8v0i+egTUa4n6XptfOnfK/G+a6aUG3ARJ03 SpNuZXPBZ/INGiUH2vbHYMCk8ATNtd8ppVkT57FgiMZA== X-Google-Smtp-Source: AGHT+IGkL9ckYZGPw+1gLUMUioAhQM7RoTsYGDxbumSvjTLhxy3qAk4i1mUksfIsyatnEZawcAVTUXySG9+b X-Received: by 2002:a05:6871:811:b0:3f1:528e:c727 with SMTP id 586e51a60fabf-3f16940fef5mr1034354fac.47.1764762019179; Wed, 03 Dec 2025 03:40:19 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-11.dlp.protect.broadcom.com. [144.49.247.11]) by smtp-relay.gmail.com with ESMTPS id 586e51a60fabf-3f0dca40914sm1837536fac.8.2025.12.03.03.40.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Dec 2025 03:40:19 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-bf06c3426b7so3349383a12.3 for ; Wed, 03 Dec 2025 03:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1764762017; x=1765366817; 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=Brn42TT1Ey4jdpd/BGskKy4rpvE127k8ANXujp7zLgY=; b=Fa9O9KeQJrmuJnYbn3aXC5HldDURzEwZIlhNIi0XbdcnHb+eJxWTLBVAEEaQ8MIDUB 9Vc4bR/Vu0f5Csz67C29cR3Ojh7zJnSmHKDfSdh5UCE35b3+gKEcokiaomEh/6AUnUVl wWb3tP51qeQqvMuvvkTrCbwJWOT2nyxjpuVs4= X-Forwarded-Encrypted: i=1; AJvYcCU/4iL0TP7795xNdCCYUYvlFCrJXoXppzGLdHKuLt4Q7Z0CWoaKsgIscgmaUfXCTe+U680BmLNXu6owJiE=@vger.kernel.org X-Received: by 2002:a05:7300:d09:b0:2a4:3593:9686 with SMTP id 5a478bee46e88-2ab92d39d8amr1444460eec.3.1764762017366; Wed, 03 Dec 2025 03:40:17 -0800 (PST) X-Received: by 2002:a05:7300:d09:b0:2a4:3593:9686 with SMTP id 5a478bee46e88-2ab92d39d8amr1444441eec.3.1764762016700; Wed, 03 Dec 2025 03:40:16 -0800 (PST) Received: from photon-dev-haas.. ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2a965b1ceeesm63324781eec.5.2025.12.03.03.40.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Dec 2025 03:40:16 -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.6 1/4] sched/fair: Revert max_newidle_lb_cost bump Date: Wed, 3 Dec 2025 11:22:52 +0000 Message-Id: <20251203112255.1738272-2-ajay.kaher@broadcom.com> X-Mailer: git-send-email 2.40.4 In-Reply-To: <20251203112255.1738272-1-ajay.kaher@broadcom.com> References: <20251203112255.1738272-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.6 ] 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 7f23b866c..842d54a91 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11710,14 +11710,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)) { /* @@ -12403,17 +12397,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