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/pthread: repalce sched_lock to enter_critical_section #9002

Merged
merged 1 commit into from Apr 23, 2023

Conversation

Gary-Hobson
Copy link
Contributor

@Gary-Hobson Gary-Hobson commented Apr 11, 2023

Summary

Repalce sched_lock to enter_critical_section

After RR is enabled, an interrupt occurs during this period and the task cannot be switched

Impact

Testing

@pkarashchenko
Copy link
Contributor

pkarashchenko commented Apr 11, 2023

I'm in the middle of implementation for ostest for scheduler lock/unlock and has draft change to fix it #7464
Could you please try if the change helps in this particular case?

UPDATE: No, the changes are still not ready

@pkarashchenko
Copy link
Contributor

Please see apache/nuttx-apps#1711

@Gary-Hobson
Copy link
Contributor Author

I'm in the middle of implementation for ostest for scheduler lock/unlock and has draft change to fix it #7464 Could you please try if the change helps in this particular case?

UPDATE: No, the changes are still not ready

This change has nothing to do with priority inheritance.
It is encountered when running the libuv test set, and there is a case (uv_run_test async) that will busy wait for a mutex.

The time to turn off scheduling in pthread_mutex_timedlock is too long. After turning on the time slice rotation, every time an interrupt is triggered, it is in the state of off scheduling, resulting in the task not being able to switch tasks.

@pkarashchenko
Copy link
Contributor

Please fix commit message sched_lcok -> sched_lock

@Gary-Hobson
Copy link
Contributor Author

Please fix commit message sched_lcok -> sched_lock
done

@pkarashchenko pkarashchenko changed the title sched/pthread: repalce sched_lcok to enter_critical_section sched/pthread: repalce sched_lock to enter_critical_section Apr 13, 2023
@pkarashchenko
Copy link
Contributor

Please rebase to get CI pass

@pkarashchenko
Copy link
Contributor

Can issue be easily reproduced? What are the steps?

@xiaoxiang781216
Copy link
Contributor

@Gary-Hobson please rebase your change.

After RR is enabled, an interrupt occurs during this period and the task cannot be switched

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit a40a802 into apache:master Apr 23, 2023
26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.2.0 Jun 13, 2023
@jerpelea jerpelea moved this from To-Add to In Progress in Release Notes - 12.2.0 Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants