From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Chris Mason <clm@meta.com>
Subject: [PATCH 6.18 2/5] sched/fair: Small cleanup to sched_balance_newidle()
Date: Fri, 9 Jan 2026 12:44:04 +0100 [thread overview]
Message-ID: <20260109111950.440046196@linuxfoundation.org> (raw)
In-Reply-To: <20260109111950.344681501@linuxfoundation.org>
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
commit e78e70dbf603c1425f15f32b455ca148c932f6c1 upstream.
Pull out the !sd check to simplify code.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Chris Mason <clm@meta.com>
Link: https://patch.msgid.link/20251107161739.525916173@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/fair.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -12787,14 +12787,16 @@ static int sched_balance_newidle(struct
rcu_read_lock();
sd = rcu_dereference_check_sched_domain(this_rq->sd);
+ if (!sd) {
+ rcu_read_unlock();
+ goto out;
+ }
if (!get_rd_overloaded(this_rq->rd) ||
- (sd && this_rq->avg_idle < sd->max_newidle_lb_cost)) {
+ this_rq->avg_idle < sd->max_newidle_lb_cost) {
- if (sd)
- update_next_balance(sd, &next_balance);
+ update_next_balance(sd, &next_balance);
rcu_read_unlock();
-
goto out;
}
rcu_read_unlock();
next prev parent reply other threads:[~2026-01-09 11:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 11:44 [PATCH 6.18 0/5] 6.18.5-rc1 review Greg Kroah-Hartman
2026-01-09 11:44 ` [PATCH 6.18 1/5] mptcp: ensure context reset on disconnect() Greg Kroah-Hartman
2026-01-09 11:44 ` Greg Kroah-Hartman [this message]
2026-01-09 11:44 ` [PATCH 6.18 3/5] sched/fair: Small cleanup to update_newidle_cost() Greg Kroah-Hartman
2026-01-09 11:44 ` [PATCH 6.18 4/5] sched/fair: Proportional newidle balance Greg Kroah-Hartman
2026-01-09 11:44 ` [PATCH 6.18 5/5] nfs/localio: fix regression due to out-of-order __put_cred Greg Kroah-Hartman
2026-01-09 13:17 ` [PATCH 6.18 0/5] 6.18.5-rc1 review Ronald Warsow
2026-01-09 13:55 ` Slade Watkins
2026-01-09 16:26 ` Achill Gilgenast
2026-01-09 17:32 ` Jon Hunter
2026-01-09 19:01 ` Brett A C Sheffield
2026-01-09 21:53 ` Brett Mastbergen
2026-01-09 22:06 ` Florian Fainelli
2026-01-09 23:56 ` Shuah Khan
2026-01-10 1:56 ` Peter Schneider
2026-01-10 4:17 ` Takeshi Ogasawara
2026-01-10 6:45 ` Ron Economos
2026-01-10 9:53 ` Jeffrin Thalakkottoor
2026-01-10 11:28 ` Mark Brown
2026-01-10 21:25 ` Miguel Ojeda
2026-01-12 10:23 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260109111950.440046196@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=clm@meta.com \
--cc=dietmar.eggemann@arm.com \
--cc=patches@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox