Skip to content
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

GH-124483: Treat _Py_Dealloc as an escaping call in tier two #124615

Closed
wants to merge 6 commits into from

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Sep 26, 2024

This fixes various issues related to finalizers "invalidating the world".

Despite the fact that it executes about 29 billion additional _CHECK_VALIDITY, _SET_IP, and _CHECK_VALIDITY_AND_SET_IP instructions on the benchmarks, these are some of our cheapest uops, so performance and memory are both unaffected.

@brandtbucher brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump needs backport to 3.13 bugs and security fixes labels Sep 26, 2024
@brandtbucher brandtbucher self-assigned this Sep 26, 2024
@Fidget-Spinner
Copy link
Member

I thought Mark was planning to fix this by deferring Py_DECREF finalizers to safepoints? Or did that get deferred too?

@brandtbucher
Copy link
Member Author

brandtbucher commented Sep 30, 2024

I thought Mark was planning to fix this by deferring Py_DECREF finalizers to safepoints? Or did that get deferred too?

We may at some point, but this will keep things safe until then. We may also not defer all decrefs, depending on how disruptive it is to do so.

In any case, I'll wait until after #124392 is merged to pick this up and re-run the benchmarks, since this will introduce a lot of new spills.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review interpreter-core (Objects, Python, Grammar, and Parser dirs) needs backport to 3.13 bugs and security fixes type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants