File tree Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -332,10 +332,6 @@ JL_DLLEXPORT jl_array_t *jl_live_tasks(void)
332
332
size_t l = 0 ; // l is not reset on restart, so we keep getting more aggressive at making a big enough list everything it fails
333
333
restart :
334
334
for (size_t i = 0 ; i < nthreads ; i ++ ) {
335
- // skip GC threads since they don't have tasks
336
- if (gc_first_tid <= i && i < gc_first_tid + jl_n_gcthreads ) {
337
- continue ;
338
- }
339
335
jl_ptls_t ptls2 = allstates [i ];
340
336
if (ptls2 == NULL )
341
337
continue ;
@@ -349,10 +345,6 @@ JL_DLLEXPORT jl_array_t *jl_live_tasks(void)
349
345
allstates = jl_atomic_load_relaxed (& jl_all_tls_states );
350
346
size_t j = 0 ;
351
347
for (size_t i = 0 ; i < nthreads ; i ++ ) {
352
- // skip GC threads since they don't have tasks
353
- if (gc_first_tid <= i && i < gc_first_tid + jl_n_gcthreads ) {
354
- continue ;
355
- }
356
348
jl_ptls_t ptls2 = allstates [i ];
357
349
if (ptls2 == NULL )
358
350
continue ;
Original file line number Diff line number Diff line change @@ -478,6 +478,16 @@ STATIC_INLINE int gc_is_parallel_collector_thread(int tid) JL_NOTSAFEPOINT
478
478
return tid >= gc_first_tid && tid <= gc_last_parallel_collector_thread_id ();
479
479
}
480
480
481
+ STATIC_INLINE int gc_is_concurrent_collector_thread (int tid ) JL_NOTSAFEPOINT
482
+ {
483
+ if (jl_n_sweepthreads == 0 ) {
484
+ return 0 ;
485
+ }
486
+ int last_parallel_collector_thread_id = gc_last_parallel_collector_thread_id ();
487
+ int concurrent_collector_thread_id = last_parallel_collector_thread_id + 1 ;
488
+ return tid == concurrent_collector_thread_id ;
489
+ }
490
+
481
491
STATIC_INLINE int gc_random_parallel_collector_thread_id (jl_ptls_t ptls ) JL_NOTSAFEPOINT
482
492
{
483
493
assert (jl_n_markthreads > 0 );
Original file line number Diff line number Diff line change 5
5
utilities for walking the stack and looking up information about code addresses
6
6
*/
7
7
#include <inttypes.h>
8
+ #include "gc.h"
8
9
#include "julia.h"
9
10
#include "julia_internal.h"
10
11
#include "threading.h"
@@ -1215,11 +1216,15 @@ JL_DLLEXPORT void jl_print_task_backtraces(int show_done) JL_NOTSAFEPOINT
1215
1216
size_t nthreads = jl_atomic_load_acquire (& jl_n_threads );
1216
1217
jl_ptls_t * allstates = jl_atomic_load_relaxed (& jl_all_tls_states );
1217
1218
for (size_t i = 0 ; i < nthreads ; i ++ ) {
1218
- // skip GC threads since they don't have tasks
1219
- if (gc_first_tid <= i && i < gc_first_tid + jl_n_gcthreads ) {
1219
+ jl_ptls_t ptls2 = allstates [i ];
1220
+ if (gc_is_parallel_collector_thread (i )) {
1221
+ jl_safe_printf ("==== Skipping backtrace for parallel GC thread %zu\n" , i + 1 );
1222
+ continue ;
1223
+ }
1224
+ if (gc_is_concurrent_collector_thread (i )) {
1225
+ jl_safe_printf ("==== Skipping backtrace for concurrent GC thread %zu\n" , i + 1 );
1220
1226
continue ;
1221
1227
}
1222
- jl_ptls_t ptls2 = allstates [i ];
1223
1228
if (ptls2 == NULL ) {
1224
1229
continue ;
1225
1230
}
You can’t perform that action at this time.
0 commit comments