(In reply to Jon Coppeard (:jonco) from comment #2)
(In reply to Steve Fink [:sfink] [:s:] from comment #0)
When debugGCSlice runs, it finishes that GC off and starts a new one.
Why does this happen? I would have thought it just finished the current one.
I think I fooled myself into misinterpreting this.
I was looking at the GC number to determine which GC I was looking at. But that is also incremented for minor GCs; I should have been looking at the major GC number. (Well, I was also basing it off of when the zone's sweep group index was being reset, but that was buggy -- see below.)
Though in stepping through this, one thing seems a little problematic -- while we are in the part of an incremental GC where we wait for first background finalization and then decommitting, we're constantly doing nursery collections and thus expensively tenuring everything. shouldCollectNurseryForSlice explicitly returns true for Finalize and Decommit -- why is that? (needinfo pbone for that.)
The real bug is in how I was clearing the zone's sweep group index. I hadn't realized that zones get constantly scheduled and unscheduled during an incremental GC. I was clearing it during scheduling. So while the patch here is probably fine to land, it won't fix what I was working on.