Skip to content

Commit

Permalink
smpcall: we directly call the function to handle local smpcall
Browse files Browse the repository at this point in the history
reason:
some arch do not support issuing interrupts to the local CPU.

This commit fixes the regression from #14663

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Nov 6, 2024
1 parent 904b6ff commit 08a23bf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sched/sched/sched_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,18 @@ int nxsched_smp_call(cpu_set_t cpuset, nxsched_smp_call_t func,
nxsem_init(&cookie.sem, 0, 0);

data.cookie = &cookie;
sched_lock();
ret = nxsched_smp_call_async(cpuset, &data);

if (ret < 0)
{
sched_unlock();
nxsem_destroy(&cookie.sem);
return ret;
}

CPU_CLR(this_cpu(), &cpuset);
sched_unlock();
cpucnt = CPU_COUNT(&cpuset);
for (i = 0; i < cpucnt; i++)
{
Expand Down Expand Up @@ -314,6 +318,17 @@ int nxsched_smp_call_async(cpu_set_t cpuset,
sched_lock();
}

if (CPU_ISSET(this_cpu(), &cpuset))
{
ret = data->func(data->arg);
if (ret < 0)
{
goto out;
}

CPU_CLR(this_cpu(), &cpuset);
}

cpucnt = CPU_COUNT(&cpuset);
if (cpucnt == 0)
{
Expand Down

0 comments on commit 08a23bf

Please sign in to comment.