-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restore type cache pruning in sysimage saving #37650
Conversation
6da12d1
to
798a81a
Compare
Hmm, how do we convince the gc analyzer that the system image shenanigans are ok? The errors don't obviously point to changes in this PR so it makes me wonder how it worked before. |
Aren't all of these running with GC disabled? |
Yes. |
So it seems that |
798a81a
to
9284737
Compare
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.
Might be simpler to just NULL the references now (in a copy of the svec) then save/restore the ->cache
fields, instead of removing them and needing to mess with them on startup too?
How exactly would that work? How do we know which entries to NULL if the ->cache fields are also saved? |
This is a mark-and-sweep moving GC, so you'd handle it the same way as the GC handles WeakRef, in between the record and copy steps. |
Oh, I think I tried implementing it that way first --- skipping those fields during the serialize_value step. It seemed ugly to me to add a special case there, but maybe it's no worse than the alternative. |
9284737
to
76e0d68
Compare
Ok, this version does seem nicer to me. |
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.
Better, yes, but it's still corrupting the current runtime by sorting the tn->cache
field at the wrong time
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.
I don't think these types need to be a special case
76e0d68
to
2719879
Compare
Well, that's unexpected. Gotta love assertions. |
Hmm, I suppose the observed max probe distance is insertion-order-dependent, so rehashing to the same size is not guaranteed to work. |
yeah, we might want to do some sort of "replacements" htable, then we can put the correctly rehashed value in there? or just put the sentinel |
I'll try that. |
8a9229f
to
f3039b8
Compare
Seems to work. What do you think? |
Cool, looks like this might save 1-2 MB from the image |
Need to sequence operations correctly here. We need to first finish marking referenced data before we start deleting unreferenced data. This otherwise can lead to an assertion failure in some situations. Refs #37650
Need to sequence operations correctly here. We need to first finish marking referenced data before we start deleting unreferenced data. This otherwise can lead to an assertion failure in some situations. Refs #37650
Need to sequence operations correctly here. We need to first finish marking referenced data before we start deleting unreferenced data. This otherwise can lead to an assertion failure in some situations. Refs #37650
Need to sequence operations correctly here. We need to first finish marking referenced data before we start deleting unreferenced data. This otherwise can lead to an assertion failure in some situations. Refs #37650
Need to sequence operations correctly here. We need to first finish marking referenced data before we start deleting unreferenced data. This otherwise can lead to an assertion failure in some situations. Refs JuliaLang#37650
Need to sequence operations correctly here. We need to first finish marking referenced data before we start deleting unreferenced data. This otherwise can lead to an assertion failure in some situations. Refs JuliaLang#37650
The code for this had bitrotted --- dump.c initializes builtin_typenames but doesn't use it, and staticdata.c uses it but doesn't initialize it 😂 This makes it do something again. I noticed this when looking into tree shaking, and in the future it will be very useful for that, to avoid spurious references to things that could otherwise be removed.