Opened 4 years ago

Last modified 15 months ago

#7670 new bug

StablePtrs should be organized by generation for efficient minor collections

Reported by: ezyang Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 7.7
Keywords: Cc: remi, simonmar
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Currently, stable pointers are all in one giant pointer table (see markStablePtrTable); this results in pretty bad GC behavior when you create a lot of stable pointers (Peaker has a test-case which he thinks is suffering due to repeated traversal of the stable pointers list.) We should partition them up into generations like we do for mutable lists. There might be some trickiness keeping the table up-to-date after GCs.

Change History (11)

comment:1 Changed 4 years ago by simonmar

difficulty: Unknown

Right, we could do StablePtrs like mutable lists: keep them in a chain of blocks hanging off each generation. If parallel performance for creating StablePtrs is important you might even want to have per-Capability lists (it's not that hard, actually).

During a GC:

  • traverse the stable ptr lists for each generation we are collecting (only)
  • evacuate the object
  • place the pointer into the stable ptr list for the generation that the object is now in (found by Bdescr(p)->gen_no)

That is, for generations we collect, we throw away the old stable ptr lists and create new ones. (this is just like the mutable lists).

comment:2 Changed 4 years ago by EyalLotem

Oops! Attached the 7 patches meant for #7674 in this ticket :-( Is there a way to delete these attachments here?

comment:3 Changed 4 years ago by Remi

Cc: remi.turk@… added

comment:4 Changed 4 years ago by igloo

Milestone: 7.8.1

comment:5 Changed 3 years ago by thoughtpolice


Moving to 7.10.1

comment:6 Changed 2 years ago by thoughtpolice


Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:7 Changed 2 years ago by ezyang

Cc: simonmar added
Keywords: newcomer added

comment:8 Changed 21 months ago by thoughtpolice


Milestone renamed

comment:9 Changed 16 months ago by thomie

Milestone: 8.0.1

comment:10 Changed 16 months ago by thomie

Keywords: newcomer removed

Doesn't seem like a popular task. Removing keyword to keep the newcomers list fresh.

comment:11 Changed 15 months ago by Remi

Cc: remi added; remi.turk@… removed
Note: See TracTickets for help on using tickets.