-
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
wqueue remove enter_critical_section #14623
base: master
Are you sure you want to change the base?
Conversation
[Experimental Bot, please feedback here] No, this PR summary does not adequately meet the NuttX requirements. Here's why and how to fix it: Missing Information in Summary:
Missing Information in Impact:
Missing Information in Testing:
Example of a better Summary: This PR replaces the use of Example of a better Impact section (hypothetical):
By providing complete and detailed information in your PR, you make it easier for reviewers to understand your changes and ensure they meet the project's standards. This will lead to a faster and smoother review process. |
e2e9525
to
d7d8355
Compare
Note that some places said work_cancel() only returns success, these comments need to be fixed. i.e.:
|
This PR requires #14578 to be merged first. |
|
||
/* Remove the notification from the pending list */ | ||
|
||
dq_rem(¬ifier->entry, &g_notifier_pending); | ||
notifier = work_notifier_find(notifier->key); | ||
if (notifier != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need skip line 167 if notifier is NULL
leave_critical_section(flags); | ||
/* We have being canceled */ | ||
|
||
if (work->worker != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, there was no need for additional checks mainly because work_timer_expiry was within a critical section, and the cancellation also took place within the same critical section. If it was canceled, the callback for work_timer_expiry would not be triggered. However, now that we have switched to using smaller locks and the cancellation point is outside the critical section, we need to add a check.
@hujun260 many comments aren't addressed in the new reversion yet. |
c487a1d
to
45c5016
Compare
reason: We decouple semcount from business logic by using an independent counting variable, which allows us to remove critical sections in many cases. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Summary
Impact
work queue
Testing
Build Host:
OS: Ubuntu 20.04
CPU: x86_64
Compiler: GCC 9.4.0
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