sched/task_exit.c: Refresh current CPU instead of relying on stale value
Summary
The comment about the CPU index remaining stable is incorrect. There is no guarantee the task does not yield during the exit process, meaning the CPU can most definitely change. Also, there is no reason why it should not be allowed to change -> refresh current CPU ID whenever is used.
This fixes a full system crash during process exit when the CPU changes and we query the current task from the old CPU.
Impact
Fix task/process exit logic, when CONFIG_SMP=y. No other parts are affected.
Testing
qemu-rv:ksmp64 Unpublished MPFS SMP target
[Experimental Bot, please feedback here]
The provided PR description does not meet all of the NuttX requirements. Here's a breakdown:
Strengths:
- Clear Summary: The summary explains the problem (incorrect assumption about CPU index stability), the solution (refreshing CPU ID), and the positive outcome (fixing a crash).
- Impact is addressed: The impact section highlights the specific area affected (task/process exit logic) and clarifies that it only applies when CONFIG_SMP=y.
Weaknesses:
- Missing Details in Impact:
- User Impact: While it mentions no other parts are affected, it doesn't explicitly state if users need to adapt. A clear "NO" is preferable.
- Build Impact: Similarly, a clear "NO" is needed if the build process is unchanged.
- Other Impacts: The description should include "NO" for all other impact categories (hardware, documentation, security, compatibility) to demonstrate these aspects were considered.
- Insufficient Testing Information:
- Build Host Details: Provide information about the build host OS, CPU, and compiler version used for testing.
- Target Details: Be more specific about the unpublished MPFS SMP target. Mention the architecture and board if possible.
- Missing Logs: The testing logs sections are empty. Include relevant logs demonstrating the issue before the change and the successful outcome after the change.
Recommendation:
Revise the PR description to address the missing information and provide more comprehensive testing details.