GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-102304: Move _Py_RefTotal to _PyRuntimeState by ericsnowcurrently · Pull Request #102543 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Mar 8, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState.

Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead.

  • Issue: Move _Py_RefTotal to PyInterpreterState #102304

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ericsnowcurrently ericsnowcurrently added the skip news label Mar 8, 2023
@bedevere-bot bedevere-bot mentioned this pull request Mar 8, 2023
Move _Py_RefTotal to PyInterpreterState #102304
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Mar 8, 2023
@ericsnowcurrently

ericsnowcurrently commented Mar 8, 2023

Copy link
Copy Markdown
Member Author

CC @kumaraditya303

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently ericsnowcurrently mentioned this pull request Mar 8, 2023
gh-102304: Move the Total Refcount to PyInterpreterState #102545
Merged
ericsnowcurrently added 9 commits March 9, 2023 09:56
@ericsnowcurrently
_Py_RefTotal -> REFTOTAL.
005a143
@ericsnowcurrently
Separate the internal helper functions.
b5c783b
@ericsnowcurrently
Drop the Py_BUILD_CORE case.
d286080
@ericsnowcurrently
Add a blank line.
31a14ed
@ericsnowcurrently
_Py_GetRefTotal() -> _Py_GetGlobalRefTotal().
8ca3983
@ericsnowcurrently
Move _Py_RefTotal to _PyRuntimeState.
bff6a6d
@ericsnowcurrently
Include the legacy total in _Py_GetGlobalRefTotal().
5ab4c4b
@ericsnowcurrently
Fix get_global_refcount().
cc5a99a
@ericsnowcurrently
Stop being so clever with PyAPI_FUNC().
f382c4a
@ericsnowcurrently
ericsnowcurrently force-pushed the consolidate-py-reftotal branch from 8af10a5 to f382c4a Compare March 9, 2023 17:11
ericsnowcurrently added 8 commits March 9, 2023 12:10
@ericsnowcurrently
Drop unnecessary incr/decr to the reftotal.
38e0860
@ericsnowcurrently
Preserve the reftotal past runtime finalization.
7dc494d
@ericsnowcurrently
Avoid double-counting the final reftotal.
136be3a
@ericsnowcurrently
Factor out sync_legacy_reftotal().
0abec9c
@ericsnowcurrently
Drop last_legacy_reftotal.
6e4425c
@ericsnowcurrently
Fix the REFTOTAL macro.
49f1502
@ericsnowcurrently
_Py_ClearRefTotal() -> _Py_FinalizeRefTotal().
f874ae0
@ericsnowcurrently
Add a new global to the ingored list.
2fb3259
@ericsnowcurrently ericsnowcurrently added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 17, 2023
@bedevere-bot

bedevere-bot commented Mar 17, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 2fb3259 🤖

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 17, 2023
@ericsnowcurrently
Fix _Py_FinalizeRefTotal().
2a11934
@ericsnowcurrently
ericsnowcurrently marked this pull request as ready for review March 20, 2023 15:21
@ericsnowcurrently
ericsnowcurrently requested a review from a team as a code owner March 20, 2023 15:21
@ericsnowcurrently

ericsnowcurrently commented Mar 20, 2023

Copy link
Copy Markdown
Member Author

All the refleak buildbots are happy with this PR.

pritam-dey3 reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently
ericsnowcurrently merged commit ad77d16 into python:main Mar 20, 2023
@bedevere-bot bedevere-bot removed the awaiting core review label Mar 20, 2023
@ericsnowcurrently
ericsnowcurrently deleted the consolidate-py-reftotal branch March 20, 2023 16:03
@bedevere-bot

bedevere-bot commented Mar 20, 2023

Copy link
Copy Markdown

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

Hi! The buildbot x86 Gentoo Non-Debug with X 3.x has failed when building commit ad77d16.

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/58/builds/4078) and take a look at the build logs.
  4. Check if the failure is related to this commit (ad77d16) 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/58/builds/4078

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

Click to see traceback logs
remote: Enumerating objects: 46, done.        
remote: Counting objects:   2% (1/46)        
remote: Counting objects:   4% (2/46)        
remote: Counting objects:   6% (3/46)        
remote: Counting objects:   8% (4/46)        
remote: Counting objects:  10% (5/46)        
remote: Counting objects:  13% (6/46)        
remote: Counting objects:  15% (7/46)        
remote: Counting objects:  17% (8/46)        
remote: Counting objects:  19% (9/46)        
remote: Counting objects:  21% (10/46)        
remote: Counting objects:  23% (11/46)        
remote: Counting objects:  26% (12/46)        
remote: Counting objects:  28% (13/46)        
remote: Counting objects:  30% (14/46)        
remote: Counting objects:  32% (15/46)        
remote: Counting objects:  34% (16/46)        
remote: Counting objects:  36% (17/46)        
remote: Counting objects:  39% (18/46)        
remote: Counting objects:  41% (19/46)        
remote: Counting objects:  43% (20/46)        
remote: Counting objects:  45% (21/46)        
remote: Counting objects:  47% (22/46)        
remote: Counting objects:  50% (23/46)        
remote: Counting objects:  52% (24/46)        
remote: Counting objects:  54% (25/46)        
remote: Counting objects:  56% (26/46)        
remote: Counting objects:  58% (27/46)        
remote: Counting objects:  60% (28/46)        
remote: Counting objects:  63% (29/46)        
remote: Counting objects:  65% (30/46)        
remote: Counting objects:  67% (31/46)        
remote: Counting objects:  69% (32/46)        
remote: Counting objects:  71% (33/46)        
remote: Counting objects:  73% (34/46)        
remote: Counting objects:  76% (35/46)        
remote: Counting objects:  78% (36/46)        
remote: Counting objects:  80% (37/46)        
remote: Counting objects:  82% (38/46)        
remote: Counting objects:  84% (39/46)        
remote: Counting objects:  86% (40/46)        
remote: Counting objects:  89% (41/46)        
remote: Counting objects:  91% (42/46)        
remote: Counting objects:  93% (43/46)        
remote: Counting objects:  95% (44/46)        
remote: Counting objects:  97% (45/46)        
remote: Counting objects: 100% (46/46)        
remote: Counting objects: 100% (46/46), done.        
remote: Compressing objects:   5% (1/18)        
remote: Compressing objects:  11% (2/18)        
remote: Compressing objects:  16% (3/18)        
remote: Compressing objects:  22% (4/18)        
remote: Compressing objects:  27% (5/18)        
remote: Compressing objects:  33% (6/18)        
remote: Compressing objects:  38% (7/18)        
remote: Compressing objects:  44% (8/18)        
remote: Compressing objects:  50% (9/18)        
remote: Compressing objects:  55% (10/18)        
remote: Compressing objects:  61% (11/18)        
remote: Compressing objects:  66% (12/18)        
remote: Compressing objects:  72% (13/18)        
remote: Compressing objects:  77% (14/18)        
remote: Compressing objects:  83% (15/18)        
remote: Compressing objects:  88% (16/18)        
remote: Compressing objects:  94% (17/18)        
remote: Compressing objects: 100% (18/18)        
remote: Compressing objects: 100% (18/18), done.        
remote: Total 24 (delta 22), reused 6 (delta 6), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to 'ad77d16a6252c2e616bf41b981a6d919c1122b4d'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do 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 false

HEAD is now at ad77d16a62 gh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)
Switched to and reset branch 'main'

configure: WARNING: i686-pc-linux-gnu/gcc is not supported
configure: WARNING:

Platform "i686-pc-linux-gnu" with compiler "gcc" is not supported by the
CPython core team, see https://peps.python.org/pep-0011/ for more information.


Objects/obmalloc.c:775:1: warning: ‘always_inline’ function might not be inlinable [-Wattributes]
  775 | arena_map_get(pymem_block *p, int create)
      | ^~~~~~~~~~~~~
In file included from ./Include/Python.h:35,
                 from Python/pystate.c:4:
Python/pystate.c: In function ‘_PyRuntimeState_Fini’:
Python/pystate.c:486:33: error: ‘struct _py_object_runtime_state’ has no member named ‘reftotal’
  486 |     assert(runtime->object_state.reftotal == 0);
      |                                 ^
make: *** [Makefile:2583: Python/pystate.o] Error 1

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make: [Makefile:2669: clean-retain-profile] Error 1 (ignored)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Mar 20, 2023

Copy link
Copy Markdown

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

Hi! The buildbot ARM Raspbian 3.x has failed when building commit ad77d16.

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/424/builds/3539) and take a look at the build logs.
  4. Check if the failure is related to this commit (ad77d16) 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/424/builds/3539

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

Click to see traceback logs
remote: Enumerating objects: 46, done.        
remote: Counting objects:   2% (1/46)        
remote: Counting objects:   4% (2/46)        
remote: Counting objects:   6% (3/46)        
remote: Counting objects:   8% (4/46)        
remote: Counting objects:  10% (5/46)        
remote: Counting objects:  13% (6/46)        
remote: Counting objects:  15% (7/46)        
remote: Counting objects:  17% (8/46)        
remote: Counting objects:  19% (9/46)        
remote: Counting objects:  21% (10/46)        
remote: Counting objects:  23% (11/46)        
remote: Counting objects:  26% (12/46)        
remote: Counting objects:  28% (13/46)        
remote: Counting objects:  30% (14/46)        
remote: Counting objects:  32% (15/46)        
remote: Counting objects:  34% (16/46)        
remote: Counting objects:  36% (17/46)        
remote: Counting objects:  39% (18/46)        
remote: Counting objects:  41% (19/46)        
remote: Counting objects:  43% (20/46)        
remote: Counting objects:  45% (21/46)        
remote: Counting objects:  47% (22/46)        
remote: Counting objects:  50% (23/46)        
remote: Counting objects:  52% (24/46)        
remote: Counting objects:  54% (25/46)        
remote: Counting objects:  56% (26/46)        
remote: Counting objects:  58% (27/46)        
remote: Counting objects:  60% (28/46)        
remote: Counting objects:  63% (29/46)        
remote: Counting objects:  65% (30/46)        
remote: Counting objects:  67% (31/46)        
remote: Counting objects:  69% (32/46)        
remote: Counting objects:  71% (33/46)        
remote: Counting objects:  73% (34/46)        
remote: Counting objects:  76% (35/46)        
remote: Counting objects:  78% (36/46)        
remote: Counting objects:  80% (37/46)        
remote: Counting objects:  82% (38/46)        
remote: Counting objects:  84% (39/46)        
remote: Counting objects:  86% (40/46)        
remote: Counting objects:  89% (41/46)        
remote: Counting objects:  91% (42/46)        
remote: Counting objects:  93% (43/46)        
remote: Counting objects:  95% (44/46)        
remote: Counting objects:  97% (45/46)        
remote: Counting objects: 100% (46/46)        
remote: Counting objects: 100% (46/46), done.        
remote: Compressing objects:   5% (1/18)        
remote: Compressing objects:  11% (2/18)        
remote: Compressing objects:  16% (3/18)        
remote: Compressing objects:  22% (4/18)        
remote: Compressing objects:  27% (5/18)        
remote: Compressing objects:  33% (6/18)        
remote: Compressing objects:  38% (7/18)        
remote: Compressing objects:  44% (8/18)        
remote: Compressing objects:  50% (9/18)        
remote: Compressing objects:  55% (10/18)        
remote: Compressing objects:  61% (11/18)        
remote: Compressing objects:  66% (12/18)        
remote: Compressing objects:  72% (13/18)        
remote: Compressing objects:  77% (14/18)        
remote: Compressing objects:  83% (15/18)        
remote: Compressing objects:  88% (16/18)        
remote: Compressing objects:  94% (17/18)        
remote: Compressing objects: 100% (18/18)        
remote: Compressing objects: 100% (18/18), done.        
remote: Total 24 (delta 22), reused 6 (delta 6), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to 'ad77d16a6252c2e616bf41b981a6d919c1122b4d'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do 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 false

HEAD is now at ad77d16a62 gh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)
Switched to and reset branch 'main'

Objects/obmalloc.c:775:1: warning: ‘always_inline’ function might not be inlinable [-Wattributes]
  775 | arena_map_get(pymem_block *p, int create)
      | ^~~~~~~~~~~~~
In file included from ./Include/Python.h:35,
                 from Python/pystate.c:4:
Python/pystate.c: In function ‘_PyRuntimeState_Fini’:
Python/pystate.c:486:33: error: ‘struct _py_object_runtime_state’ has no member named ‘reftotal’
  486 |     assert(runtime->object_state.reftotal == 0);
      |                                 ^
make: *** [Makefile:2579: Python/pystate.o] Error 1
make: *** Waiting for unfinished jobs....

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make: [Makefile:2665: clean-retain-profile] Error 1 (ignored)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently ericsnowcurrently mentioned this pull request Mar 20, 2023
gh-102304: Fix Non-Debug Builds #102846
Merged
@ericsnowcurrently

ericsnowcurrently commented Mar 20, 2023

Copy link
Copy Markdown
Member Author

gh-102846 should take care of those buildbots.

zware reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ericsnowcurrently added a commit that referenced this pull request Mar 20, 2023
@ericsnowcurrently
gh-102304: Fix Non-Debug Builds (gh-102846)
5c75b7a
Some debug-only code slipped in with gh-102543.

#102304
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@ericsnowcurrently @Fidget-Spinner
pythongh-102304: Move _Py_RefTotal to _PyRuntimeState (pythongh-102543)
2b10a8d
The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState.

Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead.

python#102304
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@ericsnowcurrently @Fidget-Spinner
pythongh-102304: Fix Non-Debug Builds (pythongh-102846)
76fb37b
Some debug-only code slipped in with pythongh-102543.

python#102304
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@ericsnowcurrently @warsaw
pythongh-102304: Move _Py_RefTotal to _PyRuntimeState (pythongh-102543)
f3e8b5d
The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState.

Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead.

python#102304
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@ericsnowcurrently @warsaw
pythongh-102304: Fix Non-Debug Builds (pythongh-102846)
4f1afcc
Some debug-only code slipped in with pythongh-102543.

python#102304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ericsnowcurrently @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.