Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-109369: Add machinery for deoptimizing tier2 executors, both individually and globally. #110384

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

Merged
merged 11 commits into from
Oct 23, 2023
Merged
Prev Previous commit
Fix unlinking of executors
  • Loading branch information
markshannon committed Oct 23, 2023
commit 11985eaea519d2a4bb7d206152edf5f2db9fd625
16 changes: 8 additions & 8 deletions 16 Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,8 @@ link_executor(_PyExecutorObject *executor)
head->vm_data.links.next = executor;
}
executor->vm_data.linked = true;
/* executor_list_head must be first in list */
assert(interp->executor_list_head->vm_data.links.previous == NULL);
}

static void
Expand All @@ -1089,17 +1091,15 @@ unlink_executor(_PyExecutorObject *executor)
if (next != NULL) {
next->vm_data.links.previous = prev;
}
else {
if (prev == NULL) {
// Both next and prev are NULL, so this must be the list head.
PyInterpreterState *interp = PyInterpreterState_Get();
assert(interp->executor_list_head == executor);
interp->executor_list_head = executor->vm_data.links.next;
}
}
if (prev != NULL) {
prev->vm_data.links.next = next;
}
else {
// prev == NULL implies that executor is the list head
PyInterpreterState *interp = PyInterpreterState_Get();
assert(interp->executor_list_head == executor);
interp->executor_list_head = next;
}
executor->vm_data.linked = false;
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.