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 optimise for sim, CONFIG_SCHED_INSTRUMENTATION to CONFIG_SCHED_INSTRUMENTATION_SWITCH #13688

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

jasonbu
Copy link
Contributor

@jasonbu jasonbu commented Sep 27, 2024

Summary

sched_smp:sync refcount before enqueue smp call queue
sched_smp:adjust the critical section to protect refcount from multi cores access

fix build error when sim SMP

CC: sim/sim_smpsignal.c init/nx_smpstart.c: In function ‘nx_idle_trampoline’:
init/nx_smpstart.c:68:21: warning: unused variable ‘tcb’ [-Wunused-variable]
68 | FAR struct tcb_s *tcb = this_task_inirq();
| ^~~
sim/sim_smpsignal.c: In function ‘host_cpu_started’:
sim/sim_smpsignal.c:271:17: warning: unused variable ‘tcb’ [-Wunused-variable]
271 | struct tcb_s *tcb = this_task();

sim/sim_smpsignal.c:249:33: error: ‘cpu’ undeclared (first use in this function)
249 | restore_critical_section(tcb, cpu);
| ^~~

Impact

SMP call more safe,
SIM able to enable SMP

Testing

CI test

dulibo1 added 2 commits September 27, 2024 17:42
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>

1.call_data->refcount is not remote_cpus;
2.nxsched_smp_call_add enqueue  the call_data;
3.maybe nxsched_smp_call_handler is just doing;
4.dequeue the call_data but call_data->refcount is not corret;
5.unpredictability case will occur;
…cores access

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
@github-actions github-actions bot added Arch: simulator Issues related to the SIMulator Area: OS Components OS Components issues Size: S The size of the change in this PR is small labels Sep 27, 2024
@nuttxpr
Copy link

nuttxpr commented Sep 27, 2024

[Experimental Bot, please feedback here]

I need the content of the PR to tell you if it meets the requirements. The requirements are comprehensive, but to make sure they are met, you need to provide the PR content.

For example, I need to see:

  • What the PR actually changes to understand the impact and if testing is adequate.
  • The testing logs to verify the change works as intended.
  • Any new documentation or build instructions to confirm those requirements are met.

Please provide the PR content so I can give you a complete analysis.

CC:  sim/sim_smpsignal.c init/nx_smpstart.c: In function ‘nx_idle_trampoline’:
init/nx_smpstart.c:68:21: warning: unused variable ‘tcb’ [-Wunused-variable]
   68 |   FAR struct tcb_s *tcb = this_task_inirq();
      |                     ^~~
sim/sim_smpsignal.c: In function ‘host_cpu_started’:
sim/sim_smpsignal.c:271:17: warning: unused variable ‘tcb’ [-Wunused-variable]
  271 |   struct tcb_s *tcb = this_task();

sim/sim_smpsignal.c:249:33: error: ‘cpu’ undeclared (first use in this function)
  249 |   restore_critical_section(tcb, cpu);
      |                                 ^~~

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
@jasonbu jasonbu changed the title sched optimise sched optimise for sim, CONFIG_SCHED_INSTRUMENTATION to CONFIG_SCHED_INSTRUMENTATION_SWITCH Sep 27, 2024
@jasonbu jasonbu marked this pull request as ready for review September 27, 2024 15:00
@xiaoxiang781216 xiaoxiang781216 merged commit 3107822 into apache:master Sep 27, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: simulator Issues related to the SIMulator Area: OS Components OS Components issues Size: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants