@@ -419,14 +419,21 @@ func isAsyncSafePoint(gp *g, pc, sp, lr uintptr) (bool, uintptr) {
419
419
name := u .srcFunc (uf ).name ()
420
420
if stringslite .HasPrefix (name , "runtime." ) ||
421
421
stringslite .HasPrefix (name , "runtime/internal/" ) ||
422
+ stringslite .HasPrefix (name , "internal/runtime/" ) ||
422
423
stringslite .HasPrefix (name , "reflect." ) {
423
424
// For now we never async preempt the runtime or
424
425
// anything closely tied to the runtime. Known issues
425
426
// include: various points in the scheduler ("don't
426
427
// preempt between here and here"), much of the defer
427
428
// implementation (untyped info on stack), bulk write
428
- // barriers (write barrier check),
429
- // reflect.{makeFuncStub,methodValueCall}.
429
+ // barriers (write barrier check), atomic functions in
430
+ // internal/runtime/atomic, reflect.{makeFuncStub,methodValueCall}.
431
+ //
432
+ // Note that this is a subset of the runtimePkgs in pkgspecial.go
433
+ // and these checks are theoretically redundant because the compiler
434
+ // marks "all points" in runtime functions as unsafe for async preemption.
435
+ // But for some reason, we can't eliminate these checks until https://go.dev/issue/72031
436
+ // is resolved.
430
437
//
431
438
// TODO(austin): We should improve this, or opt things
432
439
// in incrementally.
0 commit comments