-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
change nxsched_islocked_global to nxsched_islocked_tcb #13716
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
Area: OS Components
OS Components issues
Size: M
The size of the change in this PR is medium
labels
Sep 29, 2024
[Experimental Bot, please feedback here] NuttX PR Requirements ReviewWhile this PR summary provides context and reasoning for the changes, it partially meets NuttX's PR requirements. Here's what's missing or needs improvement:
Recommendations:
By addressing these points, your PR will be more informative and easier for reviewers to assess. |
reason: 1 To improve efficiency, we mimic Linux's behavior where preemption disabling is only applicable to the current CPU and does not affect other CPUs. 2 In the future, we will implement "spinlock+sched_lock", and use it extensively. Under such circumstances, if preemption is still globally disabled, it will seriously impact the scheduling efficiency. 3 We have removed g_cpu_lockset and used irqcount in order to eliminate the dependency of schedlock on critical sections in the future, simplify the logic, and further enhance the performance of sched_lock. 4 We set lockcount to 1 in order to lock scheduling on all CPUs during startup, without the need to provide additional functions to disable scheduling on other CPUs. 5 Cpu1~n must wait for cpu0 to enter the idle state before enabling scheduling because it prevents CPUs1~n from competing with cpu0 for the memory manager mutex, which could cause the cpu0 idle task to enter a wait state and trigger an assert. size nuttx before: text data bss dec hex filename 265396 51057 63646 380099 5ccc3 nuttx after: text data bss dec hex filename 265184 51057 63642 379883 5cbeb nuttx size -216 Configuring NuttX and compile: $ ./tools/configure.sh -l qemu-armv8a:nsh_smp $ make Running with qemu $ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \ -machine virt,virtualization=on,gic-version=3 \ -net none -chardev stdio,id=con,mux=on -serial chardev:con \ -mon chardev=con,mode=readline -kernel ./nuttx Signed-off-by: hujun5 <[email protected]>
Signed-off-by: hujun5 <[email protected]>
xiaoxiang781216
approved these changes
Oct 5, 2024
hujun260
added a commit
to hujun260/nuttx
that referenced
this pull request
Oct 8, 2024
This commit fixes the regression from apache#13716 Signed-off-by: hujun5 <[email protected]>
hujun260
added a commit
to hujun260/nuttx
that referenced
this pull request
Oct 9, 2024
This commit fixes the regression from apache#13716 Signed-off-by: hujun5 <[email protected]>
hujun260
added a commit
to hujun260/nuttx
that referenced
this pull request
Oct 9, 2024
This commit fixes the regression from apache#13716 Signed-off-by: hujun5 <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Oct 9, 2024
This commit fixes the regression from #13716 Signed-off-by: hujun5 <[email protected]>
jerpelea
pushed a commit
to jerpelea/nuttx
that referenced
this pull request
Oct 10, 2024
This commit fixes the regression from apache#13716 Signed-off-by: hujun5 <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Oct 10, 2024
This commit fixes the regression from #13716 Signed-off-by: hujun5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
1 To improve efficiency, we mimic Linux's behavior where preemption disabling is
only applicable to the current CPU and does not affect other CPUs.
2 In the future, we will implement "spinlock+sched_lock", and use it extensively.
Under such circumstances, if preemption is still globally disabled, it will seriously impact
the scheduling efficiency.
3 We have removed g_cpu_lockset and used irqcount in order to eliminate the dependency of
schedlock on critical sections in the future, simplify the logic, and further enhance the
performance of sched_lock.
4 We set lockcount to 1 in order to lock scheduling on all CPUs during startup, without
the need to provide additional functions to disable scheduling on other CPUs.
5 Cpu (1-n) must wait for cpu0 to enter the idle state before enabling scheduling because
it prevents CPUs1~n from competing with cpu0 for the memory manager mutex, which could
cause the cpu0 idle task to enter a wait state and trigger an assert.
Impact
sched_lock/sched_unlock
Testing
ostest