From nobody Mon May 25 00:08:59 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3908A376A15; Wed, 20 May 2026 08:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266051; cv=none; b=T//vWLb++cT8rgw/ri1Q0OH54RRHwgvacaTMWA6+nVDpyI0WIkbBzXa0DZBZOPxoTSdyxE9rzGZvTwBn28DfiNiLbOTVE/J+xUbqPB9TSIPJcI5166J9D63LF7A/dajZ27LXSWsO9X31SUm7ZyACU68/Sl/zNcVDSSNt0f63/48= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266051; c=relaxed/simple; bh=WffYOC7Oe6mvWOdVISviaP4eeRgLfa9ajFy3fSK8hu8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=s5klCqpGYV+SpAsf73knDk9jo1Xb4qOoWICQ58DzXSo+6L5l8ArRogatDgUAqySaZImI3TZpVwwsEavDC8nTvTY40mSiSRZfPiUTYHYOSfcFGVpd254T6v1fjjRdL0xpvTq7YIJFMSQjpDVcT3SrTSgCI9z6PBHZGVulxgxNpco= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ELLF/3gE; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Am8A3b/k; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ELLF/3gE"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Am8A3b/k" Date: Wed, 20 May 2026 08:34:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779266048; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4i6pd508WJioG070AdRxeCJyDeFYMhuUHn7xyC2L/1M=; b=ELLF/3gE7HXO+pjfIFJAcx+wQSCrf/A6fYRfWqXxk5r40cYcdESlHr/kNninIir1qoIWpu EOo88zEgbK+GLCptznhvdKgKN1ZKNeREHHai08SCnMNmigF18CgiQJzbNtNqJTqnIe6K/C X2ldKjQLSCwLn85P650UbZyXeFmWf1LPfFt6+7QGA4dz5G5m8/HNo5kelGrGiwTvdvDAtH McZpm/9AJTo8QtzIGaI3bFw0/n6EJZW7aKW8sLeBKBQ0L/lXE5lV7vgPf71qCcuGG9pFMK NCFxTJv+59fd4z7iWVbteXWeAvwkMDwn5464XSvbtilpA6CdEFlWljf8yFLSwg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779266048; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4i6pd508WJioG070AdRxeCJyDeFYMhuUHn7xyC2L/1M=; b=Am8A3b/kCWWEH47XVEZocbq/4UbEpBfZQQCiZg30EFYaKNj+yNeIsEUmZG7vVRefmHleWh lzDzzz+reA6sL1CQ== From: "tip-bot2 for Shrikanth Hegde" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: Unify SMT active check via sched_smt_active() Cc: Shrikanth Hegde , "Peter Zijlstra (Intel)" , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260515172456.542799-5-sshegde@linux.ibm.com> References: <20260515172456.542799-5-sshegde@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177926604743.711.10837985488494811458.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: acbdbab75ff4b1b87ab3c3d2b6ca86948f472189 Gitweb: https://git.kernel.org/tip/acbdbab75ff4b1b87ab3c3d2b6ca86948= f472189 Author: Shrikanth Hegde AuthorDate: Fri, 15 May 2026 22:54:56 +05:30 Committer: Peter Zijlstra CommitterDate: Tue, 19 May 2026 12:17:37 +02:00 sched: Unify SMT active check via sched_smt_active() There is a use of sched_smt_active() and explicit use of sched_smt_present. Remove the explicit usage for better code maintenance and readability. Note that this differs slightly for update_idle_core. It used to call static_branch_unlikely earlier and now it will call static_branch_likely. Signed-off-by: Shrikanth Hegde Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://patch.msgid.link/20260515172456.542799-5-sshegde@linux.ibm.com --- kernel/sched/core_sched.c | 2 +- kernel/sched/fair.c | 2 +- kernel/sched/sched.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core_sched.c b/kernel/sched/core_sched.c index 73b6b24..43e0bde 100644 --- a/kernel/sched/core_sched.c +++ b/kernel/sched/core_sched.c @@ -136,7 +136,7 @@ int sched_core_share_pid(unsigned int cmd, pid_t pid, e= num pid_type type, struct pid *grp; int err =3D 0; =20 - if (!static_branch_likely(&sched_smt_present)) + if (!sched_smt_active()) return -ENODEV; =20 BUILD_BUG_ON(PR_SCHED_CORE_SCOPE_THREAD !=3D PIDTYPE_PID); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 14bd31b..bcaaddd 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2247,7 +2247,7 @@ numa_type numa_classify(unsigned int imbalance_pct, static inline bool test_idle_cores(int cpu); static inline int numa_idle_core(int idle_core, int cpu) { - if (!static_branch_likely(&sched_smt_present) || + if (!sched_smt_active() || idle_core >=3D 0 || !test_idle_cores(cpu)) return idle_core; =20 diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index e476623..ffe77b2 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1671,7 +1671,7 @@ extern void __update_idle_core(struct rq *rq); =20 static inline void update_idle_core(struct rq *rq) { - if (static_branch_unlikely(&sched_smt_present)) + if (sched_smt_active()) __update_idle_core(rq); } =20