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

[Wisp] Use global Coroutine list #227

Open
joeyleeeeeee97 opened this issue Apr 20, 2021 · 0 comments
Open

[Wisp] Use global Coroutine list #227

joeyleeeeeee97 opened this issue Apr 20, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@joeyleeeeeee97
Copy link
Contributor

joeyleeeeeee97 commented Apr 20, 2021

Description
Thanks shiyue.xw for his initial work.

image
Wisp2 use N:M scheduler to prevent starving and unbalanced task queues, but the underlying VM representation of a coroutine is still bound to a carrier thread, which leads to unnecessary lock contention and heavier coroutine stealing.

So we introduce a global coroutine list like threads_list for all java threads, hereby removed the stealing lock (intended to prevent the coroutine list on carrier thread).

The global list contended when multiple carrier threads are inserting new coroutines the same time, coroutine list cleaning up is done during safepoint time.

@joeyleeeeeee97 joeyleeeeeee97 self-assigned this Apr 20, 2021
joeyleeeeeee97 pushed a commit to joeyleeeeeee97/dragonwell8_jdk that referenced this issue Apr 20, 2021
Summary:
Since there is no need to move the coroutine in coroutine list,
the lock is useless. So remove it.

Test Plan: all wisp cases

Reviewed-by: lei.yul, zhengxiaolinX

Issue: dragonwell-project/dragonwell8#227
joeyleeeeeee97 pushed a commit to joeyleeeeeee97/dragonwell8_hotspot that referenced this issue Apr 20, 2021
…h thread

Summary:
Currently, we need to add a lock when we steal a coroutine.
If the lock can't be got, the stealing failed.
Use global coroutine list to avoid the moving in coroutine list.
When we steal the coroutine, we only set the thread in the coroutine.
With the change, the success rate has been greatly increased.

Test Plan: all wisp cases

Reviewed-by: lei.yul, zhengxiaolinX

Issue: dragonwell-project/dragonwell8#227
joeyleeeeeee97 pushed a commit to joeyleeeeeee97/dragonwell8_hotspot that referenced this issue Apr 20, 2021
…h thread

Summary:
Currently, we need to add a lock when we steal a coroutine.
If the lock can't be got, the stealing failed.
Use global coroutine list to avoid the moving in coroutine list.
When we steal the coroutine, we only set the thread in the coroutine.
With the change, the success rate has been greatly increased.

Test Plan: all wisp cases

Reviewed-by: lei.yul, zhengxiaolinX

Issue: dragonwell-project/dragonwell8#227
@joeyleeeeeee97 joeyleeeeeee97 added the enhancement New feature or request label Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant