Skip to content

gh-111968: Use per-thread freelists for generator in free-threading#114189

Merged
corona10 merged 3 commits into
python:mainfrom
corona10:gh-111968-generator
Jan 18, 2024
Merged

gh-111968: Use per-thread freelists for generator in free-threading#114189
corona10 merged 3 commits into
python:mainfrom
corona10:gh-111968-generator

Conversation

@corona10

@corona10 corona10 commented Jan 17, 2024

Copy link
Copy Markdown
Member

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@colesbury

Copy link
Copy Markdown
Contributor

@corona10, only tangentially related to this PR, but in PyThreadState_Clear(), I think we want to call _Py_ClearFreeLists(freelist_state, 1); -- I think we want to finalize the free-lists in PyThreadState_Clear() so that they aren't used (and memory leaked) later on during the thread exit process.

_Py_ClearFreeLists(freelist_state, 0);

@corona10
corona10 enabled auto-merge (squash) January 18, 2024 17:25
@corona10 corona10 closed this Jan 18, 2024
auto-merge was automatically disabled January 18, 2024 17:48

Pull request was closed

@corona10 corona10 reopened this Jan 18, 2024
@corona10
corona10 enabled auto-merge (squash) January 18, 2024 17:56
@corona10
corona10 merged commit 7fa511b into python:main Jan 18, 2024
@bedevere-bot

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Ubuntu NoGIL 3.x has failed when building commit 7fa511b.

What do you need to do:

  1. Don't panic.
  2. Check the 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/1225/builds/1204) and take a look at the build logs.
  4. Check if the failure is related to this commit (7fa511b) 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/1225/builds/1204

Failed tests:

  • test.test_concurrent_futures.test_process_pool
  • test_tools
  • test.test_multiprocessing_spawn.test_misc
  • test_perf_profiler
  • test_math

Failed subtests:

  • test_wait_integer - test.test_multiprocessing_spawn.test_misc.TestWait.test_wait_integer
  • test_map_timeout - test.test_concurrent_futures.test_process_pool.ProcessPoolSpawnProcessPoolExecutorTest.test_map_timeout
  • test_sys_api_with_existing_trampoline - test.test_perf_profiler.TestPerfTrampoline.test_sys_api_with_existing_trampoline

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_perf_profiler.py", line 48, in tearDown
    file.unlink()
    ~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/pathlib/__init__.py", line 763, in unlink
    os.unlink(self)
    ~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/perf-2445732.map'


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/_test_multiprocessing.py", line 5136, in test_wait_integer
    self.assertLess(delta, expected + 2)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
AssertionError: 5.792868422344327 not less than 5


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_concurrent_futures/executor.py", line 69, in test_map_timeout
    self.assertEqual([None, None], results)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [None, None] != []

@corona10
corona10 deleted the gh-111968-generator branch January 19, 2024 16:44
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants