Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

GH-103906: Remove immortal refcounting in the interpreter#103909

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brandtbucher merged 7 commits intopython:mainfrombrandtbucher:immortal-interpreter
May 16, 2023

Conversation

@brandtbucher
Copy link
Member

@brandtbucherbrandtbucher commentedApr 26, 2023
edited by bedevere-bot
Loading

Copy link
Contributor

@hauntsaninjahauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hooray! Looks great

brandtbucher reacted with heart emoji
}
elseif (Py_IsFalse(cond)) {
_Py_DECREF_NO_DEALLOC(cond);
if (Py_IsFalse(cond)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Will this cause a performance change, since formerlyIsTrue thenIsFalse, nowIsFalse thenIsTrue

Though this comparison is lightweight.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Honestly, I doubt it.

@brandtbucherbrandtbucher marked this pull request as ready for reviewApril 27, 2023 04:15
@brandtbucherbrandtbucher added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelApr 27, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@brandtbucher for commitfd95518 🤖

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelApr 27, 2023
Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What about other places, likeModules/? Should it be done later?

@JelleZijlstra
Copy link
Member

@sobolevn possibly, but it's best left to a different PR. In many places it's unlikely to make a significant difference, so it might not be worth the churn to make the change everywhere.

@brandtbucher
Copy link
MemberAuthor

Annoyingly, perf impact isneutral.

However, it appears that the results are being pulledway down by a couple of known unstable benchmarks that should be unaffected by this change. I might try running them again tonight, just to see.

(I still think this is worth doing, though, as it clearly removes unnecessary work from many hot code paths.)

sunmy2019 reacted with eyes emoji

Copy link
Member

@markshannonmarkshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Even if the performance change is negligible, this seems like a worthwhile cleanup.

sunmy2019, JelleZijlstra, and carljm reacted with thumbs up emoji
@JelleZijlstra
Copy link
Member

I noticed one more opportunity like this: in theLIST_EXTEND opcode,none_val should always be None. Up to you whether that's worth including in this PR.

brandtbucher reacted with thumbs up emoji

@brandtbucherbrandtbucher merged commitb4a9747 intopython:mainMay 16, 2023
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 Ubuntu Shared 3.x has failed when building commitb4a9747.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/506/builds/4784) and take a look at the build logs.
  4. Check if the failure is related to this commit (b4a9747) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/506/builds/4784

Failed tests:

  • test__xxsubinterpreters

Summary of the results of the build (if available):

==

Click to see traceback logs
remote:Enumerating objects: 22, done.remote:Counting objects:   4% (1/22)remote:Counting objects:   9% (2/22)remote:Counting objects:  13% (3/22)remote:Counting objects:  18% (4/22)remote:Counting objects:  22% (5/22)remote:Counting objects:  27% (6/22)remote:Counting objects:  31% (7/22)remote:Counting objects:  36% (8/22)remote:Counting objects:  40% (9/22)remote:Counting objects:  45% (10/22)remote:Counting objects:  50% (11/22)remote:Counting objects:  54% (12/22)remote:Counting objects:  59% (13/22)remote:Counting objects:  63% (14/22)remote:Counting objects:  68% (15/22)remote:Counting objects:  72% (16/22)remote:Counting objects:  77% (17/22)remote:Counting objects:  81% (18/22)remote:Counting objects:  86% (19/22)remote:Counting objects:  90% (20/22)remote:Counting objects:  95% (21/22)remote:Counting objects: 100% (22/22)remote:Counting objects: 100% (22/22), done.remote:Compressing objects:  11% (1/9)remote:Compressing objects:  22% (2/9)remote:Compressing objects:  33% (3/9)remote:Compressing objects:  44% (4/9)remote:Compressing objects:  55% (5/9)remote:Compressing objects:  66% (6/9)remote:Compressing objects:  77% (7/9)remote:Compressing objects:  88% (8/9)remote:Compressing objects: 100% (9/9)remote:Compressing objects: 100% (9/9), done.remote:Total 12 (delta 10), reused 4 (delta 3), pack-reused 0From https://github.com/python/cpython * branch                  main       -> FETCH_HEADNote:switching to 'b4a974792355cb0f525211b2962679e68949f02e'.You are in 'detached HEAD' state. You can look around, make experimentalchanges and commit them, and you can discard any commits you make in thisstate without impacting any branches by switching back to a branch.If you want to create a new branch to retain commits you create, you maydo so (now or later) by using -c with the switch command. Example:  git switch -c <new-branch-name>Or undo this operation with:  git switch -Turn off this advice by setting config variable advice.detachedHead to falseHEAD is now at b4a9747923 GH-103906: Remove immortal refcounting in the interpreter (GH-103909)Switched to and reset branch 'main'configure:WARNING: pkg-config is missing. Some dependencies may not be detected correctly.Fatal Python error: drop_gil: PyMUTEX_LOCK(gil->switch_mutex) failedPython runtime state: initializedThread 0x00007f03237a3b80 (most recent call first):  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test__xxsubinterpreters.py", line 80 in clean_up_interpreters  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test__xxsubinterpreters.py", line 88 in tearDown  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 594 in _callTearDown  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 637 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 690 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/runner.py", line 240 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 1115 in _run_suite  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 1241 in run_unittest  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 294 in _test_module  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 330 in _runtest_inner2  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 373 in _runtest_inner  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 248 in _runtest  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 278 in runtest  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 365 in rerun_failed_tests  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 783 in _main  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 738 in main  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 802 in main  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/__main__.py", line 2 in <module>  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 88 in _run_code  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 198 in _run_module_as_mainFatal Python error: AbortedThread 0x00007f03237a3b80 (most recent call first):  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test__xxsubinterpreters.py", line 80 in clean_up_interpreters  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test__xxsubinterpreters.py", line 88 in tearDown  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 594 in _callTearDown  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 637 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 690 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 122 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", line 84 in __call__  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/runner.py", line 240 in run  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 1115 in _run_suite  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/__init__.py", line 1241 in run_unittest  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 294 in _test_module  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 330 in _runtest_inner2  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 373 in _runtest_inner  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 248 in _runtest  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/runtest.py", line 278 in runtest  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 365 in rerun_failed_tests  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 783 in _main  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 738 in main  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/libregrtest/main.py", line 802 in main  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/__main__.py", line 2 in <module>  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 88 in _run_code  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/runpy.py", line 198 in _run_module_as_mainExtension modules: _testcapi, _xxsubinterpreters (total: 2)Aborted (core dumped)make:*** [Makefile:1976: buildbottest] Error 134Cannot open file '/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/test-results.xml' for upload
brandtbucher reacted with thumbs down emoji

carljm added a commit to carljm/cpython that referenced this pull requestMay 17, 2023
* main: (26 commits)pythonGH-101520: Move tracemalloc functionality into core, leaving interface in Modules. (python#104508)  typing: Add more tests for TypeVar (python#104571)pythongh-104572: Improve error messages for invalid constructs in PEP 695 contexts (python#104573)  typing: Use PEP 695 syntax in typing.py (python#104553)pythongh-102153: Start stripping C0 control and space chars in `urlsplit` (python#102508)pythongh-104469: Update README.txt for _testcapi (pythongh-104529)pythonGH-103092: isolate `_elementtree` (python#104561)pythongh-104050: Add typing to Argument Clinic converters (python#104547)pythonGH-103906: Remove immortal refcounting in the interpreter (pythonGH-103909)pythongh-87474: Fix file descriptor leaks in subprocess.Popen (python#96351)pythonGH-103092: isolate `pyexpat`  (python#104506)pythongh-75367: Fix data descriptor detection in inspect.getattr_static (python#104517)pythongh-104050: Add more annotations to `Tools/clinic.py` (python#104544)pythongh-104555: Fix isinstance() and issubclass() for runtime-checkable protocols that use PEP 695 (python#104556)pythongh-103865: add monitoring support to LOAD_SUPER_ATTR (python#103866)  CODEOWNERS: Assign new PEP 695 files to myself (python#104551)pythonGH-104510: Fix refleaks in `_io` base types (python#104516)pythongh-104539: Fix indentation error in logging.config.rst (python#104545)pythongh-104050: Don't star-import 'types' in Argument Clinic (python#104543)pythongh-104050: Add basic typing to CConverter in clinic.py (python#104538)  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sobolevnsobolevnsobolevn left review comments

@sunmy2019sunmy2019sunmy2019 left review comments

@markshannonmarkshannonmarkshannon approved these changes

@hauntsaninjahauntsaninjahauntsaninja approved these changes

Assignees

@brandtbucherbrandtbucher

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagesprint

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@brandtbucher@bedevere-bot@JelleZijlstra@sobolevn@markshannon@hauntsaninja@sunmy2019

[8]ページ先頭

©2009-2025 Movatter.jp