From: "tip-bot2 for Shrikanth Hegde" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>,
Thomas Gleixner <tglx@kernel.org>,
"Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: smp/core] smp: Get this_cpu once in smp_call_function
Date: Thu, 26 Mar 2026 12:59:54 -0000 [thread overview]
Message-ID: <177452999438.1647592.5407190813050683159.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260323193630.640311-4-sshegde@linux.ibm.com>
The following commit has been merged into the smp/core branch of tip:
Commit-ID: ec39780d6a9e05e7e427008603b40efef515b775
Gitweb: https://git.kernel.org/tip/ec39780d6a9e05e7e427008603b40efef515b775
Author: Shrikanth Hegde <sshegde@linux.ibm.com>
AuthorDate: Tue, 24 Mar 2026 01:06:29 +05:30
Committer: Thomas Gleixner <tglx@kernel.org>
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 <sshegde@linux.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
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 func, void *info,
csd->func = func;
csd->info = info;
#ifdef CONFIG_CSD_LOCK_WAIT_DEBUG
- csd->node.src = smp_processor_id();
+ csd->node.src = this_cpu;
csd->node.dst = cpu;
#endif
@@ -833,7 +833,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
csd->func = func;
csd->info = info;
#ifdef CONFIG_CSD_LOCK_WAIT_DEBUG
- csd->node.src = smp_processor_id();
+ csd->node.src = this_cpu;
csd->node.dst = cpu;
#endif
trace_csd_queue_cpu(cpu, _RET_IP_, func, csd);
next prev parent reply other threads:[~2026-03-26 12:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 19:36 [PATCH 0/4] Micro optimise to get this_cpu once Shrikanth Hegde
2026-03-23 19:36 ` [PATCH 1/4] sched/fair: get this cpu once in find_new_ilb Shrikanth Hegde
2026-03-24 9:09 ` [tip: sched/core] sched/fair: Get this cpu once in find_new_ilb() tip-bot2 for Shrikanth Hegde
2026-03-23 19:36 ` [PATCH 2/4] sched/core: get this cpu once in ttwu_queue_cond Shrikanth Hegde
2026-03-24 5:58 ` Mukesh Kumar Chaurasiya
2026-03-24 9:09 ` [tip: sched/core] sched/core: Get this cpu once in ttwu_queue_cond() tip-bot2 for Shrikanth Hegde
2026-03-23 19:36 ` [PATCH 3/4] smp: get this_cpu once in smp_call_function Shrikanth Hegde
2026-03-24 6:02 ` Mukesh Kumar Chaurasiya
2026-03-26 12:59 ` tip-bot2 for Shrikanth Hegde [this message]
2026-03-23 19:36 ` [PATCH 4/4] timers: Get this_cpu once while clearing idle timer Shrikanth Hegde
2026-03-24 6:04 ` Mukesh Kumar Chaurasiya
2026-03-24 22:27 ` [tip: timers/core] timers: Get this_cpu once while clearing the idle state tip-bot2 for Shrikanth Hegde
2026-03-24 6:06 ` [PATCH 0/4] Micro optimise to get this_cpu once Mukesh Kumar Chaurasiya
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=177452999438.1647592.5407190813050683159.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mkchauras@gmail.com \
--cc=sshegde@linux.ibm.com \
--cc=tglx@kernel.org \
--cc=x86@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
all inboxes | Powered by JetHome®