From nobody Mon May 25 00:09:52 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 E5CF93C3420; Wed, 20 May 2026 08:34:13 +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=1779266055; cv=none; b=SofIbQ9gQna2kqD57KU8raSEcgwREk3kVqK32cwlCebww/Ouu3kprmGVaFxjh5XulGpak5+U13d05f36YHpL3Z5QtVb2exkeYo90SPFrIA58jb6ix90Mvnbypqr2ZjcfEb3dCrnwW4RP09TnKYydIf/lGv522tofh1KWDbxYUh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266055; c=relaxed/simple; bh=jnoMHEPPU3rZboV9098lyrvWrEZicxUcw0dGbU6fENk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=kY5Fjitv1Tf/YYHCyJyEiYUfGGU6Wc6/6g635M/ApZoDezMrNiDxfiugpW7Qr96BbqERaGmAdTtYmwoHaf+6rbWJkmm1kxRnOnNLb8p6tdNUjCDrdUADWdgPFAqJ8RqBykaSeEeU/ilD89OyRnxuRMd8ICLrWULjydY56y9ivVI= 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=4IXowLYP; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZOUoGkT0; 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="4IXowLYP"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZOUoGkT0" Date: Wed, 20 May 2026 08:34:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779266052; 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=EGPfQWTcRb49tug5w2n3fhQLv0u8RidE1m/N/AikGfk=; b=4IXowLYPv7FW4danXCM9WCCDcpxcMVc7tKsBWAFIt/B21pcR1EfWCA2C0aXGY94kPS64Ay B7YwX2HGEPtM7NGqv5hLhY2U30HSTGjN/SIw7UxytEygj4xUCm5PUv1pQn9LWb3/6zUSZf cUvmqzvQRJdfVOQiM7bh3OMxEu9kUZA1Wn/KwD9ParIxK+kVvI12rp9gouR9f5I+mVR4FC cRXrAqPV5VSWAQGp9IMwIXkRCNHJgOhHZ5yUF6b/oHybUenMmWWEBjyCGbcDmfF7PlmCLP p/7VLUfj9EOkwjEQ3t8At0GlkNZ/+ouDBUGrhcoNUKyeeJzrlCgHWd9D7L8UXQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779266052; 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=EGPfQWTcRb49tug5w2n3fhQLv0u8RidE1m/N/AikGfk=; b=ZOUoGkT0Pvg4ce1FK0h+j/QXlYZz2fR7r2x28Izc26DxPbrvV97Tf+jIJ/H0WkWpgoKtmM eggD0nvrYJQpGEAA== 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] topology: Introduce cpu_smt_mask for CONFIG_SCHED_SMT=n Cc: Shrikanth Hegde , "Peter Zijlstra (Intel)" , Phil Auld , Valentin Schneider , K Prateek Nayak , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260515172456.542799-2-sshegde@linux.ibm.com> References: <20260515172456.542799-2-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: <177926605127.711.6655927563711845744.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: 815c5cb76a3e5dad4fc3911b9073591dc3a29282 Gitweb: https://git.kernel.org/tip/815c5cb76a3e5dad4fc3911b9073591dc= 3a29282 Author: Shrikanth Hegde AuthorDate: Fri, 15 May 2026 22:54:53 +05:30 Committer: Peter Zijlstra CommitterDate: Tue, 19 May 2026 12:17:36 +02:00 topology: Introduce cpu_smt_mask for CONFIG_SCHED_SMT=3Dn Define cpu_smt_mask in case of CONFIG_SCHED_SMT=3Dn as cpumask_of that CPU. With that config, it is expected that kernel treats each CPU as individual core. Using cpumask_of(cpu) reflects that. This would help to get rid of the ifdeffery that is spread across the codebase since cpu_smt_mask is defined only in case of CONFIG_SCHED_SMT=3Dy. Note: There is no arch today which defines cpu_smt_mask unconditionally. So likely defining the cpu_smt_mask shouldn't lead redefinition errors. Signed-off-by: Shrikanth Hegde Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Phil Auld Reviewed-by: Valentin Schneider Tested-by: K Prateek Nayak Link: https://patch.msgid.link/20260515172456.542799-2-sshegde@linux.ibm.com --- include/linux/topology.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/linux/topology.h b/include/linux/topology.h index 6575af3..709a2dc 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -230,11 +230,24 @@ static inline int cpu_to_mem(int cpu) #define topology_drawer_cpumask(cpu) cpumask_of(cpu) #endif =20 -#if defined(CONFIG_SCHED_SMT) && !defined(cpu_smt_mask) +/* + * Defining cpu_smt_mask as cpumask_of that CPU helps to get + * rid of lot of ifdeffery all around the codebase in case of + * CONFIG_SCHED_SMT=3Dn. It just means there are no other siblings, which + * is what is expected. + */ +#if defined(CONFIG_SCHED_SMT) +# if !defined(cpu_smt_mask) static inline const struct cpumask *cpu_smt_mask(int cpu) { return topology_sibling_cpumask(cpu); } +# endif +#else /* !CONFIG_SCHED_SMT */ +static inline const struct cpumask *cpu_smt_mask(int cpu) +{ + return cpumask_of(cpu); +} #endif =20 #ifndef topology_is_primary_thread