Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Shrikanth Hegde and committed by
Thomas Gleixner
ec39780d cc562394

+2 -2
+2 -2
kernel/smp.c
··· 678 678 csd->func = func; 679 679 csd->info = info; 680 680 #ifdef CONFIG_CSD_LOCK_WAIT_DEBUG 681 - csd->node.src = smp_processor_id(); 681 + csd->node.src = this_cpu; 682 682 csd->node.dst = cpu; 683 683 #endif 684 684 ··· 833 833 csd->func = func; 834 834 csd->info = info; 835 835 #ifdef CONFIG_CSD_LOCK_WAIT_DEBUG 836 - csd->node.src = smp_processor_id(); 836 + csd->node.src = this_cpu; 837 837 csd->node.dst = cpu; 838 838 #endif 839 839 trace_csd_queue_cpu(cpu, _RET_IP_, func, csd);