Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sched: support smp function call #10934

Merged
merged 2 commits into from Oct 18, 2023
Merged

Conversation

zyfeier
Copy link
Contributor

@zyfeier zyfeier commented Oct 17, 2023

Summary

The smp function call allows specifying a function to be executed by another core. The wait parameter can be used to choose whether to wait or not for the other core to finish executing, it should be noted that there should be no waiting operations in the executed function.

This PR include:

  1. Add smp function call support in sched;
  2. ARM64 support smp function call, other architectures will be added gradually;

Impact

NA

Testing

board:
qemu-armv8a:nsh_smp enable CONFIG_SMP_CALL

test code:

int test_smp_call_func(void *arg)
{
  syslog(0, "test_smp_call_func:%d\n", up_cpu_index());
  syslog_flush();
  return 0;
}

int test_smp_call(int argc, FAR char *argv[])
{
  nxsched_smp_call_single(1, test_smp_call_func, NULL, false);
  nxsched_smp_call_single(1, test_smp_call_func, NULL, true);
  nxsched_smp_call(0xf, test_smp_call_func, NULL, false);
  nxsched_smp_call(0xf, test_smp_call_func, NULL, true);
}

Support smp function call, calling smp_call_function allows
a specific core to execute a function. It should be noted
that there should be no waiting operations in the executed
function.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
Add up_send_smp_call function to support smp function call.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
@acassis
Copy link
Contributor

acassis commented Oct 17, 2023

@zyfeier I think a similar testing should be included into ostest (including some why to detect it was ran in the right core) and executed when CONFIG_SMP_CALL is enabled.

@zyfeier
Copy link
Contributor Author

zyfeier commented Oct 18, 2023

@zyfeier I think a similar testing should be included into ostest (including some why to detect it was ran in the right core) and executed when CONFIG_SMP_CALL is enabled.

Ok, i'll add test case to ostest.

@xiaoxiang781216 xiaoxiang781216 merged commit 48ca996 into apache:master Oct 18, 2023
26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.4.0 Dec 27, 2023
@jerpelea jerpelea moved this from To-Add to core in Release Notes - 12.4.0 Jan 8, 2024
@jerpelea jerpelea moved this from core to processed in Release Notes - 12.4.0 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants