Skip to content

risc-v: remove g_running_tasks[this_cpu()] = NULL#14984

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
hujun260:apache_41
Dec 2, 2024
Merged

risc-v: remove g_running_tasks[this_cpu()] = NULL#14984
xiaoxiang781216 merged 1 commit into
apache:masterfrom
hujun260:apache_41

Conversation

@hujun260

Copy link
Copy Markdown
Contributor

Summary

risc-v: remove g_running_tasks[this_cpu()] = NULL
reason:
We hope to keep g_running_tasks valid forever.

Impact

riscv

Testing

ci ostest
rv-virt:smp

@github-actions github-actions Bot added Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: S The size of the change in this PR is small labels Nov 29, 2024
@nuttxpr

nuttxpr commented Nov 29, 2024

Copy link
Copy Markdown

[Experimental Bot, please feedback here]

Yes, this PR appears to meet the basic NuttX requirements, although it could be significantly improved. Here's a breakdown:

Strengths:

  • Provides a summary of the change: It explains what is being changed (removing g_running_tasks[this_cpu()] = NULL) and why (to keep g_running_tasks valid).
  • Indicates impact: It specifies the affected architecture (RISC-V).
  • Includes testing information: It mentions CI, ostest, rv-virt, and smp, suggesting some level of testing has been performed.

Weaknesses (and how to improve them):

  • Insufficient detail in the summary: The "how" is missing. How does removing this line keep g_running_tasks valid? What scenario was this line causing problems in? More context is crucial for reviewers.
  • Vague impact assessment: Simply stating "riscv" is not enough. Which RISC-V boards? Are there any performance implications? All the "Impact" checklist items should be explicitly addressed (even with "NO" if they don't apply). For example:
    • Impact on user: NO
    • Impact on build: NO
    • Impact on hardware: YES (RISC-V architecture, specifically...)
    • etc.
  • Missing testing logs: The PR template specifically requests "Testing logs before change" and "Testing logs after change." These are essential for demonstrating the fix works and doesn't introduce regressions. Placeholder comments are not sufficient; actual logs are required.
  • Lack of issue references: If this addresses a specific issue, linking it (even if it's just a local bug you encountered) helps provide context and traceability.

Example of an improved summary:

"risc-v: prevent invalid g_running_tasks entries during context switches

Currently, g_running_tasks[this_cpu()] is set to NULL during context switches. This can lead to issues in scenarios like [briefly describe the scenario, e.g., nested interrupts, certain scheduling edge cases] where code relies on g_running_tasks being consistently valid. This change removes the line setting g_running_tasks[this_cpu()] to NULL, ensuring it always points to the currently running task, even during context switches. This resolves [mention the specific problem being solved, e.g., a crash, incorrect behavior].

Related Issue: [If applicable]"

By addressing these weaknesses, the PR will be much clearer, easier to review, and more likely to be accepted.

Comment thread arch/risc-v/src/common/riscv_doirq.c

@pussuw pussuw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

riscv_syscall_dispatch.c must be fixed too?

@hujun260

Copy link
Copy Markdown
Contributor Author

riscv_syscall_dispatch.c

done

reason:
We hope to keep g_running_tasks valid forever.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
Comment thread arch/risc-v/src/common/riscv_doirq.c
@xiaoxiang781216 xiaoxiang781216 merged commit 4002398 into apache:master Dec 2, 2024
@cuiziwei1

Copy link
Copy Markdown
Contributor

@hujun260

hujun260 commented Dec 2, 2024

Copy link
Copy Markdown
Contributor Author

https://github.com/apache/nuttx/actions/runs/12118307167/job/33782609152?pr=15017 @hujun260 but we have this ci error.

#15014

@lupyuen lupyuen mentioned this pull request Dec 3, 2024
hujun260 added a commit to hujun260/nuttx that referenced this pull request Dec 3, 2024
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
hujun260 added a commit to hujun260/nuttx that referenced this pull request Dec 3, 2024
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
hujun260 added a commit to hujun260/nuttx that referenced this pull request Dec 3, 2024
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
hujun260 added a commit to hujun260/nuttx that referenced this pull request Dec 4, 2024
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
hujun260 added a commit to hujun260/nuttx that referenced this pull request Dec 4, 2024
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
hujun260 added a commit to hujun260/nuttx that referenced this pull request Dec 4, 2024
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
hujun260 added a commit to hujun260/nuttx that referenced this pull request Dec 4, 2024
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
xiaoxiang781216 pushed a commit that referenced this pull request Dec 4, 2024
This commit fixes the regression from #14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
linguini1 pushed a commit to CarletonURocketry/nuttx that referenced this pull request Jan 15, 2025
This commit fixes the regression from apache#14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture 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.

6 participants