History

smp: Add source and destination CPUs to __call_single_data

This commit adds a destination CPU to __call_single_data, and is inspired by an earlier commit by Peter Zijlstra. This version adds #ifdef to permit use by 32-bit systems and supplying the destination CPU for all smp_call_function*() requests, not just smp_call_function_single(). If need be, 32-bit systems could be accommodated by shrinking the flags field to 16 bits (the atomic_t variant is currently unused) and by providing only eight bits for CPU on such systems. It is not clear that the addition of the fields to __call_single_node are really needed. [ paulmck: Apply Boqun Feng feedback on 32-bit builds. ] Link: https://lore.kernel.org/lkml/20200615164048.GC2531@hirez.programming.kicks-ass.net/ Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

Paul E. McKenney committed 6 years ago

Commit e48c15b1 parent 160c7ba3 files · +12 −0Browse files

Showing the changes to kernel (1 of 3 files). Show all

Unified · Split

kernel/smp.c+6−0
@@ -375,6 +375,9 @@ int smp_call_function_single(int cpu, smp_call_func_t func, void *info, · 374 unmodified lines
375 375
376 csd->func = func;376 csd->func = func;
377 csd->info = info;377 csd->info = info;
378#ifdef CONFIG_64BIT
379 csd->dst = cpu;
380#endif
378 381
379 err = generic_exec_single(cpu, csd);382 err = generic_exec_single(cpu, csd);
380 383
@@ -540,6 +543,9 @@ static void smp_call_function_many_cond(const struct cpumask *mask, · 159 unmodified lines
540 csd->flags |= CSD_TYPE_SYNC;543 csd->flags |= CSD_TYPE_SYNC;
541 csd->func = func;544 csd->func = func;
542 csd->info = info;545 csd->info = info;
546#ifdef CONFIG_64BIT
547 csd->dst = cpu;
548#endif
543 if (llist_add(&csd->llist, &per_cpu(call_single_queue, cpu)))549 if (llist_add(&csd->llist, &per_cpu(call_single_queue, cpu)))
544 __cpumask_set_cpu(cpu, cfd->cpumask_ipi);550 __cpumask_set_cpu(cpu, cfd->cpumask_ipi);
545 }551 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t