From nobody Thu Apr 2 20:28:17 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 D0BC02750ED; Thu, 26 Mar 2026 12:59:56 +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=1774529998; cv=none; b=YZjYygdtw4ab+ZcZ13VpIa/6p7yJeTOiQ9Lid/TAzKnQkU6GFbpyqs3db4evPHgY8+phZvRTpNzQC7e98p87yOwQhxP90rIsb1Ai/R1FOi+eM2TEpc1aP0Khiw0ku4W54qnpgv3W0hvcyGiDYhY/SG7t7CbIK+PC6e+JPY0T3TI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774529998; c=relaxed/simple; bh=+lWFGtBZJC6zTVIjmZtTXL96EeXvviYiVJgtTfcR+x0=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=Ek131ZMJZ/RE6FOa9R1p9Whf8CN2/tqZQGU1F+FiQztrOCH1cbFZ8piR2Odwc5zcfZ6RYjqJbL4gpl5vVqnRsnmopWyYubq8dJbKonCkNaVFHUI652Z033GJ+v1RbHgy8D56hXwUdYEY6tli6B+MZ+4fceyTM6GVem8fTOTKH+w= 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=4PCEIpLq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TpEOUGFX; 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="4PCEIpLq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TpEOUGFX" Date: Thu, 26 Mar 2026 12:59:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774529995; 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=oVYVHSsRiMrN3YEnFKd+B9J0v6Puq/K2we0LsPKyjd0=; b=4PCEIpLq1eCFo92WwWa0ERLpKtVBQjcC4DVF9yb5PAg2+ruTLOf1A0lLWS6SET5LT8g63a 5VTi6V2vbGlgY0NFWwYaBfN/RIboEF/teM26EqNKAjVyJOwAmWJvzyNBfk4glndPEmKlWp JpEImZf5e715tIZeHUwAreyMAGb+OCt7trngPH7XGwOtaC01pmMjtVfkEiWiQCePikaCln x9+h6hr8ucboNLdwRiP5PIS+tmDaIMThwV2+5AH6IlrRHuw1EA8aaQa4P7qIYRZZvIQlcB q1BD6AQtCn3xBb3EelkkhCPCotQINe8L3J4VBhQrlwEJsZuFDVhwjtBJHiwXhA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774529995; 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=oVYVHSsRiMrN3YEnFKd+B9J0v6Puq/K2we0LsPKyjd0=; b=TpEOUGFXJy4LmttVNILbHrFIhocqgqzcf2euPMZLSu9c1eAdVH+q13mZbWddW67YUSV5dX vZbEFbV7zFTvX8CA== 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: smp/core] smp: Get this_cpu once in smp_call_function Cc: Shrikanth Hegde , Thomas Gleixner , "Mukesh Kumar Chaurasiya (IBM)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260323193630.640311-4-sshegde@linux.ibm.com> References: <20260323193630.640311-4-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: <177452999438.1647592.5407190813050683159.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 smp/core branch of tip: Commit-ID: ec39780d6a9e05e7e427008603b40efef515b775 Gitweb: https://git.kernel.org/tip/ec39780d6a9e05e7e427008603b40efef= 515b775 Author: Shrikanth Hegde AuthorDate: Tue, 24 Mar 2026 01:06:29 +05:30 Committer: Thomas Gleixner CommitterDate: Wed, 25 Mar 2026 20:11:30 +01:00 smp: Get this_cpu once in smp_call_function smp_call_function_single() and smp_call_function_many_cond() disable preemption and cache the CPU number via get_cpu(). Use this cached value throughout the function instead of invoking smp_processor_id() again. [ tglx: Make the copy&pasta'ed change log match the patch ] Signed-off-by: Shrikanth Hegde Signed-off-by: Thomas Gleixner Reviewed-by: Mukesh Kumar Chaurasiya (IBM) Link: https://patch.msgid.link/20260323193630.640311-4-sshegde@linux.ibm.com --- kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index b179424..bdbf145 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -678,7 +678,7 @@ int smp_call_function_single(int cpu, smp_call_func_t f= unc, void *info, csd->func =3D func; csd->info =3D info; #ifdef CONFIG_CSD_LOCK_WAIT_DEBUG - csd->node.src =3D smp_processor_id(); + csd->node.src =3D this_cpu; csd->node.dst =3D cpu; #endif =20 @@ -833,7 +833,7 @@ static void smp_call_function_many_cond(const struct cp= umask *mask, csd->func =3D func; csd->info =3D info; #ifdef CONFIG_CSD_LOCK_WAIT_DEBUG - csd->node.src =3D smp_processor_id(); + csd->node.src =3D this_cpu; csd->node.dst =3D cpu; #endif trace_csd_queue_cpu(cpu, _RET_IP_, func, csd);