2022-04-22 23:00:02

by Donghai Qiao

[permalink] [raw]
Subject: [PATCH v2 06/11] smp: use smp_call_private() fron irq_work.c and core.c

irq_work.c and core.c should use the cross interface rather than
using a unpublished internal function __smp_call_single_queue.

Signed-off-by: Donghai Qiao <[email protected]>
---
v1 -> v2: removed 'x' from the function names and change XCALL to SMP_CALL from the new macros

kernel/irq_work.c | 4 ++--
kernel/sched/core.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/irq_work.c b/kernel/irq_work.c
index f7df715ec28e..0d17c9d03d03 100644
--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -159,8 +159,8 @@ bool irq_work_queue_on(struct irq_work *work, int cpu)
if (!irq_work_claim(work))
goto out;
}
-
- __smp_call_single_queue(cpu, &work->node.llist);
+ smp_call_private(cpu, (call_single_data_t *)&work->node.llist,
+ SMP_CALL_TYPE_IRQ_WORK);
} else {
__irq_work_queue_local(work);
}
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 51efaabac3e4..4fda3dfb887b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3780,7 +3780,7 @@ static void __ttwu_queue_wakelist(struct task_struct *p, int cpu, int wake_flags
p->sched_remote_wakeup = !!(wake_flags & WF_MIGRATED);

WRITE_ONCE(rq->ttwu_pending, 1);
- __smp_call_single_queue(cpu, &p->wake_entry.llist);
+ smp_call_private(cpu, (call_single_data_t *)&p->wake_entry.llist, SMP_CALL_TYPE_TTWU);
}

void wake_up_if_idle(int cpu)
--
2.27.0


2022-04-25 16:51:43

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH v2 06/11] smp: use smp_call_private() fron irq_work.c and core.c

On Fri, Apr 22, 2022 at 04:00:35PM -0400, Donghai Qiao wrote:
> irq_work.c and core.c should use the cross interface rather than
> using a unpublished internal function __smp_call_single_queue.

They should do no such thing, using an unpublished/private interface was
on purpose. Nobody else should be able to do these things.