-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make profiling more robust with many tasks (#42978)
This patch includes two sets of changes. (1) `jl_thread_suspend_and_get_state` uses `pthread_cond_timedwait` to recover from the case where the request is not received by the signal handler. This is required because `usr2_handler` contains some paths for the case where it is not possible to obtain `ptls`. (2) `ctx_switch` now makes sure to null out `ptls` of the last task (`lastt->ptls = NULL`) after changing the current task by updating pgcstack (`jl_set_pgcstack(&t->gcstack)`). This closes the gap in which `usr2_handler` can observe the null `ptls`. Co-authored-by: Jameson Nash <[email protected]>
- Loading branch information
Showing
4 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is a part of Julia. License is MIT: https://julialang.org/license | ||
|
||
using Profile | ||
|
||
function spawnmany(n) | ||
if n > 2 | ||
m = n ÷ 2 | ||
t = Threads.@spawn spawnmany(m) | ||
spawnmany(m) | ||
wait(t) | ||
end | ||
end | ||
|
||
@profile spawnmany(parse(Int, get(ENV, "NTASKS", "2000000"))) |
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
8131580
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.
Executing the daily package evaluation, I will reply here when finished:
@nanosoldier
runtests(ALL, isdaily = true)
8131580
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.
Your package evaluation job has completed - possible new issues were detected. A full report can be found here.
8131580
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.
Executing the daily package evaluation, I will reply here when finished:
@nanosoldier
runtests(ALL, isdaily = true)
8131580
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.
Your package evaluation job has completed - possible issues were detected. A full report can be found here.